Re: [haskell-cafe] Monad and kinds

2008-09-05 Thread Tim Chevalier
On 9/4/08, John Dorsey [EMAIL PROTECTED] wrote: I'm no master either, but I'd argue that if we promise new programmers that they don't need to care about strictness, we thereby ensure that default laziness is treacherous. A year or two ago, ISTR that *most* of the newbie-generated traffic

Re: [haskell-cafe] Monad and kinds

2008-09-05 Thread John Dorsey
Tim, A year or two ago, ISTR that *most* of the newbie-generated traffic in the cafe was about atrocious performance of naive programs due to strict/lazy concerns. I think it was scaring people away. I think it's debatable what the various causality relationships might be here.

Re: [haskell-cafe] Monad and kinds

2008-09-05 Thread Jules Bean
Jake Mcarthur wrote: On Sep 4, 2008, at 9:52 PM, Tim Chevalier wrote: I'm no master, but I've never encountered a situation where strictness annotations would be useful as documentation, nor can I imagine one. I'm no master either, but how about these simple examples? data

Re: [haskell-cafe] Monad and kinds

2008-09-05 Thread Ketil Malde
Jules Bean [EMAIL PROTECTED] writes: On Sep 4, 2008, at 10:19 AM, Tim Chevalier wrote: The master programmer does not add strictness annotations, for she has not yet run the profiler. The compiler will certainly be able to infer the strictness itself As far as I am aware this statement is

Re: [haskell-cafe] Monad and kinds

2008-09-05 Thread Derek Elkins
On Thu, 2008-09-04 at 08:19 -0700, Tim Chevalier wrote: On 9/3/08, wren ng thornton [EMAIL PROTECTED] wrote: If you want the datatype to be strict in state and rec, then you should add strictness annotations to those fields directly: data Query state rec = Query !state !rec The

Re: [haskell-cafe] Monad and kinds

2008-09-05 Thread Tim Chevalier
On Fri, Sep 5, 2008 at 7:23 PM, Derek Elkins [EMAIL PROTECTED] wrote: This attitude is wrong. Many potentially significant performance problems can easily be spotted and solved during construction without affecting the readability of the code, problems that would be much harder to diagnose

Re: [haskell-cafe] Monad and kinds

2008-09-05 Thread Derek Elkins
On Fri, 2008-09-05 at 20:11 -0700, Tim Chevalier wrote: On Fri, Sep 5, 2008 at 7:23 PM, Derek Elkins [EMAIL PROTECTED] wrote: This attitude is wrong. Many potentially significant performance problems can easily be spotted and solved during construction without affecting the readability

Re: [haskell-cafe] Monad and kinds

2008-09-04 Thread Tim Chevalier
On 9/3/08, wren ng thornton [EMAIL PROTECTED] wrote: If you want the datatype to be strict in state and rec, then you should add strictness annotations to those fields directly: data Query state rec = Query !state !rec The novice programmer scatters strictness annotations to and fro like

Re: [haskell-cafe] Monad and kinds

2008-09-04 Thread Jake Mcarthur
On Sep 4, 2008, at 10:19 AM, Tim Chevalier wrote: The master programmer does not add strictness annotations, for she has not yet run the profiler. My guess would be that a master usually adds strictness annotations as documentation rather than as optimizations. - Jake McArthur

Re: [haskell-cafe] Monad and kinds

2008-09-04 Thread Tim Chevalier
On 9/4/08, Jake Mcarthur [EMAIL PROTECTED] wrote: My guess would be that a master usually adds strictness annotations as documentation rather than as optimizations. I'm no master, but I've never encountered a situation where strictness annotations would be useful as documentation, nor can I

Re: [haskell-cafe] Monad and kinds

2008-09-04 Thread Jake Mcarthur
On Sep 4, 2008, at 9:52 PM, Tim Chevalier wrote: I'm no master, but I've never encountered a situation where strictness annotations would be useful as documentation, nor can I imagine one. I'm no master either, but how about these simple examples? data Stream a = Cons !a (Stream

