| Safe Haskell | Safe-Inferred |
|---|
PreludeExamples
Synopsis
- myZip :: [a] -> [b] -> [(a, b)]
- addToFront :: a -> b -> ([a], [b]) -> ([a], [b])
- myUnzip :: [(a, b)] -> ([a], [b])
- nth :: [a] -> Int -> a
- myTake :: Int -> [a] -> [a]
- myCatMaybes :: [Maybe a] -> [a]
- isPositive :: Int -> Bool
- type Name = String
- type Age = Int
- type StudentNo = Int
- type CourseCode = String
- data Student = Student Name Age CourseCode StudentNo
- type Database = [Student]
- findId :: StudentNo -> Database -> Maybe Student
Documentation
addToFront :: a -> b -> ([a], [b]) -> ([a], [b]) #
myCatMaybes :: [Maybe a] -> [a] #
myCatMaybes takes a list of Maybe values lst and returns all values contained inside Just within lst.
>>>catMaybes [Just 1, Nothing, Just 3][1,3]
isPositive :: Int -> Bool #
type CourseCode = String #