|
1 |
| -module Control.Monad.Aff.Console where |
| 1 | +module Control.Monad.Aff.Console |
| 2 | + ( module Exports |
| 3 | + , log |
| 4 | + , logShow |
| 5 | + , warn |
| 6 | + , warnShow |
| 7 | + , error |
| 8 | + , errorShow |
| 9 | + , info |
| 10 | + , infoShow |
| 11 | + ) where |
2 | 12 |
|
3 | 13 | import Prelude
|
| 14 | +import Control.Monad.Eff.Console (CONSOLE) as Exports |
4 | 15 | import Control.Monad.Eff.Console as C
|
5 | 16 |
|
6 |
| -import Control.Monad.Aff (Aff()) |
| 17 | +import Control.Monad.Aff (Aff) |
7 | 18 | import Control.Monad.Eff.Class (liftEff)
|
8 | 19 |
|
9 |
| --- | Logs any string to the console. This basically saves you |
10 |
| --- | from writing `liftEff $ log x` everywhere. |
11 |
| -log :: forall e. String -> Aff (console :: C.CONSOLE | e) Unit |
| 20 | +-- | Write a message to the console. Shorthand for `liftEff $ log x`. |
| 21 | +log :: forall eff. String -> Aff (console :: C.CONSOLE | eff) Unit |
12 | 22 | log = liftEff <<< C.log
|
13 | 23 |
|
14 |
| --- | Logs any `Show`-able value to the console. This basically saves you |
15 |
| --- | from writing `liftEff $ logShow x` everywhere. |
16 |
| -logShow :: forall e a. (Show a) => a -> Aff (console :: C.CONSOLE | e) Unit |
| 24 | +-- | Write a value to the console, using its `Show` instance to produce a |
| 25 | +-- | `String`. Shorthand for `liftEff $ logShow x`. |
| 26 | +logShow :: forall a eff. Show a => a -> Aff (console :: C.CONSOLE | eff) Unit |
17 | 27 | logShow = liftEff <<< C.logShow
|
| 28 | + |
| 29 | +-- | Write a warning to the console. Shorthand for `liftEff $ warn x`. |
| 30 | +warn :: forall eff. String -> Aff (console :: C.CONSOLE | eff) Unit |
| 31 | +warn = liftEff <<< C.warn |
| 32 | + |
| 33 | +-- | Write a warning value to the console, using its `Show` instance to produce |
| 34 | +-- | a `String`. Shorthand for `liftEff $ warnShow x`. |
| 35 | +warnShow :: forall a eff. Show a => a -> Aff (console :: C.CONSOLE | eff) Unit |
| 36 | +warnShow = liftEff <<< C.warnShow |
| 37 | + |
| 38 | +-- | Write an error to the console. Shorthand for `liftEff $ error x`. |
| 39 | +error :: forall eff. String -> Aff (console :: C.CONSOLE | eff) Unit |
| 40 | +error = liftEff <<< C.error |
| 41 | + |
| 42 | +-- | Write an error value to the console, using its `Show` instance to produce a |
| 43 | +-- | `String`. Shorthand for `liftEff $ errorShow x`. |
| 44 | +errorShow :: forall a eff. Show a => a -> Aff (console :: C.CONSOLE | eff) Unit |
| 45 | +errorShow = liftEff <<< C.errorShow |
| 46 | + |
| 47 | +-- | Write an info message to the console. Shorthand for `liftEff $ info x`. |
| 48 | +info :: forall eff. String -> Aff (console :: C.CONSOLE | eff) Unit |
| 49 | +info = liftEff <<< C.info |
| 50 | + |
| 51 | +-- | Write an info value to the console, using its `Show` instance to produce a |
| 52 | +-- | `String`. Shorthand for `liftEff $ infoShow x`. |
| 53 | +infoShow :: forall a eff. Show a => a -> Aff (console :: C.CONSOLE | eff) Unit |
| 54 | +infoShow = liftEff <<< C.infoShow |
0 commit comments