[Haskell-cafe] Re: Module.T naming style

John Meacham john at repetae.net
Fri Jul 15 17:01:04 EDT 2005


I have mixed feelings about Module.T, but consider it useful. basically,
I use it only when the module naturally only exports a single type which
is the purpose of the module (modules which incidentally only export a
single type but have a different focus shouldn't use the type synonym)
and the modules functions are named in such a way that it is intended to
be used in a qualified way. (like the new Data.Map and Data.Set).
However, I don't try to force any modules or types into this model if
they don't naturally fall into them. 

I also make sure that the T is a type synonym for the actual name. as in

module Vector where

data Vector = ...
type T = Vector

This ensures that tools that strip the module name still give reasonable
names to things since most expand type synonyms away. 

So, in conclusion, I think Vector and Matrix do naturally fall into
these conditions so should have T but as type synonyms and not the base
name. 

        John

-- 
John Meacham - ⑆repetae.net⑆john⑈ 


More information about the Haskell-Cafe mailing list