-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
Implement andM
, orM
, allM
, and anyM
in terms of &&^
and ||^
#193
Conversation
andM
et al. in terms of ifM
andM
et al. in terms of &&^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a nice code simplification and refactoring 👍 Thanks!
Now that these functions are written like this, I wonder if it's worth adding monadic versions of newtype AllM m = AllM (m Bool)
instance Monad m => Semigroup (AllM m) where
AllM x <> AllM y = AllM (x &&^ y)
instance Monad m => Monoid (AllM m) where
mempty = AllM (pure True) And then we could rewrite these all in terms of |
@josephcsible the behaviour of these functions indeed can be generalised using new
And I can add from myself that it's a bit unfortunate that |
Okay, I guess this can go in as-is then. By the way, what is the type |
@josephcsible Yeah, I mean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice refactoring!
andM
et al. in terms of &&^
andM
, orM
, allM
, and anyM
in terms of &&^
and ||^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
CI is failing due to |
It passes now. |
Checklist:
HLint
hlint.dhall
accordingly to my changes (add new rules for the new imports, remove old ones, when they are outdated, etc.)..hlint.yaml
file (see this instructions).General
stylish-haskell
file.[ci skip]
text to the docs-only related commit's name.