<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body dir="auto">
<div><span></span></div>
<div>
<div>So this works, what i find surprising is that type families do this at all...in my head "type" means some sort of synonym, so to allow unmapped synonyms and not flag them as an error seems very odd.</div>
<div><br>
</div>
<div>With datakind its doubly troubling as the unmatched family expression is of the same kind as the intended types in the domain of the "function"...so its unmatched and ive extended what seemed to be a closed expression defining some types of kind N.</div>
<div><br>
Excuse the spelling, sent from a phone with itty bitty keys, it like trying to sow a button on a shirt with a sausage.
<div><br>
</div>
</div>
<div><br>
On 21 Jun 2015, at 13:07, Nicholls, Mark <<a href="mailto:nicholls.mark@vimn.com">nicholls.mark@vimn.com</a>> wrote:<br>
<br>
</div>
<blockquote type="cite">
<div><style id="owaParaStyle">P {
        MARGIN-BOTTOM: 0px; MARGIN-TOP: 0px
}
</style>
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">
<p>ugly...but effective.</p>
<p> </p>
<p>thanks</p>
<p> </p>
<p> </p>
<div style="FONT-SIZE: 16px; FONT-FAMILY: Times New Roman; COLOR: #000000">
<hr tabindex="-1">
<div id="divRpF33800" style="DIRECTION: ltr"><font color="#000000" size="2" face="Tahoma"><b>From:</b> adam vogt [<a href="mailto:vogt.adam@gmail.com">vogt.adam@gmail.com</a>]<br>
<b>Sent:</b> 20 June 2015 16:34<br>
<b>To:</b> Richard Eisenberg<br>
<b>Cc:</b> haskell-cafe; Nicholls, Mark<br>
<b>Subject:</b> Re: [Haskell-cafe] Mild confusion around type family<br>
</font><br>
</div>
<div></div>
<div>
<p dir="ltr"><br>
On Jun 19, 2015 2:29 PM, "Richard Eisenberg" <<a href="mailto:eir@cis.upenn.edu" target="_blank">eir@cis.upenn.edu</a>> wrote:<br>
> With a closed family, you could always do something like this:<br>
><br>
> > type family Error (msg :: Symbol)     -- no instances!<br>
> > type family Sub a b where<br>
> >   -- real work<br>
> >   Sub a b = Error "Sub is undefined here"<br>
><br>
> Would that help? It still doesn't immediately error (there's no way to do that currently), but it's perhaps more telling to have an error string.</p>
<p dir="ltr">Ghc does error out right away if you give it an infinite loop:</p>
<p dir="ltr">type family Fail (x::k) (a :: *) where<br>
  Fail x a = Fail x (Fail "don't raise the context stack please" a)</p>
<p dir="ltr">-- defining f leads to compile failure, and the message includes the "msg"<br>
f :: Fail "msg" ()<br>
f = undefined</p>
<p dir="ltr">But it would be nice to have a less hacky solution, especially as this one gives error messages that suggest giving the type checker more resources.</p>
<p dir="ltr">Regards,<br>
Adam<br>
</p>
</div>
</div>
</div>
<p></p>
<p><br>
<br>
CONFIDENTIALITY NOTICE<br>
<br>
This e-mail (and any attached files) is confidential and protected by copyright (and other intellectual property rights). If you are not the intended recipient please e-mail the sender and then delete the email and any attached files immediately. Any further
 use or dissemination is prohibited.<br>
<br>
While MTV Networks Europe has taken steps to ensure that this email and any attachments are virus free, it is your responsibility to ensure that this message and any attachments are virus free and do not affect your systems / data.<br>
<br>
Communicating by email is not 100% secure and carries risks such as delay, data corruption, non-delivery, wrongful interception and unauthorised amendment. If you communicate with us by e-mail, you acknowledge and assume these risks, and you agree to take appropriate
 measures to minimise these risks when e-mailing us.<br>
<br>
MTV Networks International, MTV Networks UK & Ireland, Greenhouse, Nickelodeon Viacom Consumer Products, VBSi, Viacom Brand Solutions International, Be Viacom, Viacom International Media Networks and VIMN and Comedy Central are all trading names of MTV Networks
 Europe.  MTV Networks Europe is a partnership between MTV Networks Europe Inc. and Viacom Networks Europe Inc.  Address for service in Great Britain is 17-29 Hawley Crescent, London, NW1 8TT.<br>
</p>
</div>
</blockquote>
<blockquote type="cite">
<div><span>_______________________________________________</span><br>
<span>Haskell-Cafe mailing list</span><br>
<span><a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a></span><br>
<span><a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a></span><br>
</div>
</blockquote>
</div>
<P></P>
<P><br><br>CONFIDENTIALITY NOTICE<br><br>This e-mail (and any attached files) is confidential and protected by copyright (and other intellectual property rights). If you are not the intended recipient please e-mail the sender and then delete the email and any attached files immediately. Any further use or dissemination is prohibited.<br><br>While MTV Networks Europe has taken steps to ensure that this email and any attachments are virus free, it is your responsibility to ensure that this message and any attachments are virus free and do not affect your systems / data.<br><br>Communicating by email is not 100% secure and carries risks such as delay, data corruption, non-delivery, wrongful interception and unauthorised amendment. If you communicate with us by e-mail, you acknowledge and assume these risks, and you agree to take appropriate measures to minimise these risks when e-mailing us.<br><br>MTV Networks International, MTV Networks UK & Ireland, Greenhouse, Nickelodeon Viacom Consumer Products, VBSi, Viacom Brand Solutions International, Be Viacom, Viacom International Media Networks and VIMN and Comedy Central are all trading names of MTV Networks Europe.  MTV Networks Europe is a partnership between MTV Networks Europe Inc. and Viacom Networks Europe Inc.  Address for service in Great Britain is 17-29 Hawley Crescent, London, NW1 8TT.<br></P></body>
</html>