Re: [haskell-cafe] Monad and kinds

2008-09-04 Thread Jake Mcarthur
On Sep 4, 2008, at 11:23 PM, Jake Mcarthur wrote: To quote a blog article[1] I wrote in June, And of course I would forget to link the article. My bad. [1] http://geekrant.wordpress.com/2008/06/23/misconceptions/ - Jake McArthur ___ Haskell-Cafe

Re: [haskell-cafe] Monad and kinds

2008-09-04 Thread Tim Chevalier
On 9/4/08, Jake Mcarthur [EMAIL PROTECTED] wrote: I'm no master either, but how about these simple examples? data Stream a = Cons !a (Stream a) data Vector3 a = Vector3 !a !a !a The compiler will certainly be able to infer the strictness itself in most uses, so obviously

Re: [haskell-cafe] Monad and kinds

2008-09-04 Thread Jake Mcarthur
On Sep 4, 2008, at 11:40 PM, Tim Chevalier wrote: But why not write your types like: data Stream a = Cons a Stream a data Vector3 a = Vector3 a a a in a hypothetical call-by-value language where the annotation denotes a lazily evaluated data structure? Does it matter? If it

Re: [haskell-cafe] Monad and kinds

2008-09-04 Thread John Dorsey
Tim Chevalier wrote: I'm no master, but I've never encountered a situation where strictness annotations would be useful as documentation, nor can I imagine one. That's because optimization *is* the only reason why programmers should care about strictness information. IMO, arguing that

Re: [haskell-cafe] Monad and kinds

2008-09-04 Thread Tim Chevalier
On 9/4/08, Jake Mcarthur [EMAIL PROTECTED] wrote: Two lazy algorithms tend to compose well and result in a lazy algorithm. A lazy algorithm can compose with a strict algorithm in two different ways. One way is for the lazy algorithm to control the strict algorithm, in which case the

Re: [haskell-cafe] Monad and kinds

2008-09-04 Thread Jake Mcarthur
On Sep 5, 2008, at 12:45 AM, Tim Chevalier wrote: On 9/4/08, Jake Mcarthur [EMAIL PROTECTED] wrote: Two lazy algorithms tend to compose well and result in a lazy algorithm. A lazy algorithm can compose with a strict algorithm in two different ways. One way is for the lazy algorithm to

Re: [haskell-cafe] Monad and kinds

2008-09-03 Thread Yitzchak Gale
Ramin wrote: ...no matter how many tutorials I read, I find the only kind of monad I can write is the monad that I copied and pasted from the tutorial... I am writing a mini-database... The query itself is stateful... The query may also make updates to the records. I also thought of trying

Re: [haskell-cafe] Monad and kinds

2008-09-03 Thread wren ng thornton
Ramin wrote: Hello, I'm new here, but in the short time I have known Haskell, I can already say it's my favorite computer language. Except for monads, and no matter how many tutorials I read, I find the only kind of monad I can write is the monad that I copied and pasted from the tutorial,

[haskell-cafe] Monad and kinds

2008-09-02 Thread Ramin
Hello, I'm new here, but in the short time I have known Haskell, I can already say it's my favorite computer language. Except for monads, and no matter how many tutorials I read, I find the only kind of monad I can write is the monad that I copied and pasted from the tutorial, i.e. I still

Re: [haskell-cafe] Monad and kinds

2008-09-02 Thread Jake Mcarthur
On Sep 2, 2008, at 8:34 AM, Ramin wrote: instance Monad Query where return (initState, someRecord) = Query (initState, someRecord) {- code for (=) -} GHC gives an error, Expected kind `* - *', but `Scanlist_ctrl' has kind `* - * - *' . I believe you understand the problem with

Re: [haskell-cafe] Monad and kinds

2008-09-02 Thread Daniel Fischer
Am Dienstag, 2. September 2008 15:34 schrieb Ramin: Hello, I'm new here, but in the short time I have known Haskell, I can already say it's my favorite computer language. Except for monads, and no matter how many tutorials I read, I find the only kind of monad I can write is the monad that I