Changeset 2617 for src/Pugs/Junc.hs
- Timestamp:
- 05/02/05 13:20:40 (4 years ago)
- svk:copy_cache_prev:
- 4152
- Files:
-
- 1 modified
-
src/Pugs/Junc.hs (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Junc.hs
r2165 r2617 15 15 import qualified Data.Set as Set 16 16 17 -- |Construct a @none(...)@ junction from a list of values. 18 -- Delegates to 'opJunc'. 17 19 opJuncNone :: [Val] -> Val 18 20 opJuncNone = opJunc JNone 21 -- |Construct an @all(...)@ junction from a list of values. 22 -- Delegates to 'opJunc'. 19 23 opJuncAll :: [Val] -> Val 20 24 opJuncAll = opJunc JAll 25 -- |Construct a n@any(...)@ junction from a list of values. 26 -- Delegates to 'opJunc'. 21 27 opJuncAny :: [Val] -> Val 22 28 opJuncAny = opJunc JAny 29 -- |Construct a @one(...)@ junction from a list of values. 30 -- Handled differently! 23 31 opJuncOne :: [Val] -> Val 24 32 opJuncOne args = VJunc (Junc JOne dups vals) … … 28 36 groups = group $ sort args 29 37 38 -- |Construct a junction of the specified junctive type, containing all the 39 -- values in the list. 30 40 opJunc :: JuncType -> [Val] -> Val 31 41 opJunc t vals = VJunc $ Junc t Set.empty (joined `Set.union` Set.fromList vs) … … 36 46 sameType _ = False 37 47 38 juncTypeIs :: Val -> [JuncType] -> Maybe VJunc 48 -- |Check if the specified value is a 'VJunc' of one of the specified 49 -- junctive types. 50 juncTypeIs :: Val -- ^ Value to test 51 -> [JuncType] -- ^ Types to check against 52 -> Maybe VJunc -- ^ Returns 'Nothing' if the test fails 39 53 juncTypeIs v ts 40 54 | (VJunc j) <- v
