
25 Oct
2010
25 Oct
'10
5:39 p.m.
El lun, 25-10-2010 a las 22:00 +0200, John Smith escribió:
Thank you. Why does this code succeed for a, but stills fails on instance Show B? Do they not both invoke the same Show A?
No, a doesn't use the instance for Array Int Bool. The (1,3) get defaulted to Integers. The following code will complain, though:
{-# LANGUAGE TypeSynonymInstances, OverlappingInstances, IncoherentInstances #-}
import Data.Array
type A = Array Int Bool
data B = B A
instance Show A where show a = "foo"
a = show $ listArray (1::Int,3) $ repeat True