1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
module Model.Size exposing ( Size , sizeDecoder ) import Json.Decode as Json exposing ((:=)) type alias Size = { width: Int , height: Int } sizeDecoder : Json.Decoder Size sizeDecoder = Json.object2 Size ("width" := Json.int) ("height" := Json.int)