Skip to content

Instantly share code, notes, and snippets.

@dustinfarris
Last active September 28, 2017 23:30
module Person exposing (..)
import Json.Decode exposing (Decoder, int, string)
import Json.Decode.Pipeline exposing (decode, required)
type alias Person =
{ id : Int
, firstName : String
, lastName : String
}
personDecoder : Decoder Person
personDecoder =
decode Person
|> required "id" int
|> required "first_name" string
|> required "last_name" string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment