Repository navigation
Add is - #410
Add is#410
Conversation
|
Also I'd rather do nothing, i.e. don't add this combinator. |
I provided the link to lens for informational purposes, not for justification! The justification was that it was sufficiently confusing to me that
|
|
I didn't mean that we shouldn't have And the confusion I was referring to was not with |
|
@adamgundry, @arybczak what you think about this? |
|
OK, thanks for clarifying. Avoiding export from top level make perfect sense to me. What would be the right way to acheve that? |
|
I'd like I recently wanted to use it (with a prism), but had to settle for |
|
I agree that we shouldn't export Perhaps we should have a module for "things that aren't exported because of name collisions" and then it could also contain Although given that |
Testing for a particular type constructor reads nicer as |
|
OK, how about this? I chose Regarding |
|
(I'm not sure why the doctest is failing. I can't reproduce locally due to #413). |
Because the file is missing at the end. |
| -- The negation of this operator is 'Optics.Core.Extra.is' from | ||
| -- "Optics.Core.Extra". | ||
| isn't :: Is k An_AffineFold => Optic' k is s a -> s -> Bool | ||
| isn't k s = not (isJust (preview k s)) |
There was a problem hiding this comment.
This should be isNothing. Can you please change that?
| ) | ||
| where | ||
|
|
||
| import Optics.Internal.Optic |
There was a problem hiding this comment.
Only Optics.Optic is needed, no Internal stuff is used here.
| -- False | ||
| -- | ||
| is :: Is k An_AffineFold => Optic' k is s a -> s -> Bool | ||
| is k = not . isn't k |
There was a problem hiding this comment.
Can you inline the definition of isn't here so that the compiler has less things to do?
5313974 to
9ed5482
Compare
|
Thanks, looks good to merge to me ð Unless @adamgundry @phadej would like the module to have a different name. |
|
Thanks for taking care of this @tomjaguarpaw! I'm somewhat torn on the module name question, because |
|
OK, I've changed the module name to |
|
Thanks :) I'll merge after the weekend unless anyone objects. |
(the opposite of isn't)
I found it rather strange that
isn'texists butisdoesn't.lenshasis. Could we add it tooptics?