mirror of
https://github.com/ilyakooo0/Idris-dev.git
synced 2024-11-15 01:25:05 +03:00
17c7240825
+ Tutorial is now developed in a separate github repo. + Moved examples to top-level + Added binary of tutorial for v0.9.10
17 lines
403 B
Idris
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)
|
|
|