[Haskell-cafe] name lists
Roman Cheplyaka
roma at ro-che.info
Tue Sep 17 16:38:56 CEST 2013
* Ben Gamari <bgamari.foss at gmail.com> [2013-09-17 10:03:41-0400]
> Another approach might be to introduce some notion of a name list which
> can appear in the export list. These lists could be built up by either
> user declarations in the source module or in Template Haskell splices
> and would serve as a way to group logically related exports. This
> would allow uses such as (excuse the terrible syntax),
>
> module HelloWorld ( namelist MyDataLenses
> , namelist ArithmeticOps
> ) where
>
> import Control.Lens
>
> data MyData = MyData { ... }
> makeLenses ''MyDataLenses
> -- makeLenses defines a namelist called MyDataLenses
>
> namelist ArithmeticOps (add)
> add = ...
>
> namelist ArithmeticOps (sub)
> sub = ...
Hi Ben,
Isn't this subsumed by ordinary Haskell modules, barring the current
compilers' limitation that modules are in 1-to-1 correspondence with
files (and thus are somewhat heavy-weight)?
E.g. the above could be structured as
module MyDataLenses where
data MyData = MyData { ... }
makeLenses ''MyData
module HelloWorld (module MyDataLenses, ...) where
...
Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130917/41da1952/attachment.pgp>
More information about the Haskell-Cafe
mailing list