I don’t have a particular use case for it now, but I mistakenly thought I did a moment ago. Anywho, I’m curious - is there a way to write some function that allows for something like
curryCircuit2 ::
forall a b c.
Fwd a ->
Circuit (a, b) c ->
Circuit b c -- I don't think this is the right return type
curryCircuit2 fwdA circuit = ???
where
circuitFn :: ((Fwd a, Fwd b), Bwd c) -> ((Bwd a, Bwd b), Fwd c)
Circuit circuitFn = circuit
circuitFnC :: Fwd a -> Fwd b -> Bwd c -> ???
circuitFnC fwdA fwdB bwdC = ???
I’m not sure how to write this in a way such that the backwards channel of a
isn’t dropped.
Furthermore, I’m not even sure if this is possible. The thought occurred to me since for some of the things I’ve been working on I’ve been treating Circuit a b
as approximately analagous to a -> b
, thus Circuit (a, b) c
would be similar to (a, b) -> c
. I thought it would be nice to have something like curry
for such a situation.