Type families difference between 7.0.4 and 7.2.1

Luite Stegeman stegeman at gmail.com
Tue Aug 16 17:57:21 CEST 2011


sorry, I accidentally sent my reply to Brandon to the wrong address,
not this list.

On Tue, Aug 16, 2011 at 4:56 PM, Dan Doel <dan.doel at gmail.com> wrote:
...
> I don't really understand why it would be impossible not to export a
> data family, given that (instances I understand). And of course, you
> can selectively export methods of a class, so why not associated
> types?

I don't understand that either. A link to the original discussion or
issue number would be welcome.

I'll repeat my example and add what I meant with "Within B it can only
be referred to as C.F":

-- A.hs
module A where

import B

-- B.hs
{-# LANGUAGE TypeFamilies #-}

module B where

import qualified C

data B1 a = B1 a

instance C.C1 (B1 a) where
  data C.F (B1 a) = B2 a

data family D a

-- C.hs
{-# LANGUAGE TypeFamilies #-}
module C where

class C1 a where
  data F a :: *

-- ghci 7.2.1
ghci A
*A> :info F
data family F a 	-- Defined at C.hs:6:8

ghci B
*B> :browse
data B1 a = B1 a
data instance B.R:FB1 (B1 a) = B2 a
data family D a
data family F a
*B> :info F
Top level: Not in scope: data constructor `F'
*B> :info C.F
data family C.F a 	-- Defined at C.hs:6:8

-- ghci 7.0.4
ghci A
*A> :info F
Top level: Not in scope: data constructor `F'



More information about the Glasgow-haskell-users mailing list