Created
March 17, 2016 18:43
-
-
Save raichoo/ba1f7b630a1cadbb84b9 to your computer and use it in GitHub Desktop.
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
module Main where | |
import Prelude | |
import Control.Monad.Eff | |
import Control.Monad.Eff.Console | |
import Debug.Trace | |
import Data.Maybe | |
expensiveComputation :: Int | |
expensiveComputation = 666 | |
main :: forall e. Eff (console :: CONSOLE | e) Unit | |
main = | |
-- The expensive computation happens even though it should not. | |
let x = fromMaybe | |
(trace "NOPE!" (\_ -> expensiveComputation)) | |
(Just 1337) | |
in log (show x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment