With the following code:
runGeneration :
([BasePair] -> Float)
-> ([EntityFitness] ->{Random} [EntityFitness])
-> [EntityFitness]
->{Random, Remote} [EntityFitness]
runGeneration = iterateGenDefault 0.8 0.5
bar = Remote.pure.run 'runGeneration
UCM shows these signatures:
⍟ These new definitions are ok to `add`:
bar : Either
Failure
(([BasePair] -> Float)
-> ([EntityFitness] ->{Random} [EntityFitness])
-> [EntityFitness]
->{g, Remote, Random} [EntityFitness])
⍟ These names already exist. You can `update` them to your new definition:
runGeneration : ([BasePair] -> Float)
-> ([EntityFitness] ->{Random} [EntityFitness])
-> [EntityFitness]
->{Remote, Random} [EntityFitness]
The part I'm not understanding is the signature of bar, which still has Remote in its signature. Shouldn't this be absolved by invoking the handler Remote.pure.run?
I have a feeling this is related to my doing something silly, like putting an ability requirement in the wrong place of a signature.
For a simpler example using Random, the Random requirement is absolved:
randFooH : Nat ->{Random} Nat
randFooH max = Random.natIn 1 max
randFoo max = Random.splitmix 1234 '(randFooH max)
⍟ These new definitions are ok to `add`:
randFoo : Nat -> Nat
randFooH : Nat ->{Random} Nat
OK, so checking to see if the issue is just with Remote, it appears that this is not the case, as this (self-contained) example also absolves:
forkHelloH: '{Remote} Nat
forkHelloH = 'let
use Nat +
use Remote await forkAt here!
t1 = forkAt here! '(1 + 1)
t2 = forkAt here! '(2 + 2)
await t1 + await t2
forkHello = Remote.pure.run forkHelloH
⍟ These new definitions are ok to `add`:
forkHello : Either Failure Nat
forkHelloH : '{Remote} Nat
Update and clarification
I was originally trying this partial application of abilities in order to debug an issue - the better way to go about this is (usually) to apply the ability handlers as late as possible. My issue was related to having implemented some functions that weren't ability-polymorphic (see comments in answers below).