Re: [Haskell-cafe] Documenting strictness properties for Data.Map.Strict

2011-11-18 Thread Roman Cheplyaka
* Johan Tibell johan.tib...@gmail.com [2011-11-17 21:21:47-0800] Hi all, Data.Map is getting split into Data.Map.Lazy and Data.Map.Strict (with Data.Map re-exporting the lazy API). I want to better document the strictness properties of the two new modules. Right now the documentation for

Re: [Haskell-cafe] Documenting strictness properties for Data.Map.Strict

2011-11-18 Thread Roman Leshchinskiy
Johan Tibell wrote: map (\ v - undefined)  ==  undefined mapKeys (\ k - undefined)  ==  undefined Not really related to the question but I don't really understand how these properties can possibly hold. Shouldn't it be: map (\v - undefined) x = undefined And even then, does

Re: [Haskell-cafe] Documenting strictness properties for Data.Map.Strict

2011-11-18 Thread Bas van Dijk
On 18 November 2011 06:44, Johan Tibell johan.tib...@gmail.com wrote: Here are some examples:    insertWith (+) k undefined m  ==  undefined    delete undefined m  ==  undefined    map (\ v - undefined)  ==  undefined    mapKeys (\ k - undefined)  ==  undefined Any ideas for further

Re: [Haskell-cafe] Documenting strictness properties for Data.Map.Strict

2011-11-18 Thread Twan van Laarhoven
On 18/11/11 06:44, Johan Tibell wrote: On Thu, Nov 17, 2011 at 9:21 PM, Johan Tibelljohan.tib...@gmail.com wrote: I'm not entirely happy with this formulation. I'm looking for something that's clear (i.e. precise and concise, without leaving out important information), assuming that the reader

Re: [Haskell-cafe] Documenting strictness properties for Data.Map.Strict

2011-11-18 Thread Johan Tibell
On Fri, Nov 18, 2011 at 12:09 AM, Roman Cheplyaka r...@ro-che.info wrote: Is it mentioned anywhere that Map is spine-strict? It's not and we should probably mention it. I was mulling this over last night. My initial thought was that it shouldn't matter as long as the algorithmic complexity of

Re: [Haskell-cafe] Documenting strictness properties for Data.Map.Strict

2011-11-18 Thread Johan Tibell
On Fri, Nov 18, 2011 at 1:58 AM, Roman Leshchinskiy r...@cse.unsw.edu.au wrote: Johan Tibell wrote:       map (\ v - undefined)  ==  undefined       mapKeys (\ k - undefined)  ==  undefined Not really related to the question but I don't really understand how these properties can possibly

Re: [Haskell-cafe] Documenting strictness properties for Data.Map.Strict

2011-11-18 Thread Johan Tibell
On Fri, Nov 18, 2011 at 5:02 AM, Twan van Laarhoven twa...@gmail.com wrote: * key and value function arguments passed to functions are  evaluated to WHNF before the function body is evaluated, and function arguments passed to functions sounds a bit redundant. Either say arguments passed to

Re: [Haskell-cafe] Documenting strictness properties for Data.Map.Strict

2011-11-18 Thread Johan Tibell
Here's an attempt at an improved version: Strictness properties = This module satisfies the following properties: 1. Key and value arguments are evaluated to WHNF; 2. Keys and values are evaluated to WHNF before they are stored in the map. Here are some examples that

Re: [Haskell-cafe] Documenting strictness properties for Data.Map.Strict

2011-11-18 Thread Roman Cheplyaka
* Johan Tibell johan.tib...@gmail.com [2011-11-18 08:06:29-0800] On Fri, Nov 18, 2011 at 12:09 AM, Roman Cheplyaka r...@ro-che.info wrote: Is it mentioned anywhere that Map is spine-strict? It's not and we should probably mention it. Hm. Perhaps I'm missing something, but data Map k a =

Re: [Haskell-cafe] Documenting strictness properties for Data.Map.Strict

2011-11-18 Thread Brandon Allbery
On Fri, Nov 18, 2011 at 12:16, Roman Cheplyaka r...@ro-che.info wrote: * Johan Tibell johan.tib...@gmail.com [2011-11-18 08:06:29-0800] On Fri, Nov 18, 2011 at 12:09 AM, Roman Cheplyaka r...@ro-che.info wrote: Is it mentioned anywhere that Map is spine-strict? It's not and we should

Re: [Haskell-cafe] Documenting strictness properties for Data.Map.Strict

2011-11-18 Thread Roman Cheplyaka
* Brandon Allbery allber...@gmail.com [2011-11-18 12:20:33-0500] On Fri, Nov 18, 2011 at 12:16, Roman Cheplyaka r...@ro-che.info wrote: * Johan Tibell johan.tib...@gmail.com [2011-11-18 08:06:29-0800] On Fri, Nov 18, 2011 at 12:09 AM, Roman Cheplyaka r...@ro-che.info wrote: Is it

Re: [Haskell-cafe] Documenting strictness properties for Data.Map.Strict

2011-11-18 Thread Johan Tibell
On Fri, Nov 18, 2011 at 9:16 AM, Roman Cheplyaka r...@ro-che.info wrote: * Johan Tibell johan.tib...@gmail.com [2011-11-18 08:06:29-0800] On Fri, Nov 18, 2011 at 12:09 AM, Roman Cheplyaka r...@ro-che.info wrote: Is it mentioned anywhere that Map is spine-strict? It's not and we should

Re: [Haskell-cafe] Documenting strictness properties for Data.Map.Strict

2011-11-18 Thread Henk-Jan van Tuyl
On Fri, 18 Nov 2011 06:58:41 +0100, Evan Laforge qdun...@gmail.com wrote: Any ideas for further improvements? I feel like there should be a canonical what is WHNF page on haskell.org that docs like this can link to. Namely, what it is theoretically, what that means for various examples of

[Haskell-cafe] Documenting strictness properties for Data.Map.Strict

2011-11-17 Thread Johan Tibell
Hi all, Data.Map is getting split into Data.Map.Lazy and Data.Map.Strict (with Data.Map re-exporting the lazy API). I want to better document the strictness properties of the two new modules. Right now the documentation for Data.Map.Strict reads: Strictness properties = *

Re: [Haskell-cafe] Documenting strictness properties for Data.Map.Strict

2011-11-17 Thread Johan Tibell
On Thu, Nov 17, 2011 at 9:21 PM, Johan Tibell johan.tib...@gmail.com wrote: I'm not entirely happy with this formulation. I'm looking for something that's clear (i.e. precise and concise, without leaving out important information), assuming that the reader already knows how lazy evaluation

Re: [Haskell-cafe] Documenting strictness properties for Data.Map.Strict

2011-11-17 Thread Ivan Lazar Miljenovic
On 18 November 2011 16:44, Johan Tibell johan.tib...@gmail.com wrote: On Thu, Nov 17, 2011 at 9:21 PM, Johan Tibell johan.tib...@gmail.com wrote: I'm not entirely happy with this formulation. I'm looking for something that's clear (i.e. precise and concise, without leaving out important

Re: [Haskell-cafe] Documenting strictness properties for Data.Map.Strict

2011-11-17 Thread Evan Laforge
Any ideas for further improvements? I feel like there should be a canonical what is WHNF page on haskell.org that docs like this can link to. Namely, what it is theoretically, what that means for various examples of thunks (i.e. show how a sample graph would get reduced), and what that means