[Haskell-cafe] "desactivate" my Show instance implementations temporarily

Lorenzo Bolla lbolla at gmail.com
Sun Apr 22 11:25:35 CEST 2012


On Sun, Apr 22, 2012 at 11:11:51AM +0200, TP wrote:
> Hello,
> 
> I have a module where I have made several types as instances of the Show 
> typeclass.
> 
> For debugging purpose, I would like to use the default implementation for Show 
> (the one obtained when using "deriving", which shows all the constructors). Is 
> there some option to do that, or have I to comment all the Show instances of 
> my code, and add "Show" in "deriving (...)" for each of my types? If this is 
> the only possibility, is there some script around here to do that 
> automatically?
> 
> Thanks in advance,
> 
> TP

You could use some preprocessor's #if/#else/#endif pragmas.
See here: http://stackoverflow.com/questions/6556778/using-if-else-endif-in-haskell

L.

-- 
Lorenzo Bolla
http://lbolla.info
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120422/5b34fceb/attachment.pgp>


More information about the Haskell-Cafe mailing list