unison/unison-src/errors/unsound-cont.u
2021-08-24 11:33:27 -07:00

13 lines
281 B
Plaintext

structural ability Ask a where
ask : {Ask a} a
supply : Text -> Request (Ask Text) a -> a
supply t = cases
{a} -> a
-- `k` should be of type `Text -> Request Ask a`,
-- so calling it with `()` here should be a type error
{Ask.ask -> k} -> handle k () with supply t
()