From 9bb01bfc3892f545162806e88daf9a0d6c28c8f7 Mon Sep 17 00:00:00 2001 From: bringert Date: Thu, 22 Sep 2005 15:56:05 +0000 Subject: Generated finite state networks are now state minimal. --- src/GF/Data/Utilities.hs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/GF/Data') diff --git a/src/GF/Data/Utilities.hs b/src/GF/Data/Utilities.hs index 7bc5040fd..fbe6c6a27 100644 --- a/src/GF/Data/Utilities.hs +++ b/src/GF/Data/Utilities.hs @@ -4,9 +4,9 @@ -- Stability : (stable) -- Portability : (portable) -- --- > CVS $Date: 2005/09/14 18:00:19 $ +-- > CVS $Date: 2005/09/22 16:56:05 $ -- > CVS $Author: bringert $ --- > CVS $Revision: 1.4 $ +-- > CVS $Revision: 1.5 $ -- -- Basic functions not in the standard libraries ----------------------------------------------------------------------------- @@ -80,11 +80,15 @@ sortNub = map head . group . sort unionAll :: Eq a => [[a]] -> [a] unionAll = nub . concat --- | Like lookup, but fails if the argument is not found, +-- | Like 'lookup', but fails if the argument is not found, -- instead of returning Nothing. lookup' :: Eq a => a -> [(a,b)] -> b lookup' x = fromJust . lookup x +-- | Like 'find', but fails if nothing is found. +find' :: (a -> Bool) -> [a] -> a +find' p = fromJust . find p + -- * ordering functions compareBy :: Ord b => (a -> b) -> a -> a -> Ordering -- cgit v1.2.3