total-map 0.0.5 → 0.0.6
raw patch · 2 files changed
+8/−4 lines, 2 files
Files
- src/Data/TotalMap.hs +5/−1
- total-map.cabal +3/−3
src/Data/TotalMap.hs view
@@ -12,7 +12,7 @@ -- a default value. Has Applicative and Monad instances (unlike "Data.Map"). ---------------------------------------------------------------------- -module Data.TotalMap (TMap,fromPartial,(!),tabulate,trim,intersectionPartialWith) where+module Data.TotalMap (TMap,fromPartial,(!),tabulate,trim,intersectionPartialWith,codomain) where import Data.Monoid (Monoid(..),(<>)) import Control.Applicative (Applicative(..),liftA2,(<$>))@@ -62,6 +62,10 @@ M.intersectionWith f am bm `M.union` fmap (f ad) bm++-- | Witness the finiteness of the support concretely by giving its image.+codomain :: Ord v => TMap k v -> Set v+codomain (TMap dflt m) = S.fromList (dflt : M.elems m) {-------------------------------------------------------------------- Instances
total-map.cabal view
@@ -1,11 +1,11 @@ Name: total-map-Version: 0.0.5+Version: 0.0.6 Cabal-Version: >= 1.6 Synopsis: Finitely represented /total/ maps Category: Data Description:- Finitely represented /total/ maps. Represented by as a partial map and a default value.- Has Applicative and Monad instances (unlike Data.Map).+ Finitely represented /total/ maps. Represented by as a partial map and+ a default value. Has Applicative and Monad instances (unlike Data.Map). Author: Conal Elliott Maintainer: conal@conal.net Copyright: (c) 2012 by Conal Elliott