Code
is a funny type. It has definitions of bind
(EDIT: this is actually a slightly different function), and I’m pretty sure it could have a definition of <*>
(surely if we have code for a function and code for the argument, we can make code for the application of the two), but it doesn’t have an unrestricted pure
, you need a Lift
constraint for that.
Which also means you can’t make a derived Functor
instance, because you can’t lift
a function to then use <*>
.
So it’s annoyingly close to being able to actually use sequence
, and I suspect the functions like sequenceCode
that you would write will look rather like the generic ones, just with some extra explicit (or solved) Lift
constraints.
I wonder if there is a way to do things generically, then…