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
constcomp1=compose(sequence(Compose.of),map(Compose.of));constcomp2=(Fof,Gof)=>compose(Compose.of,map(sequence(Gof)),sequence(Fof));// Test it out with some types we have lying aroundcomp1(Identity(Right([true])));// Compose(Right([Identity(true)]))comp2(Either.of,Array)(Identity(Right([true])));// Compose(Right([Identity(true)]))
issue
I disagree with the result of comp1(Identity(Right([true]))) will be Compose(Right([Identity(true)])). As it's mentioned in the Identity law:
constidentity1=compose(sequence(Identity.of),map(Identity.of));constidentity2=Identity.of;// test it out with Rightidentity1(Either.of('stuff'));// Identity(Right('stuff'))identity2(Either.of('stuff'));// Identity(Right('stuff'))
identity1 is equivalent to identity2. And I think comp1 is isomorphic to identity1, which means comp1 is equivalent to Compose.of. So the result of comp1(Identity(Right([true]))) should be Compose(Identity(Right([true]))).
maybe a solution
I'm not sure whether sequence will exchange the containers that are not adjacent, like this:
sequence(A.of,C(B(A(x))));// A(B(C(x)))
If the law is right, I think the proper comp1 should equal compose(sequence(Compose.of), map(map(map(Compose.of))))
The text was updated successfully, but these errors were encountered:
dzylikecode
changed the title
ch12: type signature is not proper
ch12: The result of comp1 is not proper
Nov 3, 2022
original content
issue
I disagree with the result of
comp1(Identity(Right([true])))
will beCompose(Right([Identity(true)]))
. As it's mentioned in theIdentity
law:identity1
is equivalent toidentity2
. And I thinkcomp1
is isomorphic toidentity1
, which meanscomp1
is equivalent toCompose.of
. So the result ofcomp1(Identity(Right([true])))
should beCompose(Identity(Right([true])))
.maybe a solution
I'm not sure whether
sequence
will exchange the containers that are not adjacent, like this:If the law is right, I think the proper
comp1
should equalcompose(sequence(Compose.of), map(map(map(Compose.of))))
The text was updated successfully, but these errors were encountered: