Skip to content

Instantly share code, notes, and snippets.

@raichoo
Created March 17, 2016 18:43
Show Gist options
  • Save raichoo/ba1f7b630a1cadbb84b9 to your computer and use it in GitHub Desktop.
Save raichoo/ba1f7b630a1cadbb84b9 to your computer and use it in GitHub Desktop.
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