Change definitions of Read1 and Show1 to allow correct list instances
authorRoss Paterson <ross@soi.city.ac.uk>
Wed, 16 Dec 2015 00:01:44 +0000 (00:01 +0000)
committerRoss Paterson <ross@soi.city.ac.uk>
Wed, 16 Dec 2015 00:01:44 +0000 (00:01 +0000)
commitd26c784d84cbe6034ccd0d8d6590d6c107665feb
tree86e8b24cdf4ee8ef4d9f2604d18fa799812074b7
parent34fba39b1279936a739ca8857e9592cc9a44c34e
Change definitions of Read1 and Show1 to allow correct list instances

The Read1 and Show1 classes did not allow special cases for lists as
supported by the base classes Read and Show.  Thus for example the
following displayed incorrectly:

Backwards "abc"
Compose (Just "abc")

see also https://ghc.haskell.org/trac/ghc/ticket/11135

To fix this requires an extra argument to the methods in Read1 and Show1,
effectively taking explicit dictionaries with two entries, like the base
classes.
15 files changed:
Control/Applicative/Backwards.hs
Control/Applicative/Lift.hs
Control/Monad/Trans/Error.hs
Control/Monad/Trans/Except.hs
Control/Monad/Trans/Identity.hs
Control/Monad/Trans/List.hs
Control/Monad/Trans/Maybe.hs
Control/Monad/Trans/Writer/Lazy.hs
Control/Monad/Trans/Writer/Strict.hs
Data/Functor/Classes.hs
Data/Functor/Compose.hs
Data/Functor/Constant.hs
Data/Functor/Product.hs
Data/Functor/Reverse.hs
Data/Functor/Sum.hs