Issue5602.agda 511 B

123456789101112131415161718192021222324252627
  1. open import Agda.Builtin.IO
  2. open import Agda.Builtin.String
  3. open import Agda.Builtin.Unit
  4. postulate
  5. putStr : String → IO ⊤
  6. {-# FOREIGN GHC import qualified Data.Text.IO #-}
  7. {-# COMPILE GHC putStr = Data.Text.IO.putStr #-}
  8. {-# COMPILE JS putStr =
  9. function (x) {
  10. return function(cb) {
  11. process.stdout.write(x); cb(0); }; } #-}
  12. F : Set → Set
  13. F A = A → A
  14. data D : Set where
  15. c₀ : D
  16. c₁ : F D
  17. f : D → String
  18. f c₀ = "OK\n"
  19. f (c₁ x) = f x
  20. main = putStr (f (c₁ c₀))