<div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif;font-size:small">I hope the wizards will forgive a down-to-earth analogy.<br><br>Either a b is a knapsack with two pockets, the one on the Left (which must hold an "a") and the one on the Right (which must hold a "b"). But you can only use one pocket at a time.</div><div class="gmail_default" style="font-family:georgia,serif;font-size:small"><br></div><div class="gmail_default" style="font-family:georgia,serif;font-size:small">So when there's a specific case of Either a b such as Left True, all that can be concluded is that this is a case of an Either whose left pocket must be able to handle a Bool; there's not enough information to know what could have been put in the Right pocket. So only the left-pocket type ("a") can be replaced with something specific. </div><div class="gmail_default" style="font-family:georgia,serif;font-size:small"><br></div><div class="gmail_default" style="font-family:georgia,serif;font-size:small">Similarly, for a specific case of Right False, it's clear that the right pocket holds a value of type Bool (replacing the general "b"), but there's no information to identify what type might be in the left pocket. So it remains unspecified.</div><div class="gmail_default" style="font-family:georgia,serif;font-size:small"><br></div><div class="gmail_default" style="font-family:georgia,serif;font-size:small">I hope that helps.</div><div class="gmail_default" style="font-family:georgia,serif;font-size:small">-jn-</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Sep 18, 2021 at 9:21 PM Galaxy Being <<a href="mailto:borgauf@gmail.com">borgauf@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Either returns with its parameters, reversed, but Maybe did not. That's my main question.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Sep 18, 2021 at 5:43 PM Francesco Ariis <<a href="mailto:fa-ml@ariis.it" target="_blank">fa-ml@ariis.it</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Il 18 settembre 2021 alle 17:30 Galaxy Being ha scritto:<br>
> > :t Just True<br>
> Just True :: Maybe Bool<br>
> > :t Left True<br>
> Left True :: Either Bool b<br>
> > :t Right False<br>
> Right False :: Either a Bool<br>
> <br>
> What am I being told here? It seems<br>
> are both straightforward parameterized types, but Maybe doesn't give me a<br>
> type parameter back, while Either does, and in different order, different<br>
> names (a becomes b; b becomes a) depending on which variable I invoke. What<br>
> deeper lore am I not seeing here?<br>
<br>
When you ask the type of<br>
<br>
λ> :t Just True<br>
<br>
the interpreter *knows* that that `Maybe` is not just a `Maybe a` (so<br>
type constructor and its type parameter) but the /concrete/ type `Maybe<br>
Bool`. This would not be the case if we did<br>
<br>
λ> :t Nothing<br>
Nothing :: Maybe a<br>
<br>
Same story with `Either`. Each of the two data constructors (`Left` and<br>
`Right`) let the interpreter infer just *one* of the type parameters<br>
(the `a` and `b` in `Either a b`).<br>
Does this answer your question?<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div>⨽<br></div>Lawrence Bottorff<div>Grand Marais, MN, USA</div><div><a href="mailto:borgauf@gmail.com" target="_blank">borgauf@gmail.com</a></div></div></div>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners</a><br>
</blockquote></div>