Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Analysis] Trav ought to be a monad transformer #53

Open
lambdageek opened this issue May 22, 2018 · 2 comments
Open

[Analysis] Trav ought to be a monad transformer #53

lambdageek opened this issue May 22, 2018 · 2 comments

Comments

@lambdageek
Copy link

Here's a wishlist item I've been thinking about: I wish Trav was a monad transformer built up out of smaller simpler monad transformers.

Trav s a is meant to be extensible via the userState component s and the handleDecl function from MonadTrav, but this isn't always enough.

For example if I want to handle some events by running some kind of imperative operation (e.g. some kind of Union-Find algorithm or maybe feeding facts to an external solver like Z3) that's not easy to do right now.

Instead of baking in user state into the monad, Trav should be a monad transformer: TravT m a and Trav s a = TravT (State s) a (I'm not sure how user state interacts with Trav's exception mechanism).

In fact, ideally the MonadSymtab and MonadName, and MonadCError parts of Trav should all be broken out into separate transformers that layer on the functionality one by one (so that if I want to have some kind of extended symbol information, for example, I could add my own MonadSymtab instance in a custom stack). The default TravT should be a newtype around a particular instantiation of a stack of simpler transformers..

@aweinstock314
Copy link

I ended up needing a MonadIO instance, so I wrote #59.

@expipiplus1
Copy link
Collaborator

Fixed partially in #77

The user state is broken out into a MonadState instance, but not the other features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants