Issue2486.agda 694 B

12345678910111213141516171819202122232425262728293031323334353637
  1. module Issue2486 where
  2. open import Common.Prelude
  3. open import Issue2486.Import
  4. open import Issue2486.ImportB
  5. open import Issue2486.HaskellB
  6. f : MyList String → String
  7. f [] = "sdf"
  8. f (x :: _) = x
  9. xs : MyList String
  10. xs = "sdfg" :: []
  11. postulate
  12. toBList : ∀ {A} → MyList A → BList A
  13. fromBList : ∀ {A} → BList A → MyList A
  14. {-# COMPILE GHC toBList = \ _ xs -> xs #-}
  15. {-# COMPILE GHC fromBList = \ _ xs -> xs #-}
  16. {-# FOREIGN GHC import qualified MAlonzo.Code.Issue2486.HaskellB as B #-}
  17. data Test : Set where
  18. Con : BBool → Test
  19. {-# COMPILE GHC Test = data B.Test ( B.Con ) #-}
  20. {-
  21. ff : BBool
  22. ff = BTrue
  23. -}
  24. main : IO Unit
  25. main =
  26. putStrLn (f (fromBList (toBList xs)))