Slide 29
Slide 29 text
type alias User = { name : Maybe String }
formatName : Maybe User -> Maybe String
formatName maybeUser =
case maybesUser of
Just user ->
case startsWithVowel user.name of
Just True ->
case user.name of
Just name -> Just <| "*" ++ String.toLower name
Nothing -> Nothing -- should never happen
Just False ->
case user.name of
Just name -> Just <| String.toLower name
Nothing -> Nothing -- should never happen
Nothing -> Just "Anonymous"
startsWithVowel : Maybe String -> Maybe Bool
startsWithVowel name =
-- ...