Couldn't match type ‘Control.Lens.Internal.Zoom.Zoomed
(Proxy X () () App2.LogEntry (App.AppIO StateAB))’
with ‘Control.Lens.Internal.Zoom.Zoomed
(Proxy X () () App2.LogEntry (App.AppIO StateA))’
NB: ‘Control.Lens.Internal.Zoom.Zoomed’ is a type function, and may not be injective
and I find this confusing but largely because I don't quite understand how it all works. I sort of see how zoom works and could maybe even write it in the case of any particular stack. But it's not working here and I don't understand why well enough to figure out how to fix it.
Help?
And a more general question if I haven't worn out your patience already.
In my simulation I have the computation to move a single run forward one unit in time. This modifies StateA. Then I want to move it many steps forward and use StateB (also within StateAB) to collect statistics about this. Then, eventually, I will want to run it many times with different initial conditions (or whatever) and collect those statistics so eventually there will be StateABC.
That's okay if I can get all the zoom (and magnify) working. Though the ways that is tricky sometimes make me just want to promote all computations to run in App2 StateABC, which seems like bad form since it's good if the signature makes clear what can and cannot be modified.
But what if a computation needs to see StateB but not modify it while being able to modify StateA?
So in general, I'd like to be able to mix and match which things are passed as part of the Reader and which as State and have that vary from monadic function call to monadic function call. So many would need to be lifted (transformed?) into the larger monadic context when called. I can almost see how to do it for my plain SR stack, by writing my own lifts using get and ask and then runReaderT and runStateT. But it will fall apart once the Producer is in there. Also there must be a better way.
And also, am I going about this all wrong?
Any thoughts would be most appreciated!
As a C++ and perl programmer but once, long ago, a theoretical physicist, I am loving Haskell and all the smart people who comment on all these threads. I'd be nowhere near as far along as I am without the combined expertise I find daily. So thanks everybody!
Adam
And a more general question if I haven't worn out your patience already.
In my simulation I have the computation to move a single run forward one unit in time. This modifies StateA. Then I want to move it many steps forward and use StateB (also within StateAB) to collect statistics about this. Then, eventually, I will want to run it many times with different initial conditions (or whatever) and collect those statistics so eventually there will be StateABC.
That's okay if I can get all the zoom (and magnify) working. Though the ways that is tricky sometimes make me just want to promote all computations to run in App2 StateABC, which seems like bad form since it's good if the signature makes clear what can and cannot be modified.
But what if a computation needs to see StateB but not modify it while being able to modify StateA?
So in general, I'd like to be able to mix and match which things are passed as part of the Reader and which as State and have that vary from monadic function call to monadic function call. So many would need to be lifted (transformed?) into the larger monadic context when called. I can almost see how to do it for my plain SR stack, by writing my own lifts using get and ask and then runReaderT and runStateT. But it will fall apart once the Producer is in there. Also there must be a better way.
And also, am I going about this all wrong?
Any thoughts would be most appreciated!
As a C++ and perl programmer but once, long ago, a theoretical physicist, I am loving Haskell and all the smart people who comment on all these threads. I'd be nowhere near as far along as I am without the combined expertise I find daily. So thanks everybody!
Adam
--
You received this message because you are subscribed to the Google Groups "Haskell Pipes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to haskell-pipe...@googlegroups.com.
To post to this group, send email to haskel...@googlegroups.com.