[commit: containers] master: Improve documentation of strictness properties (6c64e68)
Ian Lynagh
igloo at earth.li
Thu Feb 23 01:13:16 CET 2012
Repository : ssh://darcs.haskell.org//srv/darcs/packages/containers
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/6c64e68de1aa1bc91abdc98857083b3887f777b3
>---------------------------------------------------------------
commit 6c64e68de1aa1bc91abdc98857083b3887f777b3
Author: Johan Tibell <johan.tibell at gmail.com>
Date: Fri Nov 18 08:40:06 2011 -0800
Improve documentation of strictness properties
>---------------------------------------------------------------
Data/Map/Strict.hs | 20 +++++++++++---------
1 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/Data/Map/Strict.hs b/Data/Map/Strict.hs
index c83d504..865066c 100644
--- a/Data/Map/Strict.hs
+++ b/Data/Map/Strict.hs
@@ -267,20 +267,22 @@ import Data.Map.Base hiding
-- $strictness
--
--- This module is strict in keys and values. In particular,
+-- This module satisfies the following properties:
--
--- * key and value arguments are evaluated to WHNF before the function
--- body is evaluated, and
+-- 1. Key and value arguments are evaluated to WHNF;
--
--- * keys and values returned by higher-order function arguments are
--- evaluated to WHNF before they are inserted into the map.
+-- 2. Keys and values are evaluated to WHNF before they are stored in
+-- the map.
--
--- Here are some examples:
+-- Here are some examples that illustrate the first property:
--
--- > insertWith (+) k undefined m == undefined
+-- > insertWith (\ old new -> old) k undefined m == undefined
-- > delete undefined m == undefined
--- > map (\ v -> undefined) == undefined
--- > mapKeys (\ k -> undefined) == undefined
+--
+-- Here are some examples that illustrate the second property:
+--
+-- > map (\ v -> undefined) m == undefined -- m is not empty
+-- > mapKeys (\ k -> undefined) m == undefined -- m is not empty
{--------------------------------------------------------------------
Query
More information about the Cvs-libraries
mailing list