her.esy.fun/src/posts/0010-Haskell-Now/list.hs

11 lines
227 B
Haskell
Raw Normal View History

2019-12-25 15:35:56 +00:00
infixr 5 :::
data List a = Nil | a ::: (List a)
deriving (Show,Read,Eq,Ord)
convertList [] = Nil
convertList (x:xs) = x ::: convertList xs
main = do
print (0 ::: 1 ::: Nil)
print (convertList [0,1])