[Haskell] Re: RFC: DData in hierarchical libraries

Johannes Waldmann waldmann at imn.htwk-leipzig.de
Thu Mar 11 09:56:45 EST 2004


A few comments on the DData.Map proposal:

* nice work. I might start using it (instead of Data.FiniteMap)
   just because the function names look better :-)

* argument ordering:

   the existing Data.FiniteMap mostly has
       f :: FiniteMap -> ... -> FiniteMap
   while the proposal uses
       f :: ... -> FiniteMap -> FiniteMap
   I think the Edison guidelines are quite nice:
       http://www.haskell.org/ghc/docs/edison/users004.html#toc10
   Did you follow them? What exceptions?

* types: some functions are not declared at their most
   general type (I checked by commenting out the decl. and asking ghci)

difference :: forall a1 k a.
               (Ord k) =>
               Map k a1 -> Map k a -> Map k a1

differenceWithKey :: forall a1 k a.
                      (Ord k) =>
                      (k -> a1 -> a -> Maybe a1) -> Map k a1 -> Map k a
-> Map k a1

intersection :: forall a k a1.
                 (Ord k) =>
                 Map k a -> Map k a1 -> Map k a

intersectionWith :: forall a k a2 a1.
                     (Ord k) =>
                     (a1 -> a2 -> a) -> Map k a1 -> Map k a2 -> Map k a


intersectionWithKey :: forall a k a1 a2.
                        (Ord k) =>
                        (k -> a2 -> a1 -> a) -> Map k a2 -> Map k a1 -> 
Map k a

isSubsetOfBy :: forall a1 k a.
                 (Ord k) =>
                 (a -> a1 -> Bool) -> Map k a -> Map k a1 -> Bool


-- 
-- Johannes Waldmann,  Tel/Fax: (0341) 3076 6479 / 6480 --
------ http://www.imn.htwk-leipzig.de/~waldmann/ ---------



More information about the Haskell mailing list