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?
class Boring x where
_______________________________________________
inhabitant :: x
instance Boring () where
inhabitant = ()
instance Boring (Proxy a) where
inhabitant = Proxy
instance Boring y => Boring (x -> y) where
inhabitant = const inhabitant
instance (Boring x, Boring y) => Boring (x, y) where
inhabitant = (inhabitant, inhabitant)
instance Boring x => Boring (Const x y) where
inhabitant = Const inhabitant
instance Boring x => Boring (Identity x) where
inhabitant = Identity inhabitant
...
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe