Last active
August 29, 2015 14:26
-
-
Save kakkun61/d79036cb4d5f8db1ba8a to your computer and use it in GitHub Desktop.
How to import effects explicitly in PureScript?
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
-- This is not OK. | |
module MainNG where | |
import Prelude (Unit) | |
import Control.Monad.Eff (Eff) | |
import Control.Monad.Eff.Console (CONSOLE, log) | |
main :: forall eff. Eff (console :: CONSOLE | eff) Unit | |
main = log "Hi" | |
-- Error: | |
-- Error in module Main: | |
-- Error at line 6, column 1 - line 7, column 1: | |
-- Unknown type class Control.Monad.Eff.Eff | |
-- See https://github.com/purescript/purescript/wiki/Error-Code-UnknownTypeClass for more information, or to contribute content related to this error. |
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
-- This is OK. | |
module MainOK where | |
import Prelude | |
import Control.Monad.Eff | |
import Control.Monad.Eff.Console | |
main :: forall eff. Eff (console :: CONSOLE | eff) Unit | |
main = log "Hi" |
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 Solution where | |
import Prelude (Unit()) | |
import Control.Monad.Eff (Eff()) | |
import Control.Monad.Eff.Console (CONSOLE(), log) | |
main :: forall eff. Eff (console :: CONSOLE | eff) Unit | |
main = log "Hi" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
import Control.Monad.Eff (Eff())
https://twitter.com/paf31/status/628276419617906688