Created
May 25, 2017 14:20
-
-
Save tmountain/c894ea2c9eab8c500a7a86686855716f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Html exposing (text) | |
type alias User = | |
{ name : String | |
, age : Maybe Int | |
} | |
canBuyAlcohol : User -> Bool | |
canBuyAlcohol user = | |
case user.age of | |
Nothing -> | |
False | |
Just age -> | |
age >= 21 | |
user = User "Travis" (Just 37) | |
main = | |
text <| toString <| canBuyAlcohol user |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment