CompilingCoinduction.agda 627 B

1234567891011121314151617181920212223242526272829
  1. {-# OPTIONS --guardedness #-}
  2. module CompilingCoinduction where
  3. open import Common.Coinduction
  4. open import Common.Char
  5. open import Common.String
  6. data Unit : Set where
  7. unit : Unit
  8. {-# COMPILE GHC Unit = data () (()) #-}
  9. postulate
  10. IO : Set → Set
  11. {-# COMPILE GHC IO = type IO #-}
  12. {-# BUILTIN IO IO #-}
  13. {-# FOREIGN GHC import qualified Data.Text.IO #-}
  14. postulate
  15. putStrLn : ∞ String → IO Unit
  16. {-# COMPILE GHC putStrLn = Data.Text.IO.putStrLn . MAlonzo.RTE.flat #-}
  17. {-# COMPILE JS putStrLn = function(x) { return function(cb) { process.stdout.write(x.flat() + "\n"); cb(0); }; } #-}
  18. main = putStrLn (♯ "a")