question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Test for monoid empty values in `isEmpty`

See original GitHub issue

Currently 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
dalefrancis88commented, Feb 14, 2019

@jasminabasurita This is now merged into master and will be available in the next release 😃

1reaction
dalefrancis88commented, Dec 12, 2018

I am not sure we should consider zero an empty value if we start to do that, we’re a step away from considering Nothing an empty value. I think zero itself holds an intrinsic value above that of something that is empty

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found