Re: [Haskell-cafe] Either e Monad

2006-09-19 Thread Albert Lai
Deokhwan Kim [EMAIL PROTECTED] writes: Where is the Monad instance declaration of Either e? It is in Control.Monad.Error as well. Strange: the doc doesn't state it. I found out in ghci using: :module +Control.Monad.Error :info Either The relevant result is: instance Error e = Monad (Either

Re: [Haskell-cafe] Either e Monad

2006-09-19 Thread Deokhwan Kim
Albert Lai wrote: Deokhwan Kim [EMAIL PROTECTED] writes: Where is the Monad instance declaration of Either e? It is in Control.Monad.Error as well. Strange: the doc doesn't state it. Thanks a lot, Albert! I found the declaration in libraries/mtl/Control/Monad/Error.hs of the ghc source

[Haskell-cafe] Re: Optimization problem

2006-09-19 Thread apfelmus
Ross Paterson wrote: On Sun, Sep 17, 2006 at 01:08:04PM +0200, [EMAIL PROTECTED] wrote: Ross Paterson wrote: It's interesting that these composed transformations don't seem to cost too much. That the composed transformations are indeed cheap is not necessarily disturbing. I meant the

Re: [Haskell-cafe] Re: Optimization problem

2006-09-19 Thread Ross Paterson
On Tue, Sep 19, 2006 at 01:41:51PM +0200, [EMAIL PROTECTED] wrote: Btw, why are there no irrefutable patterns for GADTs? Not GADTs, but existential types (whether done with GADTs or not). They can't be analysed with irrefutable patterns, of which let bindings are a special case:

Re: [Haskell-cafe] Re: Optimization problem

2006-09-19 Thread Conor McBride
Hi folks [EMAIL PROTECTED] wrote: Btw, why are there no irrefutable patterns for GADTs? I mean, such a sin should be shame for a non-strict language... Just imagine data Eq a b where Refl :: Eq a a coerce :: Eq a b - a - b coerce ~Refl a = b coerce undefined True :: String Bang

Re: [Haskell-cafe] Re: Optimization problem

2006-09-19 Thread Robert Dockins
On Sep 19, 2006, at 8:52 AM, Conor McBride wrote: Hi folks [EMAIL PROTECTED] wrote: Btw, why are there no irrefutable patterns for GADTs? I mean, such a sin should be shame for a non-strict language... Just imagine data Eq a b where Refl :: Eq a a coerce :: Eq a b - a - b coerce

Re: [Haskell-cafe] Traversing a graph in STM

2006-09-19 Thread Jan-Willem Maessen
On Sep 18, 2006, at 4:47 AM, Einar Karttunen wrote: On 18.09 01:23, Josef Svenningsson wrote: On 9/17/06, Jan-Willem Maessen [EMAIL PROTECTED] wrote: You can associate a unique name with each traversal, and store a set of traversals at each node (instead of a mark bit). But this set grows

Re: [Haskell-cafe] Re: Optimization problem

2006-09-19 Thread Conor McBride
Robert Dockins wrote: On Sep 19, 2006, at 8:52 AM, Conor McBride wrote: Hi folks [EMAIL PROTECTED] wrote: Btw, why are there no irrefutable patterns for GADTs? I mean, such a sin should be shame for a non-strict language... Just imagine data Eq a b where Refl :: Eq a a coerce :: Eq

Re: [Haskell-cafe] Traversing a graph in STM

2006-09-19 Thread Josef Svenningsson
On 9/19/06, Jan-Willem Maessen [EMAIL PROTECTED] wrote: On Sep 18, 2006, at 4:47 AM, Einar Karttunen wrote: On 18.09 01:23, Josef Svenningsson wrote: On 9/17/06, Jan-Willem Maessen [EMAIL PROTECTED] wrote: You can associate a unique name with each traversal, and store a set of traversals

Re[2]: [Haskell-cafe] Traversing a graph in STM

2006-09-19 Thread Bulat Ziganshin
Hello Jan-Willem, Tuesday, September 19, 2006, 5:47:15 PM, you wrote: I'd like to make an STM version of Data.HashTable, but it requires implementing some sort of STMArray, or using an array of TVars and are we not have TArray already? -- Best regards, Bulat

Re: Re[2]: [Haskell-cafe] Traversing a graph in STM

2006-09-19 Thread Sebastian Sylvan
On 9/19/06, Bulat Ziganshin [EMAIL PROTECTED] wrote: Hello Jan-Willem, Tuesday, September 19, 2006, 5:47:15 PM, you wrote: I'd like to make an STM version of Data.HashTable, but it requires implementing some sort of STMArray, or using an array of TVars and are we not have TArray already?

[Haskell-cafe] Re: Optimization problem

2006-09-19 Thread apfelmus
Conor McBride wrote: Just imagine data Eq a b where Refl :: Eq a a coerce :: Eq a b - a - b Robert Dockins wrote: coerce ~Refl x = x coerce undefined True :: String Bang you're dead. Or rather... Twiddle you're dead. Mom, he's scaring me! ;) Who says this function may not be

[Haskell-cafe] Re: Wiki contact

2006-09-19 Thread Ashley Yakeley
Bulat Ziganshin wrote: Hello Neil, Friday, September 15, 2006, 3:31:30 PM, you wrote: 2) How do you go about contacting the person responsible for the wiki? Is there a wiki page to drop messages off on? An email address? An email list? - it confused me!

[Haskell-cafe] sections for record settors

2006-09-19 Thread Tim Newsham
Hi, When you create a record in haskell, it automatically generates gettor functions for accessing the record fields. It also provides you with a record update syntax: rec {field=val} but there is no settor function. It would be nice if there was some sort of section-like syntax to

Re: [Haskell-cafe] sections for record settors

2006-09-19 Thread Misha Aizatulin
It would be nice if there was some sort of section-like syntax to access the settor function Indeed - I'd like it as well. Also these threads seem to deal with similar questions: http://www.haskell.org/pipermail/haskell/2005-February/015354.html

[Haskell-cafe] Re: map (-2) [1..5]

2006-09-19 Thread Aaron Denney
On 2006-09-11, Aaron Denney [EMAIL PROTECTED] wrote: See What About the Natural Numbers - Colin Runciman - it's a good read :) I will when I get the chance. Finally found a copy. It is a good read. I mostly agree with him. The biggest exception is about the need for highly optimized, near

[Haskell-cafe] Re: MonadList?

2006-09-19 Thread Ashley Yakeley
Michael Shulman wrote: This is because (ErrorT e []) inherits its instance of MonadPlus from Error, not from []. (Is there a reason for this, or is it just assumed that this is the more frequently desired behavior?) It's a flaw in MonadPlus, since it allows two different behaviours and

[Haskell-cafe] System threads?

2006-09-19 Thread Lyle Kopnicky
Hi folks, I'm working on a project for which the solution is highly parallelizable. I've been writing it so far for GHC as a single-threaded app. I'd like to be able to split the job into multiple pieces, and spawn different system threads for each piece, so they will run on separate CPUs.