4 class Collection col where
5 length :: col -> Integer
7 class (Collection col) => Sequence col el | col -> el where
9 fromList :: [el] -> col
11 iter :: (el -> <e> b) -> col -> <e> ()
12 any :: (el -> <e> Boolean) -> col -> <e> Boolean
13 all :: (el -> <e> Boolean) -> col -> <e> Boolean
14 mapFirst :: (el -> <e> Maybe b) -> col -> <e> Maybe b
15 findFirst :: (el -> <e> Boolean) -> col -> <e> Maybe el
16 firstIndex :: (el -> <e> Boolean) -> col -> <e> Integer
19 concatMap :: (a -> <e> [b]) -> [a] -> <e> [b]
20 map :: (a -> <e> b) -> [a] -> <e> [b]
21 filter :: (a -> <e> Boolean) -> [a] -> <e> [b]
22 mapMaybe :: (a -> <e> Maybe b) -> [a] -> <e> [b]
25 iterN :: (Integer -> <e> b) -> Integer -> <e> ()
26 anyN :: (Integer -> <e> Boolean) -> Integer -> <e> Boolean
27 allN :: (Integer -> <e> Boolean) -> Integer -> <e> Boolean
28 mapFirstN :: (Integer -> <e> Maybe b) -> Integer -> <e> Maybe b
29 concatMapN :: (Integer -> <e> [b]) -> Integer -> <e> [b]
30 mapN :: (Integer -> <e> b) -> Integer -> <e> [b]
31 filterN :: (Integer -> <e> Boolean) -> Integer -> <e> [Integer]
32 mapMaybeN :: (Integer -> <e> Maybe b) -> Integer -> <e> [b]
34 iterVector :: (a -> <e> b) -> Vector a -> <e> ()
35 anyVector :: (a -> <e> Boolean) -> Vector a -> <e> Boolean
36 allVector :: (a -> <e> Boolean) -> Vector a -> <e> Boolean
37 mapFirstVector :: (a -> <e> Maybe b) -> Vector a -> <e> Maybe b
38 concatMapVector :: (a -> <e> [b]) -> Vector a -> <e> Vector b
39 mapVector :: (a -> <e> b) -> Vector a -> <e> Vector b
40 filterVector :: (a -> <e> Boolean) -> Vector a -> <e> Vector b
41 mapMaybeVector :: (a -> <e> Maybe b) -> Vector a -> <e> Vector b
45 data [a] // Java: List<a>
46 data MList a // mutable, Java: List<a>
47 data Array a // Java: a[]
48 data MArray a // mutable, Java: a[]
49 data BoxedArray a // Java: Object[]
50 data List a = Nil | Cons a (List a)
51 type Vector = Array Double
54 data Set a // immutable set
55 data MSet a // Java: Set<a>
58 data Map a b // immutable map
59 data MMap a b // Java: Map<a>
66 class (Additive a a a) => Collection a where
70 class Foldable c v | c -> v where
71 foldl :: (a -> v -> a) -> a -> c -> a
73 class (Collection c) => Indexable c k v | c -> k v where
75 entriesOf :: c -> [(k,v)]
81 instance Indexable [a] Integer a
82 instance Indexable (Array a) Integer a
83 instance Indexable (BoxedArray a) Integer a
84 instance Indexable (List a) Integer a
85 instance Indexable (Map a b) a b