Last active
September 28, 2017 23:30
-
-
Save dustinfarris/85ee8f51d741e03f95d0fd8cf502d0f6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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