Skip to content

Instantly share code, notes, and snippets.

@ggb
Last active October 5, 2016 10:00
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ggb/07fdf196e0f14eab461ad62b4506c942 to your computer and use it in GitHub Desktop.
Save ggb/07fdf196e0f14eab461ad62b4506c942 to your computer and use it in GitHub Desktop.
import Html exposing (text)
type alias T = {name: String}
type alias R b = {b | name: String, age: Float}
type alias S a = {a | name: String}
type alias Q = {age: Float}
check : R b -> String
check {name,age} = name
update : S a -> S a
update v = {v | name = v.name ++ "!"}
update2 : R a -> S {a | age: Float}
update2 v = {v | name = v.name ++ "!"}
v : S (R {})
v = {name = "Knut", age = 17.0}
main =
text (update v |> .name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment