On Mon, Jan 19, 2015 at 8:01 AM, Dmitriy Matrosov <sgf.dma@gmail.com> wrote:
I've tried to define (Maybe a) instance for ExtensionClass from XMonad/Core.hs
in such way, that extensionType value would use the same data constructor as
was used for the type a itself. But the code below typechecks only, if i add
(Show a) and (Read a) constraints to (Maybe a) instance definition, what makes
such definition useless for types, which do not have these instances and do
not want to use PersistentExtension .

ExtensionClass data is stored in the layout and therefore requires those constraints. No, there is no magic to cause non-persistent ExtensionClass data to be stored in some other place different from where the rest of it is stored.

I'm also wondering how much trouble you can get into by conflicting with some other ExtensionClass that already uses Maybe.

--
brandon s allbery kf8nh                               sine nomine associates
allbery.b@gmail.com                                  ballbery@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net