Skip to content

Instead of producing {{Module}}.Auto module, append encoder/decoders inside {{Module}} file itself #4

Description

@choonkeat

Upside 馃憤 we don't force the hand of the developers to expose the innards of the types

module Example exposing (Opaque)

type Opaque = Opaque String Int

... more code

-- SPECIAL COMMENT
-- EVERYTHING BELOW IS AUTO GENERATED

autoDecodeOpaque : Json.Decode.Decoder Opaque
autoDecodeOpaque = ... more code

autoEncodeOpaque : Opaque -> Json.Encode.Value
autoEncodeOpaque a = ... more code

Downside 馃憥 developers will have unignorable diff in their code commits
(instead of inlining, standard encoder decoders should be published as elm package for import to reduce the noise here)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions