You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My initial intuition was that (as of ap = <*>) Alternative intance of Task|Future Monad should be something like this (from purescript-aff) and it should not be implemented using never and race. but today i came across briancavalier/creed#92 and there Alternative is implemented using never and or(aka race). After thinking for a while it looks lawful, only issue i see (which actually might not be an issue), is that with distributivity law x.ap(f.alt(g)) == x.ap(f).alt(x.ap(g))
in left branch, function from eitherf or g will be called
in right branch, function from bothf or g will be called
But as function in g should be pure it might not be an issue? If that's an issue, then Maybe also has this same issue (which I think is not present in Haskell because of laziness)
My initial intuition was that (as of
ap = <*>
) Alternative intance of Task|Future Monad should be something like this (from purescript-aff) and it should not be implemented using never and race. but today i came across briancavalier/creed#92 and there Alternative is implemented using never and or(aka race). After thinking for a while it looks lawful, only issue i see (which actually might not be an issue), is that with distributivity lawx.ap(f.alt(g)) == x.ap(f).alt(x.ap(g))
f
org
will be calledf
org
will be calledBut as function in
g
should be pure it might not be an issue? If that's an issue, thenMaybe
also has this same issue (which I think is not present in Haskell because of laziness)possibly related issues:
ap
from Applicative should be sequential? #179The text was updated successfully, but these errors were encountered: