Idris-dev/examples/letbind.idr
Jan de Muijnck-Hughes 17c7240825 Tutorial changes.
+ Tutorial is now developed in a separate github repo.
+ Moved examples to top-level
+ Added binary of tutorial for v0.9.10
2013-11-28 11:40:27 +00:00

17 lines
403 B
Idris

module letbind
mirror : List a -> List a
mirror xs = let xs' = reverse xs in
xs ++ xs'
data Person = MkPerson String Int
showPerson : Person -> String
showPerson p = let MkPerson name age = p in
name ++ " is " ++ show age ++ " years old"
splitAt : Char -> String -> (String, String)
splitAt c x = case break (== c) x of
(x, y) => (x, strTail y)