Idris2/tests/chez/constfold3/Fold.idr

13 lines
346 B
Idris
Raw Permalink Normal View History

2023-05-06 10:50:30 +03:00
public export
data Singleton : {0 a : Type} -> (x : a) -> Type where
MkSingleton : (x : a) -> Singleton x
Show a => Show (Singleton {a} v) where show (MkSingleton v) = show v
export
unsafeMkSingleton : (y : a) -> Singleton {a} x
unsafeMkSingleton y = believe_me (MkSingleton y)
main : IO ()
main = printLn $ unsafeMkSingleton {x = 12} (S Z)