[Haskell-cafe] Use of abbreviations in Haskell

Henning Thielemann schlepptop at henning-thielemann.de
Fri Jan 2 20:03:35 EST 2009


Miguel Mitrofanov schrieb:

> module Element where
> import QName
> import ...
> data Element = Element {name :: QName, attribs :: [Attr], content ::
> [Content], line :: Maybe Line}
> 
> module Attr where
> import QName
> import ...
> data Attr = Attr {key :: QName, val :: String}
> 
> module QName where
> import ...
> data QName = QName {name :: String, uri :: Maybe String, prefix :: Maybe
> String}
> 
> module Main where
> import qualified QName as Q
> import qualified Element as E
> ... Q.name ... E.name ...

+1 for this style

http://www.haskell.org/haskellwiki/Qualified_names


More information about the Haskell-Cafe mailing list