<div dir="ltr">Hi,<div><br></div><div>Simon Marlow's paper[1] introduces a type class named `Exception` which has no methods. </div><div><br></div><div>Here `Exception` is defined as a synonym for `Typeable` and `Show`:<div><br></div><div>class (Typeable a, Show a) => Exception a</div><div><br></div><div><br></div><div>[1] "An Extensible Dynamically-Typed Hierarchy of Exceptions</div><div><a href="http://community.haskell.org/~simonmar/papers/ext-exceptions.pdf">http://community.haskell.org/~simonmar/papers/ext-exceptions.pdf</a></div><div><br></div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 9, 2016 at 12:48 AM, Geraldus <span dir="ltr"><<a href="mailto:heraldhoi@gmail.com" target="_blank">heraldhoi@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">Thanks everybody. I found this helpful (:</div><br><div class="gmail_quote"><div dir="ltr">вт, 8 мар. 2016 г. в 19:58, Alex Rozenshteyn <<a href="mailto:rpglover64@gmail.com" target="_blank">rpglover64@gmail.com</a>>:<br></div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">You can use them to claim something about multiple type classes at once, with some advantages over using ConstraintKinds for the same purpose: <a href="https://www.reddit.com/r/haskell/comments/49em92/haskells_typeclasses_we_can_do_better/d0rwvi8?context=2" target="_blank">https://www.reddit.com/r/haskell/comments/49em92/haskells_typeclasses_we_can_do_better/d0rwvi8?context=2</a></div><div dir="ltr"><br><div><br><div class="gmail_quote"><div dir="ltr">On Tue, Mar 8, 2016 at 6:36 AM Adam Bergmark <<a href="mailto:adam@bergmark.nl" target="_blank">adam@bergmark.nl</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><img style="border:none;background:none" src="https://welovepg.polymail.io/v1/z/a/vEwcgmVrQc_UCiKZ/Q5_0DM6weqBBWR8xjy3foEGLOq4CY64-EwY-mb9uHDul8ikTxw9PGltjWoNOJfpQq32RBmj8ZbTSpq4WPl1LL0g9rMf9WNOYbuJHG_fK_TKTEh5iG7OzhzDl.png" alt="" border="0" width="0px" height="0px">I have two use cases for them<div><br></div><div><ul><li>In fay-jquery there’s an empty Selectable class that has instances for all elements that can be passed to the jQuery function, there is no need for methods since we in the background just pass the object along, but we want to make sure we don’t pass something nonsensical.</li><li>In a rest API serving JSON you need ToJSON and FromJSON instances for each type, but since internal APIs may also use JSON it’s possible that you by accident pass a type that isn’t versioned and supposed to be included in the public API. There I can have an empty PublicApiType class with instances for all public types to give a type error if I pass something internal by mistake.</li></ul></div><div><br><div><div>/Adam Bergmark</div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div dir="ltr">On Tue 08 Mar 2016 at 07:10 Tomas Tauber <u></u> <<a href="mailto:Tomas+Tauber+%3Ctomtau@connect.hku.hk%3E" target="_blank">Tomas Tauber <u></u></a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p>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">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" target="_blank">https://docs.oracle.com/javase/8/docs/api/java/util/RandomAccess.html</a>
<br>_______________________________________________
<br>Haskell-Cafe mailing list
<br><a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a>
<br><a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a>
<br></p></blockquote></div><br></div>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">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></div></div>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">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></div></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>