Re: [Haskell-cafe] Removing mtl from the Haskell Platform

2009-05-14 Thread Wolfgang Jeltsch
Am Mittwoch, 13. Mai 2009 01:03 schrieb rocon...@theorem.ca:
 I wanted to pass this idea around the cafe to get some thoughts before
 submitting a trac on this topic.

 I'd like to see the mtl removed from the Haskell Platform.

 The mtl was a tremendous step forward when it was developed.  However, we
 have learned a few things about monad transformers since the development
 of the mtl, and it is time that we moved forward.

 There are at least 3 significant problem with the mtl.

 1) `pass' should not be a member functions of the MonadWriter class.  It
 is my understanding that there is no `MonadWriter w m = MonadWriter w
 (ContT s m)' instance because the `pass' function cannot be implemented.
 I'm also highly suspicious of some other methods too (I'm looking at you
 `local').

 2) The `StateT s (Cont r a)' instance of callCC is wrong.  The paper on
 modular monad transformers
 http://www.cs.nott.ac.uk/~mjj/pubs/mmt/mmt.pdf describes why this is
 wrong.

 3) I am told by many people that the order of the state and value pair in
 `State' is backwards.  Actually, I'm not entirely sure what the issue is
 here, but I trust the people who say this.

4) The identifiers State and StateT are flawed. Something of value State s a 
doesn’t denote a state but a state transformer or however you want to name 
it.

Best wishes,
Wolfgang
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Removing mtl from the Haskell Platform

2009-05-14 Thread Thomas ten Cate
On Thu, May 14, 2009 at 10:14, Wolfgang Jeltsch
g9ks1...@acme.softbase.org wrote:
 4) The identifiers State and StateT are flawed. Something of value State s a
 doesn’t denote a state but a state transformer or however you want to name
 it.

A state monad, i.e. a monad containing a state? If you use it in a
sentence in that way, the name State makes sense. StateTransformer
or something like that would lead to much confusion with the state
transformer transformer that is currently called StateT. I don't
really see a good alternative to the name State, and a good thing
about it is that it is short. Oh, bikesheds ought to be brown, of
course.

Cheers,

Thomas
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Removing mtl from the Haskell Platform

2009-05-13 Thread wren ng thornton

rocon...@theorem.ca wrote:
I wanted to pass this idea around the cafe to get some thoughts before 
submitting a trac on this topic.


I'd like to see the mtl removed from the Haskell Platform.

The mtl was a tremendous step forward when it was developed.  However, 
we have learned a few things about monad transformers since the 
development of the mtl, and it is time that we moved forward.


I would welcome a newer cleaner library to replace mtl. One caveat, in 
terms of the HP is that I'd like to see one clear alternative be 
blessed, instead of listing the alternatives. I think a big part of the 
reason many people have stuck with mtl is that they lack sufficient 
knowledge to be able to look at all the options and know which is the 
best and why, so they choose the one that is familiar.


This is similar to the Parsec problem. At the time it was introduced it 
was a major step forward, but these days there are a number of issues 
people consistently complain about. There's a large set of parser 
combinator libraries out there, but no one of them is clearly superior 
so people stick with what is familiar.



3) I am told by many people that the order of the state and value pair 
in `State' is backwards.  Actually, I'm not entirely sure what the issue 
is here, but I trust the people who say this.


Lacking type-level functions like flip, we can define the Functor ((,) 
s) easier than the reverse. This pretties type signatures up 
significantly when we start composing things[1] and doing other 
type-level programming. This is also the ordering used in dependently 
typed languages (replacing (-) with \Pi and (,) with \Sigma). Et cetera.


The current order makes the definition of (=) appear very marginally 
prettier, but it makes type signatures much uglier everywhere it's used.




[1] e.g. State s = Reader s . Writer s = (-) s . (,) s = /\a. s-(s,a)

--
Live well,
~wren
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


RE: [Haskell-cafe] Removing mtl from the Haskell Platform

2009-05-13 Thread Sittampalam, Ganesh
rocon...@theorem.ca wrote:

 I think that use of the mtl should be deprecated so that we move on
 to improved monad transformer libraries.  Having the mtl in the
 Haskell Platform does the opposite by further entrenching its use,
 possibly to the point where we may not be able to get rid of it for
 years.

 
 If I had to recommend a replace library, I would pick monadLib. 
 However, there are other libraries, such as the mmtl and transformers
 and it's related packages that I haven't looked at, and may also make
 fine replacements for the mtl.   

We've discussed replacing it with transformers+monads-fd+an mtl
compatiblity layer on librar...@. Ross and I plan to propose doing this
for the second release of the platform - it's not fair to disrupt the
first release at this stage.

transformers+monads-fd is quite a small evolution over mtl - it factors
out the fundeps into a separate package, tightens up some of the class
constraints, and makes State = StateT Identity etc rather than a
separate type. Even this breaks a few packages, but doing anything more
substantial would be quite disruptive. That's not to say that we
shouldn't do it, though.

I guess the libraries@ list will continue to be the place that such
decisions get made, but I think it's a bit up in the air at the moment.

Cheers,

Ganesh

=== 
 Please access the attached hyperlink for an important electronic 
communications disclaimer: 
 http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
 
=== 
 
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


The HP and PackedString (was: Re: [Haskell-cafe] Removing mtl from the Haskell Platform)

2009-05-13 Thread Ketil Malde

Not of the same gravity as mtl, but I was a bit surprised to see that
PackedString was included, in spite of it being marked as deprecated
on Hackage.

Presumably, this is because some other library depends on this, but I
think platform-blessing a deprecated library is a strange thing to
do.  If the functionality cannot be replaced in the dependent, could
it be an option to simply integrate the PS functionality?  Or should
it be de-deprecated?

wren ng thornton w...@freegeek.org writes:

 [..] in terms of the HP is that I'd like to see one clear
 alternative be  blessed, instead of listing the alternatives.

FWIW, I strongly agree with this.

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Removing mtl from the Haskell Platform

2009-05-13 Thread Neil Brown

Sittampalam, Ganesh wrote:

We've discussed replacing it with transformers+monads-fd+an mtl
compatiblity layer on librar...@. Ross and I plan to propose doing this
for the second release of the platform - it's not fair to disrupt the
first release at this stage.

transformers+monads-fd is quite a small evolution over mtl - it factors
out the fundeps into a separate package, tightens up some of the class
constraints, and makes State = StateT Identity etc rather than a
separate type. Even this breaks a few packages, but doing anything more
substantial would be quite disruptive. That's not to say that we
shouldn't do it, though.


For those of us wishing to target applications to the Haskell platform 
(e.g. our software works on Haskell Platform 2009.2, 2009.8, etc) will 
there be an easy way to determine which Haskell platform is currently 
installed so that we can accommodate any such incompatible changes?  
E.g. if Haskell platform = 2009.2 then use libraries mtl, parsec and 
#define HP_VERSION 200902, if Haskell platform = 2009.8 then use 
libraries transformers+monads-fd, parsec-compatibility, and #define 
HP_VERSION 200908.


Or am I looking at things the wrong way, and we should instead just use 
autoconf-like tests for individual libraries, regardless of the platform 
(if they have mtl, use mtl and #define USE_MTL, otherwise try 
transformers+monads-fd, otherwise error)?


Thanks,

Neil.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Removing mtl from the Haskell Platform

