<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.<br><br>On Monday, March 7, 2016 at 10:10:48 PM UTC-8, Tomas Tauber wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">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" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fokmij.org%2Fftp%2FHaskell%2FHList-ext.pdf\46sa\75D\46sntz\0751\46usg\75AFQjCNEizPqaB0R44Yo1kiCWowNay00knQ';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fokmij.org%2Fftp%2FHaskell%2FHList-ext.pdf\46sa\75D\46sntz\0751\46usg\75AFQjCNEizPqaB0R44Yo1kiCWowNay00knQ';return true;">http://okmij.org/ftp/Haskell/<wbr>HList-ext.pdf</a>
<br>[2] <a href="https://docs.oracle.com/javase/8/docs/api/java/util/RandomAccess.html" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\75https%3A%2F%2Fdocs.oracle.com%2Fjavase%2F8%2Fdocs%2Fapi%2Fjava%2Futil%2FRandomAccess.html\46sa\75D\46sntz\0751\46usg\75AFQjCNFjeVwOci5mqkLNmTKORq9S59-ceA';return true;" onclick="this.href='https://www.google.com/url?q\75https%3A%2F%2Fdocs.oracle.com%2Fjavase%2F8%2Fdocs%2Fapi%2Fjava%2Futil%2FRandomAccess.html\46sa\75D\46sntz\0751\46usg\75AFQjCNFjeVwOci5mqkLNmTKORq9S59-ceA';return true;">https://docs.oracle.com/<wbr>javase/8/docs/api/java/util/<wbr>RandomAccess.html</a>
<br>______________________________<wbr>_________________
<br>Haskell-Cafe mailing list
<br><a href="javascript:" target="_blank" gdf-obfuscated-mailto="J5D35YsnGwAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">Haskel...@haskell.org</a>
<br><a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fmail.haskell.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fhaskell-cafe\46sa\75D\46sntz\0751\46usg\75AFQjCNH7sFgl7KfuDcDlaGGG3ip3kRaoIA';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fmail.haskell.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fhaskell-cafe\46sa\75D\46sntz\0751\46usg\75AFQjCNH7sFgl7KfuDcDlaGGG3ip3kRaoIA';return true;">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/haskell-<wbr>cafe</a>
<br></blockquote></div>