Closed AriFordsham closed 1 year ago
Great! The hard part is how to compose them efficiently.
What obstacles are there to 'efficiently?'
I'm planning on implementing profunctor optics in a way that makes sense for Plutarch lenses.
pcon
/pmatch
into the body of combinators and lenses themselves.pcon
/pmatch
in a composition of optics, which the composition function needs to deal with? It doesn't seem obvious to me that there is.Are there any efficiency considerations I am missing?
Consider combining Lens' a b
and Lens' a c
into Lens' a (b, c)
. How do you this efficiently?
Relying on the backend to optimise it is not good design.
EPair
and EEither
PLens
and PPrism
PChoice
for PPrism
Core
We have optics!
Cont
monad - essentially replacing every a -> b
with a -> Cont r b
EPair
and EEither
. These essentially use Haskell Either
in Plutarch!Why change the warnings?
Make sure to use GHC 9.2.4. You can do nix develop
to get the correct GHC.
Happy to change that back. I use partial-type-signatures
warnings with HLS quite heavily in my workflow.
shell.nix
on master
has ghc923
, which is what I'm using.
e.g.?
Not having r
on the right of an arrow breaks a lot of inference and requires many type applications. In addition, something hard broke, I can't remember what. It seemed fixable, but not worth the trouble. I'm happy to try again if you think it's worth it.
In general, type applications are a code smell, along with AllowAmbiguousTypes IMO.
PConstrained
implemented
ptraverse
for types with one parameterplist
in terms of ptraverse
We won't really know if this works until we have a backend to test with.
Amazing! Perhaps we should work on getting a backend to work again.
Plutarch has changed too much for this to be mergible.
Initial draft implementation.