module IO.Primitive where
open import Data.String
open import Data.Char
open import Foreign.Haskell
postulate
IO : ∀ {ℓ} → Set ℓ → Set ℓ
{-# IMPORT IO.FFI #-}
{-# COMPILED_TYPE IO IO.FFI.AgdaIO #-}
{-# BUILTIN IO IO #-}
infixl 1 _>>=_
postulate
return : ∀ {a} {A : Set a} → A → IO A
_>>=_ : ∀ {a b} {A : Set a} {B : Set b} → IO A → (A → IO B) → IO B
{-# COMPILED return (\_ _ -> return) #-}
{-# COMPILED _>>=_ (\_ _ _ _ -> (>>=)) #-}
postulate
getContents : IO Costring
readFile : String → IO Costring
writeFile : String → Costring → IO Unit
appendFile : String → Costring → IO Unit
putStr : Costring → IO Unit
putStrLn : Costring → IO Unit
{-# COMPILED getContents getContents #-}
{-# COMPILED readFile readFile #-}
{-# COMPILED writeFile writeFile #-}
{-# COMPILED appendFile appendFile #-}
{-# COMPILED putStr putStr #-}
{-# COMPILED putStrLn putStrLn #-}