-
Notifications
You must be signed in to change notification settings - Fork 64
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
Provide a pattern version of uncons
in classy-prelude
#241
Comments
I see many instances of However, I do not see any patterns already defined in mono-traversable. @gregwebs do you have any thoughts on adding pattern exports ghc has had them since 7.8.1 so it seems like a well established feature that does not need CPP for version checking. @vigress8 can you comment on how to have completeness for the pattern? It seems like this will generate many warnings for incomplete patterns. |
hmm, why would this package be the one that defines patterns to export? It doesn't seem related to mono-traversable. I think that a custom prelude package would define this. |
Sorry I wasn't specific, by "this package" I meant |
uncons
?uncons
in classy-prelude
It's related because the pattern is meant to be generic over |
sure, makes sense for classy-prelude. |
To me the simplest way to achieve completeness seems to be pattern Empty <- (uncons -> Nothing)
{-# complete Empty, (:::) #-} |
Is the name clash acceptable https://hoogle.haskell.org/?hoogle=%3A%3A%3A |
Probably better to just use a name and not have a symbol? At least to start? |
The specific symbol isn't critically important to me, I just chose it for example's sake |
I'm thinking of something like:
I find myself wanting sequence-polymorphic pattern matching often, personally. It's trivial to define manually but having it in
classy-prelude
would make things simpler. Curious what anyone else thinksThe text was updated successfully, but these errors were encountered: