unison/unison-src/transcripts-using-base/fix2297.output.md
Greg Pfeil 0031542faf
Add a space before code block info strings
This is for consistency with the `cmark` style. Now the blocks we still
pretty-print ourselves will match the bulk of them that `cmark`
produces.
2024-07-10 13:56:07 -06:00

882 B

This tests a case where a function was somehow discarding abilities.

structural ability Trivial where
  trivial : ()

-- This handler SHOULD leave any additional effects alone and unhandled
handleTrivial : '{e, Trivial} a -> {e} a
handleTrivial action =
  h : Request {Trivial} a -> a
  h = cases
    {trivial -> resume} -> handle !resume with h
    {a} -> a
  handle !action with h

testAction : '{Exception, IO, Trivial} ()
testAction = do
  printLine "hi!"
  trivial

wat : ()
wat =  handleTrivial testAction -- Somehow this completely forgets about Exception and IO

> handleTrivial testAction

  Loading changes detected in scratch.u.

  The expression in red needs the {IO} ability, but this location does not have access to any abilities.
  
     19 | wat =  handleTrivial testAction -- Somehow this completely forgets about Exception and IO