diff options
| author | LLLL Colonq <llll@colonq> | 2025-06-16 05:42:58 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2025-06-16 05:42:58 -0400 |
| commit | a421eb9bdddfa7e2765456f756833d8941ac7a08 (patch) | |
| tree | fb07429aff4bf970435c6465ffa56eb8eb54d28c /fig-utils/src/Fig/Utils/FFI.hs | |
| parent | 7c3e41979478d6826f73a956a26c967aae1687a2 (diff) | |
fig-web: Initial puzzle site
Diffstat (limited to 'fig-utils/src/Fig/Utils/FFI.hs')
| -rw-r--r-- | fig-utils/src/Fig/Utils/FFI.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fig-utils/src/Fig/Utils/FFI.hs b/fig-utils/src/Fig/Utils/FFI.hs index b5ee80e..be5e612 100644 --- a/fig-utils/src/Fig/Utils/FFI.hs +++ b/fig-utils/src/Fig/Utils/FFI.hs @@ -9,8 +9,8 @@ import Foreign.Marshal.Alloc foreign import ccall "check_answer" c_check_answer :: Ptr CString -> CString -> CString -> IO Int -checkAnswer :: Text -> Text -> IO (Either Text Bool) -checkAnswer tcode tanswer = +checkAnswer :: MonadIO m => Text -> Text -> m (Either Text Bool) +checkAnswer tcode tanswer = liftIO $ withCString (unpack tcode) $ \code -> withCString (unpack tanswer) $ \answer -> alloca $ \rerr -> do |
