<p>I suspect there are a lot of classes that are almost right - and they might even be better suited to a particular application than the more generic solutions.</p>
<p>The most striking for me is Monoid. 'inhabitant' looks like 'mempty', while 'mappend' would simply be (\_ _ -> inhabitant). What's more, almost all instances you mention are already instances of Monoid, so less work for you. Also note that there is no way to ensure that only "truly boring" classes will be made instances of your class, so maybe relying on Monoid is enough?</p>
<p>Another class that comes to mind is<br>
class Unit m where unit :: m ()<br>
which is one of the fundamental classes of the functor hierarchy. (Note that pure x == fmap (const x) unit). Granted, it's of a different kind, but...<br>
Just this weekend I have been working on a polykinded class:<br>
class Reducible target r where reduce :: Proxy r -> target<br>
which can be seen as a generalization of Boring, Unit, Typeable, and heaps of other stuff. So there is probably no end to how fundamental you can be.</p>
<div class="gmail_quote">Am 02.02.2016 18:41 schrieb "David Feuer" <<a href="mailto:david.feuer@gmail.com">david.feuer@gmail.com</a>>:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Or, alternatively, some common class that lets me express that a type is boring (i.e., inhabited by precisely one fully-defined value)? lens has Settable, whose law ensures the type involved has a boring representation (in the sense of representable functor), but is there a more fundamental way?</p>
<p dir="ltr">class Boring x where<br>
  inhabitant :: x<br>
instance Boring () where<br>
  inhabitant = ()<br>
instance Boring (Proxy a) where<br>
  inhabitant = Proxy<br>
instance Boring y => Boring (x -> y) where<br>
  inhabitant = const inhabitant<br>
instance (Boring x, Boring y) => Boring (x, y) where<br>
  inhabitant = (inhabitant, inhabitant)<br>
instance Boring x => Boring (Const x y) where<br>
  inhabitant = Const inhabitant<br>
instance Boring x => Boring (Identity x) where<br>
  inhabitant = Identity inhabitant<br>
...</p>
<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>