ANNOUNCE: new bridge! (prelude-prime)

I liked Andreas's idea (cited below). Hence the new package
prelude-prime.
https://github.com/feuerbach/prelude-prime
http://hackage.haskell.org/package/prelude-prime
Pull requests are welcome, but let's stick to widely agreed changes
(like the Foldable/Traversable one). I think one of the reasons why
other Preludes haven't been adopted is because they were too radical.
Let's see whether people here can put their code where their mouth is :)
Roman
* Andreas Abel
Maybe instead of fiddling with the current Prelude (which might break backwards compatibility), we should design a new prelude which is not automatically loaded but contains roughly the current prelude (with the list functions generalized to collections) plus the "modern" type class stack: Functor, Applicative, Monad, Foldable, Traversable, Monoid etc.
I am willing to write
{-# LANGUAGE NoImplicitPrelude #-} import Base
if I get a decent, "modern" standard set of functions that could be considered as the base vocabulary of modern Haskell programmers...
I just do not want to think about the democratic process involved in this design...
Cheers, Andreas

I wish it was possible to use an extension
CustomPrelude = Prelude.Prime
In the cabal file
2013/5/23 Roman Cheplyaka
I liked Andreas's idea (cited below). Hence the new package prelude-prime.
https://github.com/feuerbach/prelude-prime http://hackage.haskell.org/package/prelude-prime
Pull requests are welcome, but let's stick to widely agreed changes (like the Foldable/Traversable one). I think one of the reasons why other Preludes haven't been adopted is because they were too radical.
Let's see whether people here can put their code where their mouth is :)
Roman
* Andreas Abel
[2013-05-20 13:26:05+0200] Maybe instead of fiddling with the current Prelude (which might break backwards compatibility), we should design a new prelude which is not automatically loaded but contains roughly the current prelude (with the list functions generalized to collections) plus the "modern" type class stack: Functor, Applicative, Monad, Foldable, Traversable, Monoid etc.
I am willing to write
{-# LANGUAGE NoImplicitPrelude #-} import Base
if I get a decent, "modern" standard set of functions that could be considered as the base vocabulary of modern Haskell programmers...
I just do not want to think about the democratic process involved in this design...
Cheers, Andreas
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

HI, Am Donnerstag, den 23.05.2013, 12:38 +0400 schrieb Anton Kholomiov:
I wish it was possible to use an extension
CustomPrelude = Prelude.Prime
In the cabal file
as far as I know, GHC simply issues an implicit import Prelude without package qualifiers. So you can get what you want by not depending on base, but rather have prelude-prime re-export all modules from base plus its own Preldue. A more modular variant would be to have a package "preludeless-base" which re-exports all modules from base but the prelude. Then you can select which prelude you want simply by depending on preludeless-base (instead of base) plus a package (say prelude-prime) which exports a module named Prelude. If prelude-prime itself wants to use base, it can still use package-qualified imports. Or it could itself be based on preludeless-base. Greetings, Joachim -- Joachim "nomeata" Breitner Debian Developer nomeata@debian.org | ICQ# 74513189 | GPG-Keyid: 4743206C JID: nomeata@joachim-breitner.de | http://people.debian.org/~nomeata

On 23 May 2013 11:26, Joachim Breitner
So you can get what you want by not depending on base, but rather have prelude-prime re-export all modules from base plus its own Preldue.
How would you re-export all base's modules from the prelude-prime package? I didn't know this was already possible. Bas

Hi, Am Donnerstag, den 23.05.2013, 11:52 +0200 schrieb Bas van Dijk:
On 23 May 2013 11:26, Joachim Breitner
wrote: So you can get what you want by not depending on base, but rather have prelude-prime re-export all modules from base plus its own Preldue.
How would you re-export all base's modules from the prelude-prime package? I didn't know this was already possible.
manually... you create a .hs file for every module in base, which imports the module in base (using a package-qualified import), gives it a qualified name and puts that name in the export list. Greetings, Joachim -- Joachim "nomeata" Breitner Debian Developer nomeata@debian.org | ICQ# 74513189 | GPG-Keyid: 4743206C JID: nomeata@joachim-breitner.de | http://people.debian.org/~nomeata

On 23 May 2013 11:54, Joachim Breitner
Hi,
Am Donnerstag, den 23.05.2013, 11:52 +0200 schrieb Bas van Dijk:
On 23 May 2013 11:26, Joachim Breitner
wrote: So you can get what you want by not depending on base, but rather have prelude-prime re-export all modules from base plus its own Preldue.
How would you re-export all base's modules from the prelude-prime package? I didn't know this was already possible.
manually...
you create a .hs file for every module in base, which imports the module in base (using a package-qualified import), gives it a qualified name and puts that name in the export list.
I see. Thanks for the clarification.

On Thu, May 23, 2013 at 11:38 AM, Anton Kholomiov wrote: I wish it was possible to use an extension CustomPrelude = Prelude.Prime In the cabal file I'm not necessarily opposed to this idea, but I'd like to point out that it
can have a negative impact on readability of an individual module, since
you can't tell which Prelude is being used. This is the same argument used
for putting LANGUAGE pragmas in a modules instead of listing them in a
cabal file. I think in the case of an alternate Prelude, the argument is
stronger, since language extensions often don't change the meaning of code,
but instead allow previously invalid code to be valid.
Michael

On Thu, May 23, 2013 at 3:07 AM, Roman Cheplyaka
Pull requests are welcome, but let's stick to widely agreed changes (like the Foldable/Traversable one). I think one of the reasons why other Preludes haven't been adopted is because they were too radical.
* Andreas Abel
[2013-05-20 13:26:05+0200] Maybe instead of fiddling with the current Prelude (which might break backwards compatibility), we should design a new prelude which is not automatically loaded but contains roughly the current prelude (with the list functions generalized to collections) plus the "modern" type class stack: Functor, Applicative, Monad, Foldable, Traversable, Monoid etc.
Is this strategy adequate for attacking the issue of the type class stack, though? Defining, say, a new Monad class with the desired Functor constraint wouldn’t be of much use, as everything else on Hackage (and on the GHC libraries!) would still use the “real” Monad. I still see value in this package — a conservative extension to the Prelude would certainly come in handy. Thanks!

* Manuel Gómez
On Thu, May 23, 2013 at 3:07 AM, Roman Cheplyaka
wrote: Pull requests are welcome, but let's stick to widely agreed changes (like the Foldable/Traversable one). I think one of the reasons why other Preludes haven't been adopted is because they were too radical.
* Andreas Abel
[2013-05-20 13:26:05+0200] Maybe instead of fiddling with the current Prelude (which might break backwards compatibility), we should design a new prelude which is not automatically loaded but contains roughly the current prelude (with the list functions generalized to collections) plus the "modern" type class stack: Functor, Applicative, Monad, Foldable, Traversable, Monoid etc.
Is this strategy adequate for attacking the issue of the type class stack, though? Defining, say, a new Monad class with the desired Functor constraint wouldn’t be of much use, as everything else on Hackage (and on the GHC libraries!) would still use the “real” Monad.
No, it definitely isn't. Roman

On Thu, May 23, 2013 at 6:13 AM, Roman Cheplyaka
* Manuel Gómez
[2013-05-23 08:33:15-0430] On Thu, May 23, 2013 at 3:07 AM, Roman Cheplyaka
wrote: Pull requests are welcome, but let's stick to widely agreed changes (like the Foldable/Traversable one). I think one of the reasons why other Preludes haven't been adopted is because they were too radical.
* Andreas Abel
[2013-05-20 13:26:05+0200] Maybe instead of fiddling with the current Prelude (which might break backwards compatibility), we should design a new prelude which is not automatically loaded but contains roughly the current prelude (with the list functions generalized to collections) plus the "modern" type class stack: Functor, Applicative, Monad, Foldable, Traversable, Monoid etc.
Is this strategy adequate for attacking the issue of the type class stack, though? Defining, say, a new Monad class with the desired Functor constraint wouldn’t be of much use, as everything else on Hackage (and on the GHC libraries!) would still use the “real” Monad.
No, it definitely isn't.
I think that there is enough interest in fixing the functor typeclass hierarchy that we should probably get the ball rolling on making it a part of the next Haskell language standard. Yes, it would break code. Probably a lot of code. Which is exactly why it should be a part of the language standard, instead of an ad hoc compiler change. Ideally, the change would be synchronized with the release of a new Haskell Platform, as well, like the Haskell Platform 2010.2 (I think -- the first one tied to GHC 7.*) In particular, it would be very nice if we could just change Cabal files to explicitly use the haskell98 and haskell2010 packages to get the old interface back. Presumably, those packages would eventually be deprecated. Also, we might want the language standard to reserve the module namespace Haskell.* for modules like IO, instead of just plain IO. (So that we'd have Haskell.System.IO instead of IO /AND/ System.IO) I don't remember the details, but these module names are the only reason my code won't work with haskell98/2010 packages.
participants (7)
-
Alexander Solla
-
Anton Kholomiov
-
Bas van Dijk
-
Joachim Breitner
-
Manuel Gómez
-
Michael Snoyman
-
Roman Cheplyaka