In the previous blog post about Eq we were dealing with the concept of equality. In this blog post we are going to deal with the concept of order.
...
For further actions, you may consider blocking this person and/or reporting abuse
That's the plan, yes
Is there a way to combine Ords that compare individual properties of an object, for example:
so that ordWeightLabel would order first by weight, and then by label where weights are equal?
Yes,
Ord
s form a SemigroupHi, your library and articles finally made me love typescript. Thanks a lot. I have a question : would an Ord that always returns 0 be enough to transform the semigroup from get Semigroup in a monoid ?
Oh, excellent, thank you very much. I suspected it had something to do with Semigroups, but hadn't managed to make that leap in understanding them yet.
Really looking forward to see more articles from this series.
Had my eye on fp-ts for a while but it'd always seemed to me your target audience were more of advanced Haskell/Purescript users.
Great article. Just a minor typo I think:
Didn't you mean
==
instead of<=
? Otherwise thefromCompare
method would not work correctly.It's not a typo, please note that Reflexivity + Antisymmetry imply
compare(x, x) === 0, for all x in A
. However I'll restate the Reflexivity property to make it clearer, thanks for pointing outIt mentions a
Setoid
which I believe was renamed toEq
.