Prelude/ListCollection.ad

Outline

Content

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
module Prelude.ListCollection (
) where

{-# NoImplicitPrelude #-}

import Prelude.Eq
import Prelude.Bool
import Prelude.Maybe hiding (mapconstant `Prelude.Maybe.map`
   constant
   type `('a -> 'b) -> Maybe 'a -> Maybe 'b`
   executable)
import Prelude.Collection
import Prelude.List hiding (filterconstant `Prelude.List.filter`
   constant
   type `('a -> Bool) -> ['a] -> ['a]`
   executable, partitionconstant `Prelude.List.partition`
   constant
   type `('a -> Bool) -> ['a] -> (['a], ['a])`
   executable)
import qualified Prelude.List as List

instance Collectiontype-class `Prelude.Collection.Collection`
   arguments: ('c :: *) ('e :: *)
   functional deps: 'c -> 'e
   super-class constraints:
     - Prelude.BasicClasses.Monoid 'c ['etype-variable `'e`
   kind `*`] 'etype-variable `'e`
   kind `*` where
  define insertconstant `Prelude.Collection.insert`
   constant of type-class instance `Collection ['e] 'e`
   type `'e -> ['e] -> ['e]`
   executable := (:)constant `Prelude.List.(:)`
   constructor of datatype `List`
   type `'a -> ['a] -> ['a]`
   type in context `'e -> ['e] -> ['e]`
   executable
  {-# inline insertconstant `Prelude.Collection.insert`
   constant of type-class instance `Collection ['e] 'e`
   type `'e -> ['e] -> ['e]`
   executable #-}

  define fromListconstant `Prelude.Collection.fromList`
   constant of type-class instance `Collection ['e] 'e`
   type `['e] -> ['e]`
   executable lvariable `l`
   type `['e]` := lvariable `l`
   type `['e]`
  {-# inline fromListconstant `Prelude.Collection.fromList`
   constant of type-class instance `Collection ['e] 'e`
   type `['e] -> ['e]`
   executable #-}

  define non-exec isEmptyPconstant `Prelude.Collection.isEmptyP`
   constant of type-class instance `Collection ['e] 'e`
   type `['e] -> Prop`
   non-executable cvariable `c`
   type `['e]` := bool2propconstant `Prelude.Bool.bool2prop`
   constant
   type `Bool -> Prop`
   non-executable (nullconstant `Prelude.List.null`
   constant
   type `['a] -> Bool`
   type in context `['e] -> Bool`
   executable cvariable `c`
   type `['e]`)
  define non-exec memberPconstant `Prelude.Collection.memberP`
   constant of type-class instance `Collection ['e] 'e`
   type `EqP 'e => 'e -> ['e] -> Prop`
   non-executable := elemPconstant `Prelude.List.elemP`
   constant
   type `EqP 'a => 'a -> ['a] -> Prop`
   type in context `'e -> ['e] -> Prop`
   non-executable
  {-# inline memberPconstant `Prelude.Collection.memberP`
   constant of type-class instance `Collection ['e] 'e`
   type `EqP 'e => 'e -> ['e] -> Prop`
   non-executable #-}

end-instance

instance CollectionWithMembershipTesttype-class `Prelude.Collection.CollectionWithMembershipTest`
   arguments: ('c :: *) ('e :: *)
   functional deps: 'c -> 'e
   super-class constraints:
     - Prelude.Collection.Collection 'c 'e ['etype-variable `'e`
   kind `*`] 'etype-variable `'e`
   kind `*` where
  define occurconstant `Prelude.Collection.occur`
   constant of type-class instance `CollectionWithMembershipTest ['e] 'e`
   type `Eq 'e => 'e -> ['e] -> Prelude.Num.Natural`
   executable := countconstant `Prelude.List.count`
   constant
   type `Eq 'a => 'a -> ['a] -> Prelude.Num.Natural`
   type in context `'e -> ['e] -> Prelude.Num.Natural`
   executable
  {-# inline occurconstant `Prelude.Collection.occur`
   constant of type-class instance `CollectionWithMembershipTest ['e] 'e`
   type `Eq 'e => 'e -> ['e] -> Prelude.Num.Natural`
   executable #-}

  define memberconstant `Prelude.Collection.member`
   constant of type-class instance `CollectionWithMembershipTest ['e] 'e`
   type `Eq 'e => 'e -> ['e] -> Bool`
   executable := elemconstant `Prelude.List.elem`
   constant
   type `Eq 'a => 'a -> ['a] -> Bool`
   type in context `'e -> ['e] -> Bool`
   executable
  {-# inline memberconstant `Prelude.Collection.member`
   constant of type-class instance `CollectionWithMembershipTest ['e] 'e`
   type `Eq 'e => 'e -> ['e] -> Bool`
   executable #-}

end-instance

instance CollectionWithEmptynessTesttype-class `Prelude.Collection.CollectionWithEmptynessTest`
   arguments: ('c :: *) ('e :: *)
   functional deps: 'c -> 'e
   super-class constraints:
     - Prelude.Collection.Collection 'c 'e ['etype-variable `'e`
   kind `*`] 'etype-variable `'e`
   kind `*` where
  define isEmptyconstant `Prelude.Collection.isEmpty`
   constant of type-class instance `CollectionWithEmptynessTest ['e] 'e`
   type `['e] -> Bool`
   executable := nullconstant `Prelude.List.null`
   constant
   type `['a] -> Bool`
   type in context `['e] -> Bool`
   executable
  {-#  inline isEmptyconstant `Prelude.Collection.isEmpty`
   constant of type-class instance `CollectionWithEmptynessTest ['e] 'e`
   type `['e] -> Bool`
   executable #-}
end-instance


declare listIntersectionconstant `Prelude.ListCollection.listIntersection`
   constant
   type `Eq 'a => ['a] -> ['a] -> ['a]`
   executable :: Eqtype-class `Prelude.Eq.Eq`
   arguments: ('a :: *)
   super-class constraints:
     - Prelude.Eq.EqP 'a
   has default derive templates 'atype-variable `'a`
   kind `*` => ['atype-variable `'a`
   kind `*`] -> ['atype-variable `'a`
   kind `*`] -> ['atype-variable `'a`
   kind `*`]
define rec listIntersectionconstant `Prelude.ListCollection.listIntersection`
   constant
   type `Eq 'a => ['a] -> ['a] -> ['a]`
   executable [] _ := []
         | listIntersectionconstant `Prelude.ListCollection.listIntersection`
   constant
   type `Eq 'a => ['a] -> ['a] -> ['a]`
   executable _ [] := []
         | listIntersectionconstant `Prelude.ListCollection.listIntersection`
   constant
   type `Eq 'a => ['a] -> ['a] -> ['a]`
   executable (xvariable `x`
   type `'a`:constant `Prelude.List.(:)`
   constructor of datatype `List`
   type `'a -> ['a] -> ['a]`
   executablexsvariable `xs`
   type `['a]`) lvariable `l`
   type `['a]` :=
              case (takeFirstconstant `Prelude.List.takeFirst`
   constant
   type `('a -> Bool) -> ['a] -> Maybe (['a], 'a)`
   executable ((==)constant `Prelude.Eq.(==)`
   constant of type-class `Eq`
   type `'a -> 'a -> Bool`
   executable
   type-class instance from argument xvariable `x`
   type `'a`) lvariable `l`
   type `['a]`) of
                Nothingconstant `Prelude.Maybe.Nothing`
   constructor of datatype `Maybe`
   type `Maybe 'a`
   type in context `Maybe (['a], 'a)`
   executable -> listIntersectionconstant `Prelude.ListCollection.listIntersection` (recursive usage)
   constant
   type `Eq 'a => ['a] -> ['a] -> ['a]`
   executable xsvariable `xs`
   type `['a]` lvariable `l`
   type `['a]`
              | Justconstant `Prelude.Maybe.Just`
   constructor of datatype `Maybe`
   type `'a -> Maybe 'a`
   type in context `(['a], 'a) -> Maybe (['a], 'a)`
   executable (l'variable `l'`
   type `['a]`, _) -> xvariable `x`
   type `'a`:constant `Prelude.List.(:)`
   constructor of datatype `List`
   type `'a -> ['a] -> ['a]`
   executable(listIntersectionconstant `Prelude.ListCollection.listIntersection` (recursive usage)
   constant
   type `Eq 'a => ['a] -> ['a] -> ['a]`
   executable xsvariable `xs`
   type `['a]` l'variable `l'`
   type `['a]`)
              end

instance Eqtype-class `Prelude.Eq.Eq`
   arguments: ('a :: *)
   super-class constraints:
     - Prelude.Eq.EqP 'a
   has default derive templates 'etype-variable `'e`
   kind `*` => CollectionWithDeletetype-class `Prelude.Collection.CollectionWithDelete`
   arguments: ('c :: *) ('e :: *)
   functional deps: 'c -> 'e
   super-class constraints:
     - Prelude.Eq.Eq 'e
     - Prelude.Collection.CollectionWithMembershipTest 'c 'e ['etype-variable `'e`
   kind `*`] 'etype-variable `'e`
   kind `*` where
  define deleteconstant `Prelude.Collection.delete`
   constant of type-class instance `Eq 'e => CollectionWithDelete ['e] 'e`
   type `'e -> ['e] -> ['e]`
   executable evariable `e`
   type `'e` := removeFirstconstant `Prelude.List.removeFirst`
   constant
   type `('a -> Bool) -> ['a] -> ['a]`
   type in context `('e -> Bool) -> ['e] -> ['e]`
   executable ((==)constant `Prelude.Eq.(==)`
   constant of type-class `Eq`
   type `'a -> 'a -> Bool`
   type in context `'e -> 'e -> Bool`
   executable
   type-class instance from context evariable `e`
   type `'e`)
  {-# inline deleteconstant `Prelude.Collection.delete`
   constant of type-class instance `Eq 'e => CollectionWithDelete ['e] 'e`
   type `'e -> ['e] -> ['e]`
   executable #-}

  define filterconstant `Prelude.Collection.filter`
   constant of type-class instance `Eq 'e => CollectionWithDelete ['e] 'e`
   type `('e -> Bool) -> ['e] -> ['e]`
   executable := List.filterconstant `Prelude.List.filter`
   constant
   type `('a -> Bool) -> ['a] -> ['a]`
   type in context `('e -> Bool) -> ['e] -> ['e]`
   executable
  {-# inline filterconstant `Prelude.Collection.filter`
   constant of type-class instance `Eq 'e => CollectionWithDelete ['e] 'e`
   type `('e -> Bool) -> ['e] -> ['e]`
   executable #-}

  define partitionconstant `Prelude.Collection.partition`
   constant of type-class instance `Eq 'e => CollectionWithDelete ['e] 'e`
   type `('e -> Bool) -> ['e] -> (['e], ['e])`
   executable := List.partitionconstant `Prelude.List.partition`
   constant
   type `('a -> Bool) -> ['a] -> (['a], ['a])`
   type in context `('e -> Bool) -> ['e] -> (['e], ['e])`
   executable
  {-# inline partitionconstant `Prelude.Collection.partition`
   constant of type-class instance `Eq 'e => CollectionWithDelete ['e] 'e`
   type `('e -> Bool) -> ['e] -> (['e], ['e])`
   executable #-}

  define differenceconstant `Prelude.Collection.difference`
   constant of type-class instance `Eq 'e => CollectionWithDelete ['e] 'e`
   type `['e] -> ['e] -> ['e]`
   executable := foldlconstant `Prelude.List.foldl`
   constant
   type `('a -> 'b -> 'a) -> 'a -> ['b] -> 'a`
   type in context `(['e] -> 'e -> ['e]) -> ['e] -> ['e] -> ['e]`
   executable (fntype `['e] -> 'e -> ['e]` lvariable `l`
   type `['e]` evariable `e`
   type `'e` -> List.removeFirstconstant `Prelude.List.removeFirst`
   constant
   type `('a -> Bool) -> ['a] -> ['a]`
   type in context `('e -> Bool) -> ['e] -> ['e]`
   executable ((==)constant `Prelude.Eq.(==)`
   constant of type-class `Eq`
   type `'a -> 'a -> Bool`
   type in context `'e -> 'e -> Bool`
   executable
   type-class instance from context evariable `e`
   type `'e`) lvariable `l`
   type `['e]`)
  {-# inline differenceconstant `Prelude.Collection.difference`
   constant of type-class instance `Eq 'e => CollectionWithDelete ['e] 'e`
   type `['e] -> ['e] -> ['e]`
   executable #-}

  define intersectionconstant `Prelude.Collection.intersection`
   constant of type-class instance `Eq 'e => CollectionWithDelete ['e] 'e`
   type `['e] -> ['e] -> ['e]`
   executable := listIntersectionconstant `Prelude.ListCollection.listIntersection`
   constant
   type `Eq 'a => ['a] -> ['a] -> ['a]`
   type in context `['e] -> ['e] -> ['e]`
   executable
  {-# inline intersectionconstant `Prelude.Collection.intersection`
   constant of type-class instance `Eq 'e => CollectionWithDelete ['e] 'e`
   type `['e] -> ['e] -> ['e]`
   executable #-}
end-instance

instance FiniteCollectiontype-class `Prelude.Collection.FiniteCollection`
   arguments: ('c :: *) ('e :: *)
   functional deps: 'c -> 'e
   super-class constraints:
     - Prelude.Collection.CollectionWithMembershipTest 'c 'e
     - Prelude.Foldable.Foldable 'c 'e
     - Prelude.Collection.CollectionWithEmptynessTest 'c 'e ['etype-variable `'e`
   kind `*`] 'etype-variable `'e`
   kind `*` where
end-instance

end-moduleend of module Prelude.ListCollection