Create a gist now

Instantly share code, notes, and snippets.

Embed
module Main exposing (..)
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
main =
Html.beginnerProgram { model = model, view = view, update = update }
type alias UserInfo =
{ name : String, age : Int }
type alias Coach =
{ name : String, age : Int, sports : String }
model =
UserInfo "" 0
getUserAge : UserInfo -> Int
getUserAge record =
record.age
printAge =
let
sam =
UserInfo "Sam" 24
charlie =
Coach "Charlie" 52 "Basketball"
in
sam.name ++ " is " ++ toString sam.age ++ " " ++ charlie.name ++ " is " ++ toString charlie.age
type Msg
= Noop
update : Msg -> UserInfo -> UserInfo
update msg model =
model
view : UserInfo -> Html Msg
view model =
div [] [ text printAge ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment