Skip to content

Instantly share code, notes, and snippets.

@bond15
Created May 22, 2022 21:24
Show Gist options
  • Save bond15/d8e278a73a8c135245f23880cc4f2bc9 to your computer and use it in GitHub Desktop.
Save bond15/d8e278a73a8c135245f23880cc4f2bc9 to your computer and use it in GitHub Desktop.
FFIs should compose ;)
{-# OPTIONS --guardedness #-}
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 "Hello, World!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment