mirror of
https://github.com/unisonweb/unison.git
synced 2024-10-26 11:07:48 +03:00
13 lines
281 B
Plaintext
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
|
|
|
|
()
|