-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
include sanctuary-def comparison in readme #8
Comments
Gee! I didn't even know this repo. I know Sanctuary, of course. sanctuary-def seems indeed quite similar. How do you manage all these projects? That's incredible! I have to take a closer look at it. I am curious how you solved particular problems. I am pretty sure we can learn from each other. It seems as if Berlin is becoming a hot-spot for typed Javascript. Give me a little time to prepare some key points about the differences. Anyway, nice to hear form you. |
Likewise!
Let's exchange ideas. Since we're both in Berlin we could do so in person. Contact me via email if you'd like to get together. :) |
Here are far too many key points. This was a piece of work. I didn't intend to write down so many! I am biased of course - maybe you can check through them and complete things. I guess I store the comparison in a separate file and only link it in the TL;DR sanctuary-def is less strict than ftor but more mature. While sanctuary-def provides good interop (especially with Ramda), ftor is much more radical in its adaptation of Haskell idioms and sacrifices interop for the time being. Sanctuary has a strong focus on type classes and bounded polymorphism, whereas ftor focuses on parametric and row polymorphism along with Hindley-Milner like type unification. Status
Interop
Polymorphism
Unification e.g. is
Type Hints e.g.
Pluggable Runtime Type Checker
Time of Introspection
Currying
Verbose Error Messages
Named Intermediate Functions of Curried Function Sequences e.g. add(2).name // "add"
Partial Application
Type-Safe ADTs (Sums of Product) with check of case guarantee
Records, Tuples
Homogeneous Array, Map
Restricted Type Coercion whenever possible in quirky Javascript...
Immutability
Duck Typing In a typed environment you should know your types, so...
|
The functions returned by sanctuary-def have > S.add
add :: FiniteNumber -> FiniteNumber -> FiniteNumber The same applies to the result of partially applying one of these functions. For example: > S.add (2)
add(2) :: FiniteNumber -> FiniteNumber The functions are anonymous in both cases. |
@davidchambers I had a short discussion with Aadit, who has been working on a Hindley-Milner type checker for quite some time and according to him ftor is a type validator (as opposed to a tpye checker), because it assumes correct types for given implementations, instead of inferring them. I think this applies to Sanctuary as well. |
It's good to know the correct terminology. The term type checking may be used more broadly in the programming community than its formal definition permits. ;) |
At first glance this project seems to be quite similar to sanctuary-def. A summary of the differences between the two libraries would be useful. :)
The text was updated successfully, but these errors were encountered: