-
Notifications
You must be signed in to change notification settings - Fork 68
Closed
Description
Why does log
return the string that was logged?
-- | Logs any string to the console. This basically saves you
-- | from writing `liftEff $ log x` everywhere.
log :: forall e. String -> Aff (console :: C.CONSOLE | e) String
log s = do
liftEff $ C.log s
return s
The log
function from Control.Monad.Eff.Console
that's being wrapped around returns Unit
.
-- | Write a message to the console.
foreign import log :: forall eff. String -> Eff (console :: CONSOLE | eff) Unit
All of the places I'm using log
, I don't want it to return a string. I realize I could write void $ log "error message"
, but I think most uses of log
won't need the string returned. I think the type should be changed to this:
log :: forall e. String -> Aff (console :: C.CONSOLE | e) Unit
Are other people using log
such that they want it to return the string that has been logged?
Metadata
Metadata
Assignees
Labels
No labels