<div dir="ltr"><div><div><div><div><div>The constraints package currently uses<br><br></div>class Any => Bottom where<br></div> no :: Dict a<br><br></div>It should probably actually use<br><br></div>no :: a<br><br></div><div>but that's a minor point.<br></div><div><br></div><div>There are two ideas:<br><br></div><div>1. The class constraint Any is a stuck type family, so it's utterly impossible to create an instance of Bottom. Thus any entailment c :- Bottom implies that c is unsatisfiable.<br></div><div>2. There's an entailment<br><br></div><div>bottom :: Bottom :- c<br></div><div>bottom = Sub no<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 10, 2016 at 1:42 PM, Mitchell Rosen <span dir="ltr"><<a href="mailto:mitchellwrosen@gmail.com" target="_blank">mitchellwrosen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">One empty typeclass I use often not only has no methods, but also has no members.<br><br>class Void<br><br>This is useful in type families that return Constraint, when you want to say this constraint is "unsatisfiable". I suppose returning something like "True ~ False" would also suffice, but isn't as pretty.<span class=""><br><br>On Monday, March 7, 2016 at 10:10:48 PM UTC-8, Tomas Tauber wrote:</span><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Hi everyone,
<br>
<br>I have one question. What are current use cases of type classes with no methods?
<br>
<br>I saw early uses in type-level programming (e.g. HList [1]).
<br>In the OO world, interfaces with no methods are called marker interfaces -- their use cases range from things that could be done with datatype generic programming in Haskell (e.g. serialization) to metadata annotations (e.g. RandomAccess [2]).
<br>
<br>Regards,
<br>
<br>Tomas Tauber
<br>
<br>
<br>[1] <a href="http://okmij.org/ftp/Haskell/HList-ext.pdf" rel="nofollow" target="_blank">http://okmij.org/ftp/Haskell/HList-ext.pdf</a>
<br>[2] <a href="https://docs.oracle.com/javase/8/docs/api/java/util/RandomAccess.html" rel="nofollow" target="_blank">https://docs.oracle.com/javase/8/docs/api/java/util/RandomAccess.html</a>
<br>_______________________________________________
<br>Haskell-Cafe mailing list
<br></span><a rel="nofollow">Haskel...@haskell.org</a>
<br><a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="nofollow" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a>
<br></blockquote></div><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>
<br></blockquote></div><br></div>