purescript-doctest
purescript-doctest copied to clipboard
example of do notation?
Hi again, I'm having issues with the way do
notation is compiled as tests, wondering if this is an issue or if there's something i could be doing differently
--| ```purescript run
--| > import Effect.Unsafe (unsafePerformEffect)
--| > import Effect.Console (log)
--| > unsafePerformEffect $ do
--| log "help!"
--| mempty
--| unit
--| ```
foo = "bar"
compiles to invalid test code:
main :: Spec Unit
main = describe "Test.DocTest.Effect.Worker" $ do
it "value spec in docs from: sendMsg" $ show (unsafePerformEffect $ do log "help!"
mempty) `shouldEqual` "unit"
pure unit
That's interesting: That's actually a bug in the purescript pretty printer: https://hackage.haskell.org/package/purescript-0.13.8/docs/src/Language.PureScript.Pretty.Values.html#prettyPrintValue
I'll try to get that fixed