Created
February 22, 2022 15:45
-
-
Save alejandrociatti/6a5946871a7c6e82430fc07caa6ecea2 to your computer and use it in GitHub Desktop.
This file contains 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
loggingDecoder : Decoder a -> Decoder a | |
loggingDecoder decoderToDebug = | |
D.value | |
|> D.andThen | |
(\value -> | |
case D.decodeValue decoderToDebug value of | |
Ok decoded -> | |
D.succeed decoded | |
Err error -> | |
D.fail <| Debug.log "decode error" <| Debug.toString error | |
) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment