aditya bhargava | 8 Aug 04:23 2013
Picon

Importing more modules by default

Hi there,
It seems like every Haskell program I write imports the following modules:

Control.Monad
Control.Applicative
Data.Maybe
Data.List

Is there a good reason why these modules aren't imported by default? When I write a simple script usually a 1/4th of the script is just imports, and my code just looks uglier.

Adit
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Carter Schonwald | 8 Aug 07:08 2013
Picon

Re: Importing more modules by default

Hello Aditya,
you could write a script to generate a starter file for yourself. I do something like that with my own latex documents. Or have your own special module that reexports all of those that you import for you own projects. Its very easy to write your own module that reExports other modules. try it out. many libraries that you use, such as containers, do that

theres enough variety and complexity to nontrivial  projects that such a "enforced import" would end badly 


On Wed, Aug 7, 2013 at 10:23 PM, aditya bhargava <bluemangroupie <at> gmail.com> wrote:
Hi there,
It seems like every Haskell program I write imports the following modules:

Control.Monad
Control.Applicative
Data.Maybe
Data.List

Is there a good reason why these modules aren't imported by default? When I write a simple script usually a 1/4th of the script is just imports, and my code just looks uglier.

Adit

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
David McBride | 8 Aug 16:04 2013
Picon

Re: Importing more modules by default

I've started using BasicPrelude with -XNoImplicitPrelude in all of my code.  It imports all of those and some other stuff as well (text related functions).  Cuts down on my imports by a little over half.  Kind of wish it could be made the default.


On Wed, Aug 7, 2013 at 10:23 PM, aditya bhargava <bluemangroupie <at> gmail.com> wrote:
Hi there,
It seems like every Haskell program I write imports the following modules:

Control.Monad
Control.Applicative
Data.Maybe
Data.List

Is there a good reason why these modules aren't imported by default? When I write a simple script usually a 1/4th of the script is just imports, and my code just looks uglier.

Adit

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
aditya bhargava | 10 Aug 07:36 2013
Picon

Re: Importing more modules by default

Cool, BasicPrelude solves my problem perfectly!



On Thu, Aug 8, 2013 at 7:04 AM, David McBride <toad3k <at> gmail.com> wrote:
I've started using BasicPrelude with -XNoImplicitPrelude in all of my code.  It imports all of those and some other stuff as well (text related functions).  Cuts down on my imports by a little over half.  Kind of wish it could be made the default.


On Wed, Aug 7, 2013 at 10:23 PM, aditya bhargava <bluemangroupie <at> gmail.com> wrote:
Hi there,
It seems like every Haskell program I write imports the following modules:

Control.Monad
Control.Applicative
Data.Maybe
Data.List

Is there a good reason why these modules aren't imported by default? When I write a simple script usually a 1/4th of the script is just imports, and my code just looks uglier.

Adit

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe





--
adit.io
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Gmane