From: ross Date: Thu, 13 Jan 2005 13:31:11 +0000 (+0000) Subject: [project @ 2005-01-13 13:31:09 by ross] X-Git-Tag: nhc98-1-18-release~114 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=faa067c418ce36f4cb4e54e2fb19012736ef49ed;p=ghc-base.git [project @ 2005-01-13 13:31:09 by ross] adjust module header comments (the bit about imports still sounds wierd) --- diff --git a/Data/IntMap.hs b/Data/IntMap.hs index 2562c2e..cd3c2f9 100644 --- a/Data/IntMap.hs +++ b/Data/IntMap.hs @@ -1,35 +1,39 @@ {-# OPTIONS -cpp -fglasgow-exts #-} --------------------------------------------------------------------------------- -{-| Module : Data.IntMap - Copyright : (c) Daan Leijen 2002 - License : BSD-style - Maintainer : libraries@haskell.org - Stability : provisional - Portability : portable - - An efficient implementation of maps from integer keys to values. - - This module is intended to be imported @qualified@, to avoid name - clashes with Prelude functions. eg. - - > import Data.IntMap as Map - - The implementation is based on /big-endian patricia trees/. This data structure - performs especially well on binary operations like 'union' and 'intersection'. However, - my benchmarks show that it is also (much) faster on insertions and deletions when - compared to a generic size-balanced map implementation (see "Map" and "Data.FiniteMap"). - - * Chris Okasaki and Andy Gill, \"/Fast Mergeable Integer Maps/\", - Workshop on ML, September 1998, pages 77--86, - - * D.R. Morrison, \"/PATRICIA -- Practical Algorithm To Retrieve Information - Coded In Alphanumeric/\", Journal of the ACM, 15(4), October 1968, pages 514--534. +----------------------------------------------------------------------------- +-- Module : Data.IntMap +-- Copyright : (c) Daan Leijen 2002 +-- License : BSD-style +-- Maintainer : libraries@haskell.org +-- Stability : provisional +-- Portability : portable +-- +-- An efficient implementation of maps from integer keys to values. +-- +-- This module is intended to be imported @qualified@, to avoid name +-- clashes with "Prelude" functions. eg. +-- +-- > import Data.IntMap as Map +-- +-- The implementation is based on /big-endian patricia trees/. This data +-- structure performs especially well on binary operations like 'union' +-- and 'intersection'. However, my benchmarks show that it is also +-- (much) faster on insertions and deletions when compared to a generic +-- size-balanced map implementation (see "Data.Map" and "Data.FiniteMap"). +-- +-- * Chris Okasaki and Andy Gill, \"/Fast Mergeable Integer Maps/\", +-- Workshop on ML, September 1998, pages 77-86, +-- +-- +-- * D.R. Morrison, \"/PATRICIA -- Practical Algorithm To Retrieve +-- Information Coded In Alphanumeric/\", Journal of the ACM, 15(4), +-- October 1968, pages 514-534. +-- +-- Many operations have a worst-case complexity of /O(min(n,W))/. +-- This means that the operation can become linear in the number of +-- elements with a maximum of /W/ -- the number of bits in an 'Int' +-- (32 or 64). +----------------------------------------------------------------------------- - Many operations have a worst-case complexity of /O(min(n,W))/. This means that the - operation can become linear in the number of elements - with a maximum of /W/ -- the number of bits in an 'Int' (32 or 64). --} ---------------------------------------------------------------------------------- module Data.IntMap ( -- * Map type IntMap, Key -- instance Eq,Show diff --git a/Data/IntSet.hs b/Data/IntSet.hs index 3e940f7..90b9bd9 100644 --- a/Data/IntSet.hs +++ b/Data/IntSet.hs @@ -1,35 +1,40 @@ {-# OPTIONS -cpp -fglasgow-exts #-} --------------------------------------------------------------------------------- -{-| Module : Data.IntSet - Copyright : (c) Daan Leijen 2002 - License : BSD-style - Maintainer : libraries@haskell.org - Stability : provisional - Portability : portable - - An efficient implementation of integer sets. - - This module is intended to be imported @qualified@, to avoid name - clashes with Prelude functions. eg. - - > import Data.IntSet as Set - - The implementation is based on /big-endian patricia trees/. This data structure - performs especially well on binary operations like 'union' and 'intersection'. However, - my benchmarks show that it is also (much) faster on insertions and deletions when - compared to a generic size-balanced set implementation (see "Set"). - - * Chris Okasaki and Andy Gill, \"/Fast Mergeable Integer Maps/\", - Workshop on ML, September 1998, pages 77--86, - - * D.R. Morrison, \"/PATRICIA -- Practical Algorithm To Retrieve Information - Coded In Alphanumeric/\", Journal of the ACM, 15(4), October 1968, pages 514--534. +----------------------------------------------------------------------------- +-- | +-- Module : Data.IntSet +-- Copyright : (c) Daan Leijen 2002 +-- License : BSD-style +-- Maintainer : libraries@haskell.org +-- Stability : provisional +-- Portability : portable +-- +-- An efficient implementation of integer sets. +-- +-- This module is intended to be imported @qualified@, to avoid name +-- clashes with "Prelude" functions. eg. +-- +-- > import Data.IntSet as Set +-- +-- The implementation is based on /big-endian patricia trees/. This data +-- structure performs especially well on binary operations like 'union' +-- and 'intersection'. However, my benchmarks show that it is also +-- (much) faster on insertions and deletions when compared to a generic +-- size-balanced set implementation (see "Data.Set"). +-- +-- * Chris Okasaki and Andy Gill, \"/Fast Mergeable Integer Maps/\", +-- Workshop on ML, September 1998, pages 77-86, +-- +-- +-- * D.R. Morrison, \"/PATRICIA -- Practical Algorithm To Retrieve +-- Information Coded In Alphanumeric/\", Journal of the ACM, 15(4), +-- October 1968, pages 514-534. +-- +-- Many operations have a worst-case complexity of /O(min(n,W))/. +-- This means that the operation can become linear in the number of +-- elements with a maximum of /W/ -- the number of bits in an 'Int' +-- (32 or 64). +----------------------------------------------------------------------------- - Many operations have a worst-case complexity of /O(min(n,W))/. This means that the - operation can become linear in the number of elements - with a maximum of /W/ -- the number of bits in an 'Int' (32 or 64). --} ----------------------------------------------------------------------------------} module Data.IntSet ( -- * Set type IntSet -- instance Eq,Show diff --git a/Data/Map.hs b/Data/Map.hs index e2dd0b6..2451016 100644 --- a/Data/Map.hs +++ b/Data/Map.hs @@ -1,28 +1,31 @@ --------------------------------------------------------------------------------- -{-| Module : Data.Map - Copyright : (c) Daan Leijen 2002 - License : BSD-style - Maintainer : libraries@haskell.org - Stability : provisional - Portability : portable - - An efficient implementation of maps from keys to values (dictionaries). - - This module is intended to be imported @qualified@, to avoid name - clashes with Prelude functions. eg. - - > import Data.Map as Map - - The implementation of "Map" is based on /size balanced/ binary trees (or - trees of /bounded balance/) as described by: - - * Stephen Adams, \"/Efficient sets: a balancing act/\", Journal of Functional - Programming 3(4):553-562, October 1993, . +----------------------------------------------------------------------------- +-- | +-- Module : Data.Map +-- Copyright : (c) Daan Leijen 2002 +-- License : BSD-style +-- Maintainer : libraries@haskell.org +-- Stability : provisional +-- Portability : portable +-- +-- An efficient implementation of maps from keys to values (dictionaries). +-- +-- This module is intended to be imported @qualified@, to avoid name +-- clashes with Prelude functions. eg. +-- +-- > import Data.Map as Map +-- +-- The implementation of 'Map' is based on /size balanced/ binary trees (or +-- trees of /bounded balance/) as described by: +-- +-- * Stephen Adams, \"/Efficient sets: a balancing act/\", +-- Journal of Functional Programming 3(4):553-562, October 1993, +-- . +-- +-- * J. Nievergelt and E.M. Reingold, +-- \"/Binary search trees of bounded balance/\", +-- SIAM journal of computing 2(1), March 1973. +----------------------------------------------------------------------------- - * J. Nievergelt and E.M. Reingold, \"/Binary search trees of bounded balance/\", - SIAM journal of computing 2(1), March 1973. --} ----------------------------------------------------------------------------------- module Data.Map ( -- * Map type Map -- instance Eq,Show diff --git a/Data/Set.hs b/Data/Set.hs index e515667..8b852ed 100644 --- a/Data/Set.hs +++ b/Data/Set.hs @@ -1,33 +1,37 @@ -{-| Module : Data.Set - Copyright : (c) Daan Leijen 2002 - License : BSD-style - Maintainer : libraries@haskell.org - Stability : provisional - Portability : portable - - An efficient implementation of sets. - - This module is intended to be imported @qualified@, to avoid name - clashes with Prelude functions. eg. - - > import Data.Set as Set - - The implementation of "Set" is based on /size balanced/ binary trees (or - trees of /bounded balance/) as described by: - - * Stephen Adams, \"/Efficient sets: a balancing act/\", Journal of Functional - Programming 3(4):553-562, October 1993, . - - * J. Nievergelt and E.M. Reingold, \"/Binary search trees of bounded balance/\", - SIAM journal of computing 2(1), March 1973. +----------------------------------------------------------------------------- +-- | +-- Module : Data.Set +-- Copyright : (c) Daan Leijen 2002 +-- License : BSD-style +-- Maintainer : libraries@haskell.org +-- Stability : provisional +-- Portability : portable +-- +-- An efficient implementation of sets. +-- +-- This module is intended to be imported @qualified@, to avoid name +-- clashes with "Prelude" functions. eg. +-- +-- > import Data.Set as Set +-- +-- The implementation of 'Set' is based on /size balanced/ binary trees (or +-- trees of /bounded balance/) as described by: +-- +-- * Stephen Adams, \"/Efficient sets: a balancing act/\", +-- Journal of Functional Programming 3(4):553-562, October 1993, +-- . +-- +-- * J. Nievergelt and E.M. Reingold, +-- \"/Binary search trees of bounded balance/\", +-- SIAM journal of computing 2(1), March 1973. +-- +-- Note that the implementation is /left-biased/ -- the elements of a +-- first argument are always perferred to the second, for example in +-- 'union' or 'insert'. Of course, left-biasing can only be observed +-- when equality is an equivalence relation instead of structural +-- equality. +----------------------------------------------------------------------------- - Note that the implementation is /left-biased/ -- the elements of a - first argument are always perferred to the second, for example in - 'union' or 'insert'. Of course, left-biasing can only be observed - when equality an equivalence relation instead of structural - equality. --} ---------------------------------------------------------------------------------- module Data.Set ( -- * Set type Set -- instance Eq,Show