packages feed

idris-0.9.0: tutorial/examples/letbind.idr

module letbind

mirror : List a -> List a
mirror xs = let xs' = rev xs in
                app 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)