[Haskell-cafe] Rename When Import

Albert Y. C. Lai trebla at vex.net
Wed Nov 10 15:31:50 EST 2010

On 10-11-10 02:51 PM, Albert Y. C. Lai wrote:
> import SinisterlyNamedModule(
>   Parsec at GoodType(State at CaseOne(stdin at gfa),
>                   Cont at CaseTwo(runST at gfb, fromList at gfc)
>                  ),

Sorry, that part was mistaken, and not in line with standard Haskell. 
Here is the correction, and more in line with standard Haskell:

import SinisterlyNamedModule(
   Parsec at GoodType(State at CaseOne, Cont at CaseTwo,
                   stdin at gfa, runST at gfb, fromList at gfc

It also streamlines doing this. Assume SecondModule:

module SecondModule where
data Functor = Applicative { join :: String }
              | Category { join :: String, fix :: [Functor] }

Then to import and rename:

import SecondModule(
   Functor at Personnel(Applicative at Worker, Category at Supervisor,
                     join at employee_name, fix at subordinates

join is consistently renamed to employee_name, in particular.

More information about the Haskell-Cafe mailing list