Idris2/tests/idris2/basic/basic031/erased.idr
2023-09-07 14:57:22 +01:00

16 lines
377 B
Idris

data MyMaybe : (0 x : Type) -> Type where
MyNothing : MyMaybe a
MyJust : a -> MyMaybe a
-- Should fail since type argument is deleted
nameOf : Type -> String
nameOf (MyMaybe Bool) = "MyMaybe Bool"
nameOf (MyMaybe Int) = "MyMaybe Int"
nameOf _ = "Unknown"
main : IO ()
main = do
putStrLn (nameOf (MyMaybe Bool))
putStrLn (nameOf (MyMaybe Int))
putStrLn (nameOf Int)