remove Foreign.Marshal.Error.void

Henning Thielemann lemming at henning-thielemann.de
Sun Mar 18 16:19:08 CET 2012


On Sun, 18 Mar 2012, Evan Laforge wrote:

> On Sun, Mar 18, 2012 at 3:21 AM, Henning Thielemann <lemming at henning-thielemann.de> wrote:
>> You could skip the step of making Foreign.Marshal.Error.void and
>> Control.Monad.void the same function and deprecate
>> Foreign.Marshal.Error.void immediately. However I generally think that
>> explicit or qualified imports are the best way to avoid name clashes. There
>> are many programmers out there that do not program Haskell every day and do
>> not know where 'void' is defined when they read a Haskell program.
>
> Normally I use qualified imports, but these two modules are special.
> Foreign must be imported unqualified when used with hsc2hs, because
> hsc2hs emits unqualified identifiers.

I can't remember problems with hsc2hs, but I usually import not the whole 
Foreign, but Foreign.Storable etc. individually.

>  And Control.Monad.... well, it doesn't have to be unqualified, but 
> since it's full of control structures it's one of the few modules I'm 
> accustomed to importing unqualified.

I also use to import unqualified from Control.Monad, since identifiers 
like liftM2 already contain the monadic 'M'. However in this case I import 
explicitly:
   import Control.Monad (liftM2)



More information about the Libraries mailing list