
Hi, How do I include type families (used as associated types) in a module export list? E.g.: class MyClass a where type T a :: * coolFunction :: Ta -> a (...) If I just include MyClass and its functions in the list, instances in other modules complain they don't know T, but I wasn't able to find how (where) to include T in the list. Thanks, Maurício

On Sat, May 30, 2009 at 7:35 PM, Maurício
Hi,
How do I include type families (used as associated types) in a module export list? E.g.:
class MyClass a where type T a :: * coolFunction :: Ta -> a (...)
If I just include MyClass and its functions in the list, instances in other modules complain they don't know T, but I wasn't able to find how (where) to include T in the list.
In export list, you can treat 'type T a' as normal type declaration, ie, write T(..) in export list. lee

Lee Duhem:
On Sat, May 30, 2009 at 7:35 PM, Maurí cio
wrote: Hi,
How do I include type families (used as associated types) in a module export list? E.g.:
class MyClass a where type T a :: * coolFunction :: Ta -> a (...)
If I just include MyClass and its functions in the list, instances in other modules complain they don't know T, but I wasn't able to find how (where) to include T in the list.
In export list, you can treat 'type T a' as normal type declaration, ie, write T(..) in export list.
There is also special syntax to export associated types. You can write MyClass (type T) in the export list; cf, http://haskell.org/haskellwiki/GHC/Type_families#Import_and_export Manuel

On Sun, May 31, 2009 at 7:10 PM, Manuel M T Chakravarty
Lee Duhem:
On Sat, May 30, 2009 at 7:35 PM, Maurí cio
wrote: Hi,
How do I include type families (used as associated types) in a module export list? E.g.:
class MyClass a where type T a :: * coolFunction :: Ta -> a (...)
If I just include MyClass and its functions in the list, instances in other modules complain they don't know T, but I wasn't able to find how (where) to include T in the list.
In export list, you can treat 'type T a' as normal type declaration, ie, write T(..) in export list.
There is also special syntax to export associated types. You can write
MyClass (type T)
in the export list; cf,
http://haskell.org/haskellwiki/GHC/Type_families#Import_and_export
This is a better way. lee
participants (3)
-
Lee Duhem
-
Manuel M T Chakravarty
-
Maurício