janwirth / elm-coder-generator

Generate encoders and decoders for elm/json
MIT License
12 stars 1 forks source link

Fix sets #1

Open janwirth opened 5 years ago

janwirth commented 5 years ago
-- [decgen-start]
type alias A = Set.Set Int
type alias Rec = {set : Set.Set Int}

-- [decgen-generated-start] -- DO NOT MODIFY or remove this line
decodeA =
   Decode.map Set.Set Decode.int

decodeRec =
   Decode.map
      Rec
         ( Decode.field "set" decodeSet.SetInt )

encodeA (Set.Set a1) =
   Encode.int a1

encodeRec a =
   Encode.object
      [ ("set", encodeSet.SetInt a.set)
      ] 
-- [decgen-end]