-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Clean up “Pure Error Handling” #371
Comments
Well, yes and no ^.^ We definitely need to rephrase a bit the paragraph below the definition of
Yet, everything here is more or less linked to an underlying type-system and each type that implement the One thing to also have in mind is that JavaScript isn't statically typed and for that reason, we have to keep this // liftA2 :: (a → b → c) → Either String a → Either String b → Either String c
liftA2 = (fn, a1, a2) => of(fn).ap(a1).ap(a2) The signature is a bit restrictive here as nothing in the implementation really leverages the fact that // liftA2 :: (Pointed f, Applicative f) ⇒ (a → b → c)→f a → f b → f c
liftA2 = (fn, a1, a2) => of(fn).ap(a1).ap(a2) Usually, the context will tell a compiler of interpreter what concrete type if As a matter of fact, it is simply wrong to define |
The section Pure Error Handling got more confusing during the recent update to ES6:
E.g. it says „ I've skipped the ceremony of creating the
Either
superclass“ while actually in the code that superclass is created.And before
Right
andLeft
were more similar, e.g. both had a functionof
. Now aLeft
is created through the little standalone functionleft
, while aRight
is created throughEither.of
. It would be better, to make RIght and Left more similar again, by again giving both a static methodof
.The text was updated successfully, but these errors were encountered: