summaryrefslogtreecommitdiff
path: root/src/runtime/haskell-bind/PGF2.hsc
diff options
context:
space:
mode:
authorKrasimir Angelov <kr.angelov@gmail.com>2017-08-30 18:11:59 +0200
committerKrasimir Angelov <kr.angelov@gmail.com>2017-08-30 18:11:59 +0200
commitcd53269f96873f228e196cb6d22d101c5e4f50ed (patch)
tree8998df85bf55b8a228ff95f1b2c3febef6505e8a /src/runtime/haskell-bind/PGF2.hsc
parentfd56b4b5f3d08cabb807f2ea5f397da38cc26a0a (diff)
bugfix for hasLinearization in the Haskell binding
Diffstat (limited to 'src/runtime/haskell-bind/PGF2.hsc')
-rw-r--r--src/runtime/haskell-bind/PGF2.hsc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/runtime/haskell-bind/PGF2.hsc b/src/runtime/haskell-bind/PGF2.hsc
index a23982465..93158213f 100644
--- a/src/runtime/haskell-bind/PGF2.hsc
+++ b/src/runtime/haskell-bind/PGF2.hsc
@@ -580,8 +580,9 @@ parseWithOracle lang cat sent (predict,complete,literal) =
-- | Returns True if there is a linearization defined for that function in that language
hasLinearization :: Concr -> Fun -> Bool
hasLinearization lang id = unsafePerformIO $
- withGuPool $ \pl ->
- newUtf8CString id pl >>= pgf_has_linearization (concr lang)
+ withGuPool $ \pl -> do
+ res <- newUtf8CString id pl >>= pgf_has_linearization (concr lang)
+ return (res /= 0)
-- | Linearizes an expression as a string in the language
linearize :: Concr -> Expr -> String