You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following code, the user-provided function can be captured as == by using parentheses (==):
ensureEqBy : (a -> a -> Boolean) -> a -> a -> ()
ensureEqBy (==) a1 a2 = if a1 == a2 then () else bug ("not equal", a1, a2)
ability EnsureEq where
ensureEqBy2 : (a -> a -> Boolean) -> a -> a -> ()
Loading changes detected in scratch.u.
I found and typechecked these definitions in scratch.u. If you
do an `add` or `update`, here's how your codebase would
change:
⍟ These new definitions are ok to `add`:
ability EnsureEq
ensureEqBy : (a ->{g1} a ->{g} Boolean)
-> a
-> a
->{g1, g} ()
However, the same does not work in an ability constructor match:
EnsureEq.run : '{g, EnsureEq} r -> {g} r
EnsureEq.run =
go thunk = handle !thunk with cases
{ r } -> r
{ ensureEqBy2 (==) a1 a2 -> k } ->
if a1 == a2 then () else bug ("not equal", a1, a2)
go k
go
🛑
The transcript failed due to an error in the stanza above. The error is:
I got confused here:
5 | { ensureEqBy2 (==) a1 a2 -> k } ->
I was surprised to find a ( here.
I was expecting one of these instead:
* @
Environment (please complete the following information):
Describe and demonstrate the bug
In the following code, the user-provided function can be captured as
==
by using parentheses(==)
:However, the same does not work in an ability constructor match:
🛑
The transcript failed due to an error in the stanza above. The error is:
Environment (please complete the following information):
ucm --version
bc7e65d built on 04/22/2025The text was updated successfully, but these errors were encountered: