From 5c0d9d52b3d502faf87377303bf06c6028e8612e Mon Sep 17 00:00:00 2001 From: bringert Date: Thu, 5 Jan 2006 12:59:36 +0000 Subject: Print slf_graphviz with subgraphs. --- src/GF/Data/Utilities.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/GF/Data') diff --git a/src/GF/Data/Utilities.hs b/src/GF/Data/Utilities.hs index 50d1f5195..a5ceb08d2 100644 --- a/src/GF/Data/Utilities.hs +++ b/src/GF/Data/Utilities.hs @@ -88,6 +88,12 @@ lookup' x = fromJust . lookup x find' :: (a -> Bool) -> [a] -> a find' p = fromJust . find p +-- | Set a value in a lookup table. +tableSet :: Eq a => a -> b -> [(a,b)] -> [(a,b)] +tableSet x y [] = [(x,y)] +tableSet x y (p@(x',_):xs) | x' == x = (x,y):xs + | otherwise = p:tableSet x y xs + -- * equality functions -- | Use an ordering function as an equality predicate. -- cgit v1.2.3