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

Follow stan hint, explicit fixity (default is infixl 9). #619

Merged

Conversation

philderbeast
Copy link
Contributor

See #610. I'm putting this up here as-is so please label with WIP. I'd like some feedback on which fixities to go with. Are there some that shouldn't be associative? Could some of these be replaced with existing operators we pull in from elsewhere?

https://kowainik.github.io/posts/fixity#standard-examples

For now I've just been explicit but with the default infixl 9.

(=>>) :: Monad m => m b -> (b -> m a) -> m b
(=>>) m f = m >>= (\x -> f x >> return x)

infixl 9 <<=
(<<=) :: Monad m => (b -> m a) -> m b -> m b
(<<=) = flip (=>>)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would think these should be removed from here. And replaced in the code with >>= and =<<.

Copy link
Contributor Author

@philderbeast philderbeast Aug 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like (=>>) :: Monad m => m b -> (b -> m a) -> m b and (<<=) are not used.

Copy link
Contributor Author

@philderbeast philderbeast Aug 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had a quick peek at liquidhaskell. Each operator is only used once there, (=>>) in Language.Haskell.Liquid.Constraint.Fresh and (<<=) in Language.Haskell.Liquid.Constraint.Generate. Perhaps those modules should define such an operator privately or use the inline equivalent and we remove them from liquid-fixpoint?

Copy link
Collaborator

@facundominguez facundominguez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@facundominguez facundominguez merged commit 20ce180 into ucsd-progsys:develop Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants