Test for monoid empty values in `isEmpty`
See original GitHub issueCurrently passing an empty from any monoid to isEmpty
returns false. I think it would make sense if isEmpty
included tests for empty monoids
Example:
//current
isEmpty(Min.empty()) // => false
//desired
isEmpty(Min.empty()) // => true
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Monoid mempty in pattern matching - haskell - Stack Overflow
Your first approach fails because you can't pattern match on arbitrary values, only constructors. You're binding the argument to a variable ...
Read more >isEmpty with undefined · Issue #2507 · ramda/ramda - GitHub
Given a value of some monoidal type m , R.isEmpty returns true if and only if that value is the empty value of...
Read more >Presence. [value.isEmpty ? nil : value] - Swift Forums
There is no any direct reason to pass empty collection, instead we need to render only if value exist what means we put...
Read more >Proposal: add isEmpty to Monoid - Haskell Mailing List
I propose add this test `isEmpty :: a -> Bool` to `Monoid`, to provide the > ability to check if a value is...
Read more >What is a Monoid? | Toby Hobson
Monoids allow us to combine things that could be empty e.g. two Lists or Options by providing a default value.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jasminabasurita This is now merged into master and will be available in the next release 😃
I am not sure we should consider
zero
anempty
value if we start to do that, we’re a step away from consideringNothing
anempty
value. I thinkzero
itself holds an intrinsic value above that of something that isempty