<div dir="ltr">Hi,<div><br></div><div>Anyone used some of the extensible record packages to create a kind of extensible state monad?</div><div><br></div><div>I mean something that besides having "get", "gets" and "put"  would have some kind of "add" and "gets":</div><div><br></div><div>add :: a -> State ()</div><div>gets  :: State (Maybe a)</div><div><br></div><div>or </div><div><br></div><div>add :: LabelName -> a -> State ()</div><div>gets :: LabelName -> State (Maybe a)</div><div><br></div><div><br></div><div><div>So that I can extend the state without using additional monad transformers. Monad transformers are very hard for beginners and scramble error messages</div><div><br></div><div>I did the first option for MFlow, hplayground and Transient packages (setSData and getSData). But my solution uses a map indexed by type and this requires a lookup for each access.</div><div><br></div><div>I would like to know if there is an alternative with no lookups. I´m not obsessed with speed but In some applications the speed may be important....</div><div><br></div><div>Anyone?</div>-- <br><div class="gmail_signature">Alberto.</div>
</div></div>