Last active
March 14, 2025 14:32
-
-
Save bond15/d8e278a73a8c135245f23880cc4f2bc9 to your computer and use it in GitHub Desktop.
FFIs should compose ;)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# OPTIONS --guardedness --type-in-type #-} | |
module cursed where | |
open import Agda.Builtin.String | |
open import IO | |
postulate | |
ex' : String | |
{-# FOREIGN GHC | |
{-# LANGUAGE ForeignFunctionInterface #-} | |
import Data.Text | |
foreign import ccall "exp" c_exp :: Double -> Double | |
ex :: Text | |
ex = pack $ show $ c_exp 2 | |
#-} | |
{-# COMPILE GHC ex' = ex #-} | |
main = run (putStrLn ex') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment