7 class Collection a where
9 isEmpty :: a -> Boolean
10 iter :: (El a -> <e> dummy) -> a -> <e> ()
11 any :: (El a -> <e> Boolean) -> a -> <e> Boolean
12 all :: (El a -> <e> Boolean) -> a -> <e> Boolean
13 filter :: (El a -> <e> Boolean) -> a -> <e> a
14 partition :: (El a -> <e> Boolean) -> a -> <e> (a,a)
15 groupBy :: (El a -> b) -> [(b, a)]
16 uniqueElement :: a -> El a // may fail
17 fromList :: [El a] -> a
21 for :: a -> (El a -> <e> dummy) -> <e> ()
24 class (Collection a) => Sequence a where
26 (!) :: a -> Integer -> El a
27 sub :: a -> Integer -> Integer -> a
30 length :: a -> Integer
31 take :: Integer -> a -> a
32 drop :: Integer -> a -> a
34 mapFirst :: (El a -> <e> Maybe b) -> a -> <e> Maybe b
35 foldl :: (b -> El a -> <e> b) -> b -> a -> <e> b
36 foldr :: (El a -> b -> <e> b) -> b -> a -> <e> b
37 foldl1 :: (El a -> El a -> <e> El a) -> a -> <e> a
38 foldr1 :: (El a -> El a -> <e> El a) -> a -> <e> a
40 elem :: El a -> a -> Boolean
41 elemIndex :: El a -> a -> Maybe Integer
42 elemIndices :: El a -> a -> [Integer]
43 find :: (El a -> <e> Boolean) -> a -> <e> Maybe (El a)
44 findIndex :: (El a -> <e> Boolean) -> a -> <e> Maybe Integer
45 findIndices :: (El a -> <e> Boolean) -> a -> <e> [Integer]
46 mapS :: (El a -> <e> El a) -> a -> <e> a
47 singleton :: El a -> a
51 safeHead :: a -> Maybe (El a)
52 safeTail :: a -> Maybe a
56 sort :: Ord (El a) => a -> a
57 sortBy :: Ord b => (El a -> b) -> a -> a
59 mapN :: (Integer -> <e> El a) -> Integer -> <e> a
61 mapG :: Sequence b => (El b -> <e> El a) -> b -> <e> a
65 isEmpty c = length c == 0
67 drop n c = sub c n (length c)
68 iter f c = iterN (f . (c !)) (length c)
69 any f c = anyN (f . (c !)) (length c)
70 all f c = allN (f . (c !)) (length c)
71 mapFirst f c = mapFirstN (f . (c !)) (length c)
73 class (forall a. Sequence f a, Functor f) => GenericSequence f where
74 concatMap :: (a -> <e> f b) -> f a -> <e> f b
75 map :: (a -> <e> b) -> f a -> <e> f b
76 mapMaybe :: (a -> <e> Maybe b) -> f a -> <e> f b
80 intersection :: a -> a -> a