Skip to content

Instantly share code, notes, and snippets.

@dustinfarris
Last active September 28, 2017 23:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dustinfarris/85ee8f51d741e03f95d0fd8cf502d0f6 to your computer and use it in GitHub Desktop.
Save dustinfarris/85ee8f51d741e03f95d0fd8cf502d0f6 to your computer and use it in GitHub Desktop.
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