Created
November 15, 2016 18:11
-
-
Save m-renaud/2ecb11ad1d1d7a8141f7116f4def5bb1 to your computer and use it in GitHub Desktop.
Custom decoder in elm 0.18
This file contains hidden or 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
customDecoder decoder toResult = | |
Json.andThen | |
(\a -> | |
case toResult a of | |
Ok b -> Json.succeed b | |
Err err -> Json.fail err | |
) | |
decoder |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment