trypurescript icon indicating copy to clipboard operation
trypurescript copied to clipboard

Support console clear function

Open lorezzed opened this issue 8 years ago • 2 comments

submitted at https://github.com/purescript/purescript-console/issues/11

lorezzed avatar Feb 12 '17 09:02 lorezzed

You could provide a shim for console.clear in the TryPureScript module, but it might not do what you think, since the console is cleared on each execution in Try PureScript anyway (if you use withConsole).

paf31 avatar Feb 12 '17 21:02 paf31

@paf31 That's true, however it might come in handy for situations like this:

module Main where

import Prelude
import TryPureScript
import Control.Monad.Eff.Console (log, clear)

main = do
  a <- withConsole do
    log "foo"
    clear
    log "bar"
  render a

I would expect the above to render only bar, and not foo

I don't know why anybody would use that behavior, but it makes sense for completeness.

If we're going for completeness, we should probably also support warn, info, debug, etc.

Pauan avatar Feb 13 '17 09:02 Pauan