Re: [Haskell-cafe] ContT and ST stack

2011-03-11 Thread Max Bolingbroke
On 10 March 2011 17:55, Bas van Dijk v.dijk@gmail.com wrote: On 10 March 2011 18:24, Yves Parès limestr...@gmail.com wrote: Why has the operator (.) troubles with a type like (forall s. ST s a)? Why can't it match the type 'b' in (.) definition? As explained by the email from SPJ that I

Re: [Haskell-cafe] ContT and ST stack

2011-03-11 Thread Edward Z. Yang
Excerpts from Max Bolingbroke's message of Fri Mar 11 05:15:34 -0500 2011: AFAIK this decision was reversed because SPJ found a simple way to support them. Indeed, they work fine in 7.0.2 and generate warnings. Correct. About a week-ish ago I submitted a patch to update the docs. Cheers,

Re: [Haskell-cafe] ContT and ST stack

2011-03-11 Thread Bas van Dijk
On 11 March 2011 11:15, Max Bolingbroke batterseapo...@hotmail.com wrote: On 10 March 2011 17:55, Bas van Dijk v.dijk@gmail.com wrote: On 10 March 2011 18:24, Yves Parès limestr...@gmail.com wrote: Why has the operator (.) troubles with a type like (forall s. ST s a)? Why can't it match

Re: [Haskell-cafe] ContT and ST stack

2011-03-11 Thread Bas van Dijk
On 11 March 2011 12:04, Bas van Dijk v.dijk@gmail.com wrote: Unfortunately foo still doesn't type check in 7.0.2: foo :: (forall s. ST s a) - a foo st = ($) runST st Note that the following does type check with ImpredicativeTypes: bar = id runST Bas

[Haskell-cafe] ContT and ST stack

2011-03-10 Thread Anakim Border
Dear list, I have the following (simplified) piece of code: find :: Int - [Int] find i = runST . (`runContT` return) $ callCC $ \escape - do return [] which used to compile correctly under GHC 6.12.3. Now that I've switched to 7.0.2 it gets rejected with the following error:

Re: [Haskell-cafe] ContT and ST stack

2011-03-10 Thread Daniel Fischer
On Thursday 10 March 2011 14:18:24, Anakim Border wrote: Dear list, I have the following (simplified) piece of code: find :: Int - [Int] find i = runST . (`runContT` return) $ callCC $ \escape - do return [] which used to compile correctly under GHC 6.12.3. Now that I've

Re: [Haskell-cafe] ContT and ST stack

2011-03-10 Thread Bas van Dijk
On 10 March 2011 14:47, Daniel Fischer daniel.is.fisc...@googlemail.com wrote: If memory serves correctly, it's impredicative polymorphism. Indeed. For example the following also doesn't type check in GHC-7: foo :: (forall s. ST s a) - a foo st = ($) runST st Surprisingly the following does:

Re: [Haskell-cafe] ContT and ST stack

2011-03-10 Thread Daniel Fischer
On Thursday 10 March 2011 17:15:29, Bas van Dijk wrote: On 10 March 2011 14:47, Daniel Fischer daniel.is.fisc...@googlemail.com wrote: If memory serves correctly, it's impredicative polymorphism. Indeed. For example the following also doesn't type check in GHC-7: foo :: (forall s. ST s

Re: [Haskell-cafe] ContT and ST stack

2011-03-10 Thread Yves Parès
Why has the operator (.) troubles with a type like (forall s. ST s a)? Why can't it match the type 'b' in (.) definition? 2011/3/10 Daniel Fischer daniel.is.fisc...@googlemail.com On Thursday 10 March 2011 14:18:24, Anakim Border wrote: Dear list, I have the following (simplified) piece

Re: [Haskell-cafe] ContT and ST stack

2011-03-10 Thread Bas van Dijk
On 10 March 2011 18:24, Yves Parès limestr...@gmail.com wrote: Why has the operator (.) troubles with a type like (forall s. ST s a)? Why can't it match the type 'b' in (.) definition? As explained by the email from SPJ that I linked to, instantiating a type variable (like 'b') with a