DEV Community

Discussion on: Getting started with fp-ts: Eq

Collapse
 
muzietto profile image
Marco Faustinelli • Edited

Can you please show through some realistic FP example what you do with an Eq<Point>? Possibly showing what you do with it that you cannot do with a plain Point?

I understand that this equals method allows comparison of points, but I could implement it inside type Point and get on with it.

Why is it useful to have an Eq<Point>? Thank you for your attention....

Collapse
 
steida profile image
Daniel Steigerwald

Because you can compose equality checks. It means, minimal code without boilerplate with correctness via type checking. Here is a realistic example: twitter.com/estejs/status/11914907...