2009-05-13 Thread Duncan Coutts
On Wed, 2009-05-13 at 12:01 +0100, Neil Brown wrote:
 Sittampalam, Ganesh wrote:
  We've discussed replacing it with transformers+monads-fd+an mtl
  compatiblity layer on librar...@. Ross and I plan to propose doing this
  for the second release of the platform - it's not fair to disrupt the
  first release at this stage.
 
  transformers+monads-fd is quite a small evolution over mtl - it factors
  out the fundeps into a separate package, tightens up some of the class
  constraints, and makes State = StateT Identity etc rather than a
  separate type. Even this breaks a few packages, but doing anything more
  substantial would be quite disruptive. That's not to say that we
  shouldn't do it, though.
 
 For those of us wishing to target applications to the Haskell platform 
 (e.g. our software works on Haskell Platform 2009.2, 2009.8, etc) will 
 there be an easy way to determine which Haskell platform is currently 
 installed so that we can accommodate any such incompatible changes?  
 E.g. if Haskell platform = 2009.2 then use libraries mtl, parsec and 
 #define HP_VERSION 200902, if Haskell platform = 2009.8 then use 
 libraries transformers+monads-fd, parsec-compatibility, and #define 
 HP_VERSION 200908.

There are already cpp macros to enable to determine if your package is
being compiled using one library or another and to do conditional
compilation on the version. There is no additional mechanism planned for
the platform as a whole (because there is nothing to enforce that an end
user picks a set of dependencies that is consistent with a platform
release).

Duncan

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: The HP and PackedString (was: Re: [Haskell-cafe] Removing mtl from the Haskell Platform)

2009-05-13 Thread Duncan Coutts
On Wed, 2009-05-13 at 10:24 +0200, Ketil Malde wrote:
 Not of the same gravity as mtl, but I was a bit surprised to see that
 PackedString was included, in spite of it being marked as deprecated
 on Hackage.

TemplateHaskell still uses it. There was not a lot we could do for the
first release. Similarly for old-time.

 Presumably, this is because some other library depends on this, but I
 think platform-blessing a deprecated library is a strange thing to
 do.  If the functionality cannot be replaced in the dependent, could
 it be an option to simply integrate the PS functionality? 

That's not possible as it is part of the interface.

 Or should it be de-deprecated?

I think it should remain deprecated and we should work on the
replacement so that TH can switch its dependency.

Duncan

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re[2]: The HP and PackedString (was: Re: [Haskell-cafe] Removing mtl from the Haskell Platform)

2009-05-13 Thread Bulat Ziganshin
Hello Duncan,

Wednesday, May 13, 2009, 3:33:13 PM, you wrote:

 I think it should remain deprecated and we should work on the
 replacement so that TH can switch its dependency.

TH isn't high-performance package and i think that it should just
switch to use of String


-- 
Best regards,
 Bulatmailto:bulat.zigans...@gmail.com

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: The HP and PackedString (was: Re: [Haskell-cafe] Removing mtl from the Haskell Platform)

2009-05-13 Thread Robin Green
On Wed, 13 May 2009 15:37:52 +0400
Bulat Ziganshin bulat.zigans...@gmail.com wrote:

 Hello Duncan,
 
 Wednesday, May 13, 2009, 3:33:13 PM, you wrote:
 
  I think it should remain deprecated and we should work on the
  replacement so that TH can switch its dependency.
 
 TH isn't high-performance package and i think that it should just
 switch to use of String

I don't agree. TH can sometimes slow down a build considerably. I don't
want to see it getting even slower.
-- 
Robin
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re[2]: The HP and PackedString (was: Re: [Haskell-cafe] Removing mtl from the Haskell Platform)

2009-05-13 Thread Bulat Ziganshin
Hello Robin,

Wednesday, May 13, 2009, 3:45:57 PM, you wrote:

 TH isn't high-performance package and i think that it should just
 switch to use of String

 I don't agree. TH can sometimes slow down a build considerably. I don't
 want to see it getting even slower.

i think GHC compile times is the reason rather than execution of TH scripts

-- 
Best regards,
 Bulatmailto:bulat.zigans...@gmail.com

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: Re[2]: The HP and PackedString (was: Re: [Haskell-cafe] Removing mtl from the Haskell Platform)

2009-05-13 Thread Duncan Coutts
On Wed, 2009-05-13 at 15:37 +0400, Bulat Ziganshin wrote:
 Hello Duncan,
 
 Wednesday, May 13, 2009, 3:33:13 PM, you wrote:
 
  I think it should remain deprecated and we should work on the
  replacement so that TH can switch its dependency.
 
 TH isn't high-performance package and i think that it should just
 switch to use of String

That's a reasonable proposal for the next major release of the platform.
Please do propose it on the libraries list and see if we can get a
consensus.

Duncan

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: The HP and PackedString (was: Re: [Haskell-cafe] Removing mtl from the Haskell Platform)

2009-05-13 Thread Gwern Branwen
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On Wed, May 13, 2009 at 7:45 AM, Robin Green  wrote:
 I don't agree. TH can sometimes slow down a build considerably. I don't
 want to see it getting even slower.

I once switched TH to Strings. All the uses are trivial, and the
encoded strings so small I found myself wondering whether
bytestring/packedstring might not be slower than regular string.

Certainly, I didn't notice any significant slowdown.

- --
gwern
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEAREKAAYFAkoKv/AACgkQvpDo5Pfl1oLNKgCdEKH0nT/6f3lni7QtjUr4Rfwv
NAAAn0J+ZBgwYchGVDTbfnhxhuS5dvep
=KtIG
-END PGP SIGNATURE-
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Removing mtl from the Haskell Platform

2009-05-13 Thread David Leimbach
Nothing controversial said here... I'm just agreeing with Russel.

