Skip to content

clarify that Decode.map2 takes a constructor function as first argument#243

Open
lady3bean wants to merge 1 commit intoevancz:masterfrom
lady3bean:decoders-and-constructors
Open

clarify that Decode.map2 takes a constructor function as first argument#243
lady3bean wants to merge 1 commit intoevancz:masterfrom
lady3bean:decoders-and-constructors

Conversation

@lady3bean
Copy link
Copy Markdown

I noticed that the section on Json.Decode.map2 implies that map2 takes two decoders as its arguments, when in fact it takes three, the first one being a constructor function. This PR clarifies what the first argument to map2 is.

Yesterday I was working on decoding for an opaque type, and thus had to write my own constructor function in order to build a decoder. It was then that I realized the docs here are a little misleading, since they don't mention that the first argument has to be a constructor function.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant