Last active
April 15, 2016 19:08
-
-
Save halfzebra/657667763454d91353a6ac739c40c3cf to your computer and use it in GitHub Desktop.
Maybe.withDefault crashes every time, because it evaluates both branches first
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
import Graphics.Element exposing (show) | |
import Debug | |
import Maybe exposing (..) | |
main = | |
-- Maybe.withDefault crashes every time, because it evaluates both branches first, before passing them to case | |
-- https://github.com/elm-lang/core/blob/4.0.0/src/Maybe.elm#L51 | |
show (withDefault (Debug.crash "Test") (Just 1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment