summaryrefslogtreecommitdiff
path: root/src/GF/Data
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2006-01-05 12:59:36 +0000
committerbringert <bringert@cs.chalmers.se>2006-01-05 12:59:36 +0000
commit5c0d9d52b3d502faf87377303bf06c6028e8612e (patch)
treec531abee2e52b5804bc1d706e1415b94e6331733 /src/GF/Data
parenta4ba93cc556dadc33ed95abd9baac0d29236bcfe (diff)
Print slf_graphviz with subgraphs.
Diffstat (limited to 'src/GF/Data')
-rw-r--r--src/GF/Data/Utilities.hs6
1 files changed, 6 insertions, 0 deletions
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.