[core libraries] Re: Future of "Text.Show.Functions" module

Michael Snoyman michael at snoyman.com
Sun Oct 19 19:07:44 UTC 2014


On Sun, Oct 19, 2014 at 10:03 PM, Brandon Allbery <allbery.b at gmail.com>
wrote:

> On Sun, Oct 19, 2014 at 3:00 PM, Michael Snoyman <michael at snoyman.com>
> wrote:
>
>> And if the instance is really as bad as that, I think having it in base
>> at all is a mistake. All it takes it one library upstream from you to
>> import that module, and you've been infected.
>
>
> It's useful in ghci.
>
> Which suggests a possible solution: perhaps things like this that are
> mostly useful from ghci should go into a GHC.Interactive hierarchy.
>
>
>
Based on this thread, I thought it was specifically in GHCi when it was
*not* considered helpful. Without the instance:

Prelude> print concat

<interactive>:2:1:
    No instance for (Show ([[a0]] -> [a0]))
      arising from a use of ‘print’
    In the expression: print concat
    In an equation for ‘it’: it = print concat

at least tells me what I'm looking at, whereas:

Prelude> import Text.Show.Functions
Prelude Text.Show.Functions> print concat
<function>

gives no important info. However, if this is all for GHCi's sake, isn't it
really a moot point:

Prelude Text.Show.Functions> :t concat
concat :: [[a]] -> [a]

I'd consider this instance useful for the case of:

data Foo = Foo { foo1 :: Int, foo2 :: Double, foo3 :: Char -> Bool }
    deriving Show

Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20141019/672ca08b/attachment-0001.html>


More information about the Libraries mailing list