Module

Run.Console

Package
purescript-run-console-experiment
Repository
joneshf/purescript-run-console-experiment

#Console Source

data Console a

The possible messages we can have on the console

You'll only need to interact with this if you are writing an interpreter.

Constructors

Instances

#CONSOLE Source

type CONSOLE = FProxy Console

A type synonym to clean up some signatures

#_console Source

_console :: SProxy "console"

A helper for the console label used in row types.

You'll only need to interact with this if you are writing an interpreter.

#error Source

error :: forall r. String -> Run (console :: CONSOLE | r) Unit

#errorShow Source

errorShow :: forall r a. Show a => a -> Run (console :: CONSOLE | r) Unit

#info Source

info :: forall r. String -> Run (console :: CONSOLE | r) Unit

#infoShow Source

infoShow :: forall r a. Show a => a -> Run (console :: CONSOLE | r) Unit

#log Source

log :: forall r. String -> Run (console :: CONSOLE | r) Unit

#logShow Source

logShow :: forall r a. Show a => a -> Run (console :: CONSOLE | r) Unit

#warn Source

warn :: forall r. String -> Run (console :: CONSOLE | r) Unit

#warnShow Source

warnShow :: forall r a. Show a => a -> Run (console :: CONSOLE | r) Unit

#runAccumulate Source

runAccumulate :: forall r a. Run (console :: CONSOLE | r) a -> Run r (List String)

Accumulates all console messages into a list but does not print any to the console.

Useful when you want to see what would be printed to the console.

#runConsole Source

runConsole :: forall r e a. Run (console :: CONSOLE, eff :: EFF (console :: CONSOLE | e) | r) a -> Run (eff :: EFF (console :: CONSOLE | e) | r) a

Prints all messages to the console.

Normally this is what you'll use to print to the console.

#runEff Source

runEff :: forall r e a. Console ~> (Eff (console :: CONSOLE | e)) -> Run (console :: CONSOLE, eff :: EFF (console :: CONSOLE | e) | r) a -> Run (eff :: EFF (console :: CONSOLE | e) | r) a

Runs the given function in an effectful context. This converts the CONSOLE type into a Control.Monad.Eff.Console.CONSOLE effect.

Useful for building up new effectful interpreters.

#runNoConsole Source

runNoConsole :: forall r a. Run (console :: CONSOLE | r) a -> Run r a

Runs without printing any messages to the console.

Useful when you want to eliminate the CONSOLE type without printing anything to the console.

#runPure Source

runPure :: forall r a. (Console (Run (console :: CONSOLE | r) a) -> Run (console :: CONSOLE | r) a) -> Run (console :: CONSOLE | r) a -> Run r a

Runs the given function in a pure context eliminating the CONSOLE type.

Useful for building up new pure interpreters.

Modules
Run.Console