Skip to content

Instantly share code, notes, and snippets.

@boombang
Last active September 26, 2019 21:34
Show Gist options
  • Save boombang/cfbb70a69d86dde67d94a425ad7fd94e to your computer and use it in GitHub Desktop.
Save boombang/cfbb70a69d86dde67d94a425ad7fd94e to your computer and use it in GitHub Desktop.
lampard =
{ name = "Frank"
, lastname = "Lampard"
, age = 41
}
type alias Player =
{ name : String
, lastname : String
, age : Int
}
gerrard : Player
gerrard =
{ name = "Steven"
, lastname = "Gerrard"
, age = 39
}
beckham =
Player "David" "Beckham" 44
names : List String
names =
List.map
(\player -> player.name)
[ lampard, gerrard, beckham ]
lastnames : List String
lastnames =
List.map
.lastname
[ lampard, gerrard, beckham ]
changeName : Player -> String -> Player
changeName player name =
{ player | name = name }
stevenBeckham =
changeName beckham "Steven"
main =
text stevenBeckham.name
-- main =
-- text (.name stevenBeckham)
type alias IsValid =
Bool
type alias Message =
String
type alias ValidationResult =
( IsValid, Message )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment