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.

"equivalent" concept

See original GitHub issue

Hi!

I would like to comment that I feel very atracted by this project. I read this project several times to little by little understand better the concepts that are written. However the concept of equivalence is confusing for me. The definition is defined by example and, then, is used on definitions of algebras. For example:

### Functor

1. `u.map(a => a)` is equivalent to `u` (identity)
2. `u.map(x => f(g(x)))` is equivalent to `u.map(g).map(f)` (composition)

But maybe, the type that implements Functor is not any of this type examples. Then, is it not better define equivalence in terms of Setoid that defines equals method?

I mean:

### Functor

Functor implements the Setoid specification

1. `u.map(a => a).equals(u)` (identity)
2. `u.map(x => f(g(x))).equals(u.map(g).map(f))` (composition)

Cheers!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:22 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
bumbleblymcommented, Jul 16, 2017

You can create a legal setoid that has different behavior for ‘equal’ values.

Even(2).equals(Even(4)) // true
Even(2).reduce((acc, x) => acc + x, 0) // 2
Even(4).reduce((acc, x) => acc + x, 0) // 4
2reactions
xavierviacommented, Jul 14, 2017

I think this might relate to the problem of what equality is in general terms. “Equivalent” as used in the laws seems to me to be referring that the fact that the laws expect the equivalence to be “up to isomorphism”.

Defining an equality that works for laws (that is, not just for hard comparisons within the JavaScript language, but in general for the underlying mathematical theory that underpins them) is a problem that is probably outside the scope of Fantasy Land. If I understand this correctly, the problem of equivalence and isomorphisms is what drives Homotopy Type Theory and the Univalent Foundations.

So to recap, I think the meaning of “equivalent” when used in the context of the laws is different than the meaning of the “equals” function regarding the Setoid algebra as implemented within Fantasy Land. “equals” is in this case narrowly defined for the context of JavaScript, which might not have the expressivity to describe the concept of “equivalence”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Equivalent (chemistry) - Wikipedia
An equivalent is the amount of a substance that reacts with (or is equivalent to) an arbitrary amount (typically one mole) of another...
Read more >
Equivalent Concept Revision Notes - IIT JEE/NEET Preparation
Concept of equivalents. Equivalent mass of element. Number of parts by mass of an element which reacts or displaces from a compound 1.008...
Read more >
6.3 The use of the equivalence concept - iupac
The concept of equivalence and the use of the term equivalent is well established in studies of ion-exchange phenomena and in electroanalytical chemistry...
Read more >
What is an equivalent? - Chemistry Stack Exchange
Equivalent concept is an archaic unit of measurement that was used in chemistry and the biological sciences in the era before researchers ...
Read more >
Equivalent concept - Byju's
Equivalent concept. Open in App. Solution. 99996161993-0-0. flag. Suggest Corrections. thumbs-up. 0. BNAT. mid-banner-image. similar_icon. Similar questions.
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