-> Bool hasLongName user = String.length user.lastName > 3 type alias FirstName = String type alias User = { lastName : String , firstName : FirstName } hasLongName : User -> Boolean
fields type alias User = { name : String, age : Maybe Int } -- partial functions head : List a -> Maybe a head list = case list of x :: xs -> Just x [] -> Nothing
2.0.0... This is a MAJOR change. ------ Changes to module Html.Attributes - MAJOR ------ Changed: - colspan : String -> Attribute + colspan : Int -> Attribute - rowspan : String -> Attribute + rowspan : Int -> Attribute
2 multiply2 "2" The argument to function `multiply2` is causing a mismatch. 6| multiply2 "2" ^^^ Function `multiply2` is expecting the argument to be: Int But it is: String
Maybe a -> Maybe b -- applicative map2 : (a -> b -> value) -> Maybe a -> Maybe b -> Maybe value -- monad andThen : (a -> Maybe b) -> Maybe a -> Maybe b -- traversable sequence : List (Task x a) -> Task x (List a)
Dict comparable v -- haskell insert :: Ord k => k -> a -> Map k a -> Map k a • Ord k is typeclass • comparable is compiler magic • can not define own instance for custom datatype • Hint: Only ints, floats, chars, strings, lists, and tuples are comparable.