Repository : ssh://darcs.haskell.org//srv/darcs/ghc On branch : master
http://hackage.haskell.org/trac/ghc/changeset/585ff572a1a2b755a3d9a94700859795f62a2e87 >--------------------------------------------------------------- commit 585ff572a1a2b755a3d9a94700859795f62a2e87 Author: Ian Lynagh <[email protected]> Date: Fri Jun 22 20:27:08 2012 +0100 Remove some more unused functions >--------------------------------------------------------------- compiler/utils/ListSetOps.lhs | 28 ---------------------------- 1 files changed, 0 insertions(+), 28 deletions(-) diff --git a/compiler/utils/ListSetOps.lhs b/compiler/utils/ListSetOps.lhs index 2f972a5..930e57d 100644 --- a/compiler/utils/ListSetOps.lhs +++ b/compiler/utils/ListSetOps.lhs @@ -11,7 +11,6 @@ module ListSetOps ( -- Association lists Assoc, assoc, assocMaybe, assocUsing, assocDefault, assocDefaultUsing, - mkLookupFun, findInList, assocElts, -- Duplicate handling hasNoDups, runs, removeDups, findDupsEq, @@ -66,15 +65,12 @@ Inefficient finite maps based on association lists and equality. -- A finite mapping based on equality and association lists type Assoc a b = [(a,b)] -assocElts :: Assoc a b -> [(a,b)] assoc :: (Eq a) => String -> Assoc a b -> a -> b assocDefault :: (Eq a) => b -> Assoc a b -> a -> b assocUsing :: (a -> a -> Bool) -> String -> Assoc a b -> a -> b assocMaybe :: (Eq a) => Assoc a b -> a -> Maybe b assocDefaultUsing :: (a -> a -> Bool) -> b -> Assoc a b -> a -> b -assocElts xs = xs - assocDefaultUsing _ deflt [] _ = deflt assocDefaultUsing eq deflt ((k,v) : rest) key | k `eq` key = v @@ -91,30 +87,6 @@ assocMaybe alist key lookup ((tv,ty):rest) = if key == tv then Just ty else lookup rest \end{code} - -@mkLookupFun eq alist@ is a function which looks up -its argument in the association list @alist@, returning a Maybe type. -@mkLookupFunDef@ is similar except that it is given a value to return -on failure. - -\begin{code} -mkLookupFun :: (key -> key -> Bool) -- Equality predicate - -> [(key,val)] -- The assoc list - -> key -- The key - -> Maybe val -- The corresponding value - -mkLookupFun eq alist s - = case [a | (s',a) <- alist, s' `eq` s] of - [] -> Nothing - (a:_) -> Just a - -findInList :: (a -> Bool) -> [a] -> Maybe a -findInList _ [] = Nothing -findInList p (x:xs) | p x = Just x - | otherwise = findInList p xs -\end{code} - - %************************************************************************ %* * \subsection[Utils-dups]{Duplicate-handling} _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
