<div dir="ltr">I had not!<br><br>I'm not seeing how such a solution would work. The nodes in a graph all have to have the same type. If the phantom parameter distinguished two nodes, they could not be used together.<div><br></div><div>But maybe you see something there that I don't?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 18, 2016 at 8:36 PM, Francesco Ariis <span dir="ltr"><<a href="mailto:fa-ml@ariis.it" target="_blank">fa-ml@ariis.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Thu, Feb 18, 2016 at 06:50:26PM -0800, Jeffrey Brown wrote:<br>
> Suppose then you wanted to write a function that, given a person, returns<br>
> the names of all their hamsters. To make sure the call makes sense, the<br>
> function would have to first check that the input is in fact a person.<br>
> Since persons and hamsters are both constructors of the same type, you<br>
> can't let Haskell's robust, beautiful type-checking system distinguish them<br>
> for you; you've got to write something like "case n of Person _ -> True; _<br>
> -> False".<br>
><br>
> Is there some way around writing such manual checks?<br>
<br>
</span>Hello Jeffrey,<br>
    have you considered using Phantom types [1]?<br>
<br>
[1] <a href="https://wiki.haskell.org/Phantom_type#Simple_examples" rel="noreferrer" target="_blank">https://wiki.haskell.org/Phantom_type#Simple_examples</a><br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Jeffrey Benjamin Brown</div></div>
</div>