From: Malcolm.Wallace@cs.york.ac.uk Date: Thu, 24 May 2007 16:06:15 +0000 (+0000) Subject: nhc98 version of instance Show (a->b) copied from Prelude X-Git-Tag: 2007-09-13~81 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=9f330c4537e105a563ca9dc8b50b0f146a17dde8;p=ghc-base.git nhc98 version of instance Show (a->b) copied from Prelude --- diff --git a/Text/Show/Functions.hs b/Text/Show/Functions.hs index d0e2207..315d4d3 100644 --- a/Text/Show/Functions.hs +++ b/Text/Show/Functions.hs @@ -22,4 +22,12 @@ import Prelude #ifndef __NHC__ instance Show (a -> b) where showsPrec _ _ = showString "" +#else +instance (Show a,Show b) => Show (a->b) where + showsPrec d a = showString "<>" + + showsType a = showChar '(' . showsType value . showString " -> " . + showsType result . showChar ')' + where (value,result) = getTypes undefined + getTypes x = (x,a x) #endif