From a421eb9bdddfa7e2765456f756833d8941ac7a08 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Mon, 16 Jun 2025 05:42:58 -0400 Subject: fig-web: Initial puzzle site --- fig-utils/src/Fig/Utils/FFI.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fig-utils/src/Fig/Utils') 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 -- cgit v1.2.3