On Tue, May 12, 2009 at 4:03 PM, rocon...@theorem.ca wrote:

 I wanted to pass this idea around the cafe to get some thoughts before
 submitting a trac on this topic.

 I'd like to see the mtl removed from the Haskell Platform.

 The mtl was a tremendous step forward when it was developed.  However, we
 have learned a few things about monad transformers since the development of
 the mtl, and it is time that we moved forward.

 There are at least 3 significant problem with the mtl.

 1) `pass' should not be a member functions of the MonadWriter class.  It is
 my understanding that there is no `MonadWriter w m = MonadWriter w (ContT s
 m)' instance because the `pass' function cannot be implemented. I'm also
 highly suspicious of some other methods too (I'm looking at you `local').

 2) The `StateT s (Cont r a)' instance of callCC is wrong.  The paper on
 modular monad transformers http://www.cs.nott.ac.uk/~mjj/pubs/mmt/mmt.pdf
 describes why this is wrong.

 3) I am told by many people that the order of the state and value pair in
 `State' is backwards.  Actually, I'm not entirely sure what the issue is
 here, but I trust the people who say this.

 I think that use of the mtl should be deprecated so that we move on to
 improved monad transformer libraries.  Having the mtl in the Haskell
 Platform does the opposite by further entrenching its use, possibly to the
 point where we may not be able to get rid of it for years.

 If I had to recommend a replace library, I would pick monadLib.  However,
 there are other libraries, such as the mmtl and transformers and it's
 related packages that I haven't looked at, and may also make fine
 replacements for the mtl.

 --
 Russell O'Connor  http://r6.ca/
 ``All talk about `theft,''' the general counsel of the American Graphophone
 Company wrote, ``is the merest claptrap, for there exists no property in
 ideas musical, literary or artistic, except as defined by statute.''
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: The HP and PackedString (was: Re: [Haskell-cafe] Removing mtl from the Haskell Platform)

2009-05-13 Thread Don Stewart

ketil:
 
 Not of the same gravity as mtl, but I was a bit surprised to see that
 PackedString was included, in spite of it being marked as deprecated
 on Hackage.

Ketil, I would encourage you to open a ticket on the platform wiki
summarising the state of the packedstring issue.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Removing mtl from the Haskell Platform

2009-05-13 Thread Ross Paterson
On Wed, May 13, 2009 at 08:04:52AM +0100, Sittampalam, Ganesh wrote:
 We've discussed replacing it with transformers+monads-fd+an mtl
 compatiblity layer on librar...@. Ross and I plan to propose doing this
 for the second release of the platform - it's not fair to disrupt the
 first release at this stage.
 
 transformers+monads-fd is quite a small evolution over mtl - it factors
 out the fundeps into a separate package, tightens up some of the class
 constraints, and makes State = StateT Identity etc rather than a
 separate type. Even this breaks a few packages, but doing anything more
 substantial would be quite disruptive. That's not to say that we
 shouldn't do it, though.

Indeed it is a conservative step, but splitting the transformers from the
classes makes it easier to experiment with replacements for the classes
while retaining a degree of interoperability.  Of the issues listed, 1)
and 2) are in the type class package (e.g. transformers exports functions
for both liftings of callCC).  I'm not sure what is meant by 3).
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: The HP and PackedString (was: Re: [Haskell-cafe] Removing mtl from the Haskell Platform)

2009-05-13 Thread Don Stewart
gwern0:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA512
 
 On Wed, May 13, 2009 at 7:45 AM, Robin Green  wrote:
  I don't agree. TH can sometimes slow down a build considerably. I don't
  want to see it getting even slower.
 
 I once switched TH to Strings. All the uses are trivial, and the
 encoded strings so small I found myself wondering whether
 bytestring/packedstring might not be slower than regular string.
 
 Certainly, I didn't notice any significant slowdown.

Do you have a patch?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: The HP and PackedString (was: Re: [Haskell-cafe] Removing mtl from the Haskell Platform)

2009-05-13 Thread Gwern Branwen
On Wed, May 13, 2009 at 6:31 PM, Don Stewart d...@galois.com wrote:
 Do you have a patch?

No. This was a while ago, and the changes really are trivial. I
thought about submitting it, but it seemed to me that the change could
only be useful when people upgrade their entire compiler/library
infrastructure - link errors otherwise - and I wasn't sure it was
worth paddling upstream librar...@.

-- 
gwern
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Removing mtl from the Haskell Platform

2009-05-12 Thread roconnor
I wanted to pass this idea around the cafe to get some thoughts before 
submitting a trac on this topic.


I'd like to see the mtl removed from the Haskell Platform.

The mtl was a tremendous step forward when it was developed.  However, we 
have learned a few things about monad transformers since the development 
of the mtl, and it is time that we moved forward.


There are at least 3 significant problem with the mtl.

1) `pass' should not be a member functions of the MonadWriter class.  It 
is my understanding that there is no `MonadWriter w m = MonadWriter w 
(ContT s m)' instance because the `pass' function cannot be implemented. 
I'm also highly suspicious of some other methods too (I'm looking at you 
`local').


2) The `StateT s (Cont r a)' instance of callCC is wrong.  The paper on 
modular monad transformers 
http://www.cs.nott.ac.uk/~mjj/pubs/mmt/mmt.pdf describes why this is 
wrong.


3) I am told by many people that the order of the state and value pair in 
`State' is backwards.  Actually, I'm not entirely sure what the issue is 
here, but I trust the people who say this.


I think that use of the mtl should be deprecated so that we move on to 
improved monad transformer libraries.  Having the mtl in the Haskell 
Platform does the opposite by further entrenching its use, possibly to the 
point where we may not be able to get rid of it for years.


If I had to recommend a replace library, I would pick monadLib.  However, 
there are other libraries, such as the mmtl and transformers and it's 
related packages that I haven't looked at, and may also make fine 
replacements for the mtl.


--
Russell O'Connor  http://r6.ca/
``All talk about `theft,''' the general counsel of the American Graphophone
Company wrote, ``is the merest claptrap, for there exists no property in
ideas musical, literary or artistic, except as defined by statute.''
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe