{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# OPTIONS_GHC -Wno-orphans #-}
module Test.Control.Iterate.SetAlgebra (setAlgTest) where
import Control.Iterate.BaseTypes (List (..), Sett (..), fromPairs)
import Control.Iterate.Collect (Collect (runCollect), one, when)
import Control.Iterate.Exp (Exp (..), Query (..), domElem, lift, rngSnd)
import Control.Iterate.SetAlgebra (
compute,
domEq,
fifo,
lifo,
runBool,
runSet,
sameDomain,
)
import Control.SetAlgebra (
BaseRep (ListR, MapR, SetR, SingleR),
Iter (element),
Single (Fail),
dom,
eval,
fromList,
keysEqual,
materialize,
rng,
setSingleton,
singleton,
(∈),
(∉),
(∪),
(≍),
(⋪),
(⋫),
(▷),
(◁),
(➖),
)
import Data.Char (ord)
import Data.Map.Strict (Map)
import qualified Data.Map.Strict as Map
import Data.MapExtras (intersectDomP, intersectDomPLeft)
import qualified Data.Set as Set
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.HUnit (assertEqual, testCase)
import Test.Tasty.QuickCheck (
Arbitrary (arbitrary),
Gen,
Property,
choose,
conjoin,
counterexample,
frequency,
testProperty,
vectorOf,
(===),
)
stkcred :: Map Int [Char]
deleg :: Map Int Char
stpool :: Map Char Int
stkcred :: Map Int String
stkcred = forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
5, String
"a"), (Int
6, String
"q"), (Int
12, String
"r")]
deleg :: Map Int Char
deleg = forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
n, String
chars forall a. [a] -> Int -> a
!! Int
n) | Int
n <- [Int
1 .. Int
10]]
stpool :: Map Char Int
stpool = forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Char
'A', Int
99), (Char
'C', Int
12), (Char
'F', Int
42), (Char
'R', Int
33), (Char
'Z', Int
99)]
chars :: String
chars :: String
chars = String
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdeghijklmnopqrstuvwxyz0123456789"
m0 :: Map.Map Int Char
m0 :: Map Int Char
m0 = forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
1, Char
'a'), (Int
2, Char
'z'), (Int
4, Char
'g')]
m12 :: Map.Map Int Char
m12 :: Map Int Char
m12 = forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
n, String
chars forall a. [a] -> Int -> a
!! Int
n) | Int
n <- [Int
0 .. forall (t :: * -> *) a. Foldable t => t a -> Int
length String
chars forall a. Num a => a -> a -> a
- Int
1]]
l1, l2 :: [(Int, String)]
l1 :: [(Int, String)]
l1 = [(Int
1, String
"a"), (Int
4, String
"d"), (Int
5, String
"e"), (Int
10, String
"j"), (Int
12, String
"l"), (Int
21, String
"v"), (Int
26, String
"z")]
l2 :: [(Int, String)]
l2 = [(Int
3, String
"c"), (Int
4, String
"d"), (Int
5, String
"e"), (Int
6, String
"f"), (Int
10, String
"j"), (Int
11, String
"k"), (Int
21, String
"v")]
l3 :: [(Int, Int)]
l3 :: [(Int, Int)]
l3 = [(Int
4, Int
12), (Int
9, Int
13), (Int
12, Int
44), (Int
55, Int
22)]
evens :: Sett Int ()
evens :: Sett Int ()
evens = forall k (f :: * -> * -> *) v.
Ord k =>
BaseRep f k v -> (v -> v -> v) -> [(k, v)] -> f k v
fromList forall k. Basic Sett => BaseRep Sett k ()
SetR (\()
l ()
_r -> ()
l) [(Int
n, ()) | Int
n <- [Int
2, Int
4, Int
6, Int
8, Int
10, Int
12, Int
14, Int
16, Int
18, Int
20, Int
22, Int
24, Int
26]]
l4 :: [(Int, String)]
l4 :: [(Int, String)]
l4 =
[ (Int
1, String
"m")
, (Int
2, String
"a")
, (Int
5, String
"z")
, (Int
6, String
"b")
, (Int
7, String
"r")
, (Int
12, String
"w")
, (Int
34, String
"v")
, (Int
50, String
"q")
, (Int
51, String
"l")
, (Int
105, String
"Z")
]
l5 :: [(String, Int)]
l5 :: [(String, Int)]
l5 =
[ (String
"a", Int
101)
, (String
"b", Int
102)
, (String
"c", Int
103)
, (String
"f", Int
104)
, (String
"m", Int
105)
, (String
"q", Int
107)
, (String
"s", Int
106)
, (String
"w", Int
108)
, (String
"y", Int
109)
, (String
"zz", Int
110)
]
z1 :: Map Int String
z1 :: Map Int String
z1 = forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
3, String
"c"), (Int
4, String
"d"), (Int
5, String
"e"), (Int
6, String
"f"), (Int
10, String
"j"), (Int
11, String
"k"), (Int
21, String
"v")]
z2 :: Set.Set Int
z2 :: Set Int
z2 = forall a. Ord a => [a] -> Set a
Set.fromList [Int
4, Int
6, Int
11, Int
13, Int
2]
z3 :: Map Int String
z3 :: Map Int String
z3 = forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
9, String
"3"), (Int
10, String
"j"), (Int
30, String
"a")]
z4 :: Map Int String
z4 :: Map Int String
z4 = forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
3, String
"c"), (Int
5, String
"e"), (Int
10, String
"j"), (Int
21, String
"v"), (Int
9, String
"3"), (Int
30, String
"a")]
evalTest :: (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest :: forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
nm Exp t
expr t
ans = String -> Assertion -> TestTree
testCase String
name (forall a.
(Eq a, Show a, HasCallStack) =>
String -> a -> a -> Assertion
assertEqual String
name (forall t. Exp t -> t
compute Exp t
expr) t
ans)
where
name :: String
name = (forall a. Show a => a -> String
show Exp t
expr forall a. [a] -> [a] -> [a]
++ String
" where Map? = " forall a. [a] -> [a] -> [a]
++ String
nm)
evalCompile :: (Show (f k v), Ord k, Eq (f k v)) => Exp (f k v) -> TestTree
evalCompile :: forall (f :: * -> * -> *) k v.
(Show (f k v), Ord k, Eq (f k v)) =>
Exp (f k v) -> TestTree
evalCompile Exp (f k v)
expr = String -> Assertion -> TestTree
testCase String
name (forall a.
(Eq a, Show a, HasCallStack) =>
String -> a -> a -> Assertion
assertEqual String
name (forall t. Exp t -> t
compute Exp (f k v)
expr) (forall k (f :: * -> * -> *) v. Ord k => Exp (f k v) -> f k v
runSet Exp (f k v)
expr))
where
name :: String
name = (String
"compute and runSet of " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show Exp (f k v)
expr forall a. [a] -> [a] -> [a]
++ String
" are the same")
evalTests :: TestTree
evalTests :: TestTree
evalTests =
String -> [TestTree] -> TestTree
testGroup
String
"eval tests"
[ forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"m12" (Int
5 forall k (g :: * -> * -> *) s.
(Show k, Ord k, Iter g, HasExp s (g k ())) =>
k -> s -> Exp Bool
∈ (forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom Map Int Char
m12)) Bool
True
, forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"m12" (Int
70 forall k (g :: * -> * -> *) s.
(Show k, Ord k, Iter g, HasExp s (g k ())) =>
k -> s -> Exp Bool
∈ (forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom Map Int Char
m12)) Bool
False
, forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"m0" (Map Int Char
m0 forall k v s1 (f :: * -> * -> *) s2 (g :: * -> * -> *).
(Show k, Show v, Ord k, HasExp s1 (f k v), HasExp s2 (g k v)) =>
s1 -> s2 -> Exp (f k v)
∪ (forall k v. Ord k => k -> v -> Exp (Single k v)
singleton Int
3 Char
'b')) (forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
1, Char
'a'), (Int
2, Char
'z'), (Int
3, Char
'b'), (Int
4, Char
'g')])
, forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"m0" ((forall k. Ord k => k -> Exp (Single k ())
setSingleton Int
2) forall k (g :: * -> * -> *) s1 s2 (f :: * -> * -> *) v.
(Ord k, Iter g, HasExp s1 (g k ()), HasExp s2 (f k v)) =>
s1 -> s2 -> Exp (f k v)
⋪ Map Int Char
m0) (forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
1, Char
'a'), (Int
4, Char
'g')])
, forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"m0" (forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom (forall k v. Ord k => k -> v -> Exp (Single k v)
singleton Int
2 Char
'z') forall k (g :: * -> * -> *) s1 s2 (f :: * -> * -> *) v.
(Ord k, Iter g, HasExp s1 (g k ()), HasExp s2 (f k v)) =>
s1 -> s2 -> Exp (f k v)
⋪ Map Int Char
m0) (forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
1, Char
'a'), (Int
4, Char
'g')])
, forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"m0" (forall k v s (f :: * -> * -> *).
(Ord k, Ord v, HasExp s (f k v)) =>
s -> Exp (Sett v ())
rng (forall k v. Ord k => k -> v -> Exp (Single k v)
singleton Char
'z' Int
2) forall k (g :: * -> * -> *) s1 s2 (f :: * -> * -> *) v.
(Ord k, Iter g, HasExp s1 (g k ()), HasExp s2 (f k v)) =>
s1 -> s2 -> Exp (f k v)
⋪ Map Int Char
m0) (forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
1, Char
'a'), (Int
4, Char
'g')])
, forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest
String
"m0"
((forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
1, Char
'a'), (Int
2, Char
'n'), (Int
3, Char
'r')]) forall k v s1 (f :: * -> * -> *) s2 (g :: * -> * -> *).
(Show k, Show v, Ord k, HasExp s1 (f k v), HasExp s2 (g k v)) =>
s1 -> s2 -> Exp (f k v)
∪ (forall k v. Ord k => k -> v -> Exp (Single k v)
singleton Int
2 Char
'b'))
(forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
1 :: Int, Char
'a'), (Int
2, Char
'n'), (Int
3, Char
'r')])
, forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"m0" ([(Int
1, Char
'a'), (Int
3, Char
'r')] forall k v s1 (f :: * -> * -> *) s2 (g :: * -> * -> *).
(Show k, Show v, Ord k, HasExp s1 (f k v), HasExp s2 (g k v)) =>
s1 -> s2 -> Exp (f k v)
∪ forall k v. Ord k => k -> v -> Exp (Single k v)
singleton Int
3 Char
'b') (forall k v. Ord k => [(k, v)] -> List k v
UnSafeList [(Int
1 :: Int, Char
'a'), (Int
3, Char
'r')])
, forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"m0" (Int
70 forall k (g :: * -> * -> *) s.
(Show k, Ord k, Iter g, HasExp s (g k ())) =>
k -> s -> Exp Bool
∉ forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom Map Int Char
m12) Bool
True
, forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest
String
"((dom stkcred) ◁ deleg) ▷ (dom stpool)"
((forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom Map Int String
stkcred forall k s1 s2 (f :: * -> * -> *) v.
(Ord k, HasExp s1 (Sett k ()), HasExp s2 (f k v)) =>
s1 -> s2 -> Exp (f k v)
◁ Map Int Char
deleg) forall k (g :: * -> * -> *) v s1 (f :: * -> * -> *) s2.
(Ord k, Iter g, Ord v, HasExp s1 (f k v), HasExp s2 (g v ())) =>
s1 -> s2 -> Exp (f k v)
▷ forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom Map Char Int
stpool)
(forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
5, Char
'F')])
, forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"Range exclude 1" ([(Int, String)]
l4 forall k (g :: * -> * -> *) v s1 (f :: * -> * -> *) s2.
(Ord k, Iter g, Ord v, HasExp s1 (f k v), HasExp s2 (g v ())) =>
s1 -> s2 -> Exp (f k v)
⋫ forall a. Set a
Set.empty) (forall k v. Ord k => [(k, v)] -> List k v
UnSafeList [(Int, String)]
l4)
, forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"Range exclude 2" ([(Int, String)]
l4 forall k (g :: * -> * -> *) v s1 (f :: * -> * -> *) s2.
(Ord k, Iter g, Ord v, HasExp s1 (f k v), HasExp s2 (g v ())) =>
s1 -> s2 -> Exp (f k v)
⋫ forall k v. Single k v
Fail) (forall k v. Ord k => [(k, v)] -> List k v
UnSafeList [(Int, String)]
l4)
, forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest
String
"Range exclude 3"
([(Int, String)]
l4 forall k (g :: * -> * -> *) v s1 (f :: * -> * -> *) s2.
(Ord k, Iter g, Ord v, HasExp s1 (f k v), HasExp s2 (g v ())) =>
s1 -> s2 -> Exp (f k v)
⋫ forall a. Ord a => [a] -> Set a
Set.fromList [String
"m", String
"Z"])
(forall k v. Ord k => [(k, v)] -> List k v
UnSafeList [(Int
2, String
"a"), (Int
5, String
"z"), (Int
6, String
"b"), (Int
7, String
"r"), (Int
12, String
"w"), (Int
34, String
"v"), (Int
50, String
"q"), (Int
51, String
"l")])
, forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"DomExclude Union" ((Set Int
z2 forall k (g :: * -> * -> *) s1 s2 (f :: * -> * -> *) v.
(Ord k, Iter g, HasExp s1 (g k ()), HasExp s2 (f k v)) =>
s1 -> s2 -> Exp (f k v)
⋪ Map Int String
z1) forall k v s1 (f :: * -> * -> *) s2 (g :: * -> * -> *).
(Show k, Show v, Ord k, HasExp s1 (f k v), HasExp s2 (g k v)) =>
s1 -> s2 -> Exp (f k v)
∪ Map Int String
z3) Map Int String
z4
, forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"Set difference" (Set Int
z2 forall k (f :: * -> * -> *) (g :: * -> * -> *) s1 v s2 u.
(Ord k, Iter f, Iter g, HasExp s1 (f k v), HasExp s2 (g k u)) =>
s1 -> s2 -> Exp (f k v)
➖ forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom Map Int String
z1) (forall k. Set k -> Sett k ()
Sett (forall a. Ord a => [a] -> Set a
Set.fromList [Int
2 :: Int, Int
13]))
, forall (f :: * -> * -> *) k v.
(Show (f k v), Ord k, Eq (f k v)) =>
Exp (f k v) -> TestTree
evalCompile ((forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom Map Int String
stkcred forall k s1 s2 (f :: * -> * -> *) v.
(Ord k, HasExp s1 (Sett k ()), HasExp s2 (f k v)) =>
s1 -> s2 -> Exp (f k v)
◁ Map Int Char
deleg) forall k (g :: * -> * -> *) v s1 (f :: * -> * -> *) s2.
(Ord k, Iter g, Ord v, HasExp s1 (f k v), HasExp s2 (g v ())) =>
s1 -> s2 -> Exp (f k v)
▷ forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom Map Char Int
stpool)
, forall (f :: * -> * -> *) k v.
(Show (f k v), Ord k, Eq (f k v)) =>
Exp (f k v) -> TestTree
evalCompile ([(Int, String)]
l4 forall k (g :: * -> * -> *) v s1 (f :: * -> * -> *) s2.
(Ord k, Iter g, Ord v, HasExp s1 (f k v), HasExp s2 (g v ())) =>
s1 -> s2 -> Exp (f k v)
⋫ forall a. Ord a => [a] -> Set a
Set.fromList [String
"m", String
"Z"])
, forall (f :: * -> * -> *) k v.
(Show (f k v), Ord k, Eq (f k v)) =>
Exp (f k v) -> TestTree
evalCompile (Map Int Char
m0 forall k v s1 (f :: * -> * -> *) s2 (g :: * -> * -> *).
(Show k, Show v, Ord k, HasExp s1 (f k v), HasExp s2 (g k v)) =>
s1 -> s2 -> Exp (f k v)
∪ forall k v. Ord k => k -> v -> Exp (Single k v)
singleton Int
3 Char
'b')
, forall (f :: * -> * -> *) k v.
(Show (f k v), Ord k, Eq (f k v)) =>
Exp (f k v) -> TestTree
evalCompile (forall k. Ord k => k -> Exp (Single k ())
setSingleton Int
2 forall k (g :: * -> * -> *) s1 s2 (f :: * -> * -> *) v.
(Ord k, Iter g, HasExp s1 (g k ()), HasExp s2 (f k v)) =>
s1 -> s2 -> Exp (f k v)
⋪ Map Int Char
m0)
, forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"ex1" (Int
5 forall k (g :: * -> * -> *) s.
(Show k, Ord k, Iter g, HasExp s (g k ())) =>
k -> s -> Exp Bool
∈ forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom Map Int Char
m12) Bool
True
, forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"ex2" (Int
70 forall k (g :: * -> * -> *) s.
(Show k, Ord k, Iter g, HasExp s (g k ())) =>
k -> s -> Exp Bool
∈ forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom Map Int Char
m12) Bool
False
, forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"ex3" (Int
70 forall k (g :: * -> * -> *) s.
(Show k, Ord k, Iter g, HasExp s (g k ())) =>
k -> s -> Exp Bool
∉ forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom Map Int Char
m12) Bool
True
, forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"ex4" (Map Int Char
m0 forall k v s1 (f :: * -> * -> *) s2 (g :: * -> * -> *).
(Show k, Show v, Ord k, HasExp s1 (f k v), HasExp s2 (g k v)) =>
s1 -> s2 -> Exp (f k v)
∪ forall k v. Ord k => k -> v -> Exp (Single k v)
singleton Int
3 Char
'b') (forall k a. Ord k => k -> a -> Map k a -> Map k a
Map.insert Int
3 Char
'b' Map Int Char
m0)
, forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"ex5" (forall k. Ord k => k -> Exp (Single k ())
setSingleton Int
2 forall k (g :: * -> * -> *) s1 s2 (f :: * -> * -> *) v.
(Ord k, Iter g, HasExp s1 (g k ()), HasExp s2 (f k v)) =>
s1 -> s2 -> Exp (f k v)
⋪ Map Int Char
m0) (forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
1, Char
'a'), (Int
4, Char
'g')])
, forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"ex6" (forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom (forall k v. Ord k => k -> v -> Exp (Single k v)
singleton Int
2 Char
'z') forall k (g :: * -> * -> *) s1 s2 (f :: * -> * -> *) v.
(Ord k, Iter g, HasExp s1 (g k ()), HasExp s2 (f k v)) =>
s1 -> s2 -> Exp (f k v)
⋪ Map Int Char
m0) (forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
1, Char
'a'), (Int
4, Char
'g')])
, forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"ex7" (forall k v s (f :: * -> * -> *).
(Ord k, Ord v, HasExp s (f k v)) =>
s -> Exp (Sett v ())
rng (forall k v. Ord k => k -> v -> Exp (Single k v)
singleton Char
'z' Int
2) forall k (g :: * -> * -> *) s1 s2 (f :: * -> * -> *) v.
(Ord k, Iter g, HasExp s1 (g k ()), HasExp s2 (f k v)) =>
s1 -> s2 -> Exp (f k v)
⋪ Map Int Char
m0) (forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
1, Char
'a'), (Int
4, Char
'g')])
, forall t. (Show t, Eq t) => String -> Exp t -> t -> TestTree
evalTest String
"ex8" (Set Int
z2 forall k (f :: * -> * -> *) (g :: * -> * -> *) s1 v s2 u.
(Ord k, Iter f, Iter g, HasExp s1 (f k v), HasExp s2 (g k u)) =>
s1 -> s2 -> Exp (f k v)
➖ forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom Map Int String
z1) (forall k. Set k -> Sett k ()
Sett forall a b. (a -> b) -> a -> b
$ forall a. Ord a => [a] -> Set a
Set.fromList [Int
13, Int
2])
]
tree1, tree2, tree3 :: Map Int Int
tree1 :: Map Int Int
tree1 = forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
i, Int
i :: Int) | Int
i <- [Int
1 .. Int
20]]
tree2 :: Map Int Int
tree2 = forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
i, Int
i :: Int) | Int
i <- forall a. [a] -> [a]
reverse [Int
2 .. Int
20] forall a. [a] -> [a] -> [a]
++ [Int
1]]
tree3 :: Map Int Int
tree3 = forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
i, Int
i :: Int) | Int
i <- [Int
1 .. Int
19]]
set1 :: Set.Set Int
set1 :: Set Int
set1 = forall a. Ord a => [a] -> Set a
Set.fromList [Int
1 .. Int
20]
keysEqTests :: TestTree
keysEqTests :: TestTree
keysEqTests =
String -> [TestTree] -> TestTree
testGroup
String
"keysEqual tests"
( forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith
forall {a} {a}. (Eq a, Show a, Show a) => a -> (a, a) -> TestTree
tst
[(Int
1 :: Int) ..]
[ (forall k v1 v2. Ord k => Map k v1 -> Map k v2 -> Bool
keysEqual Map Int Int
tree1 Map Int Int
tree2, Bool
True)
, (forall k v1 v2. Ord k => Map k v1 -> Map k v2 -> Bool
keysEqual Map Int Int
tree2 Map Int Int
tree1, Bool
True)
, (forall k v1 v2. Ord k => Map k v1 -> Map k v2 -> Bool
keysEqual Map Int Int
tree1 Map Int Int
tree3, Bool
False)
, (forall k (f :: * -> * -> *) (g :: * -> * -> *) b c.
(Ord k, Iter f, Iter g) =>
f k b -> g k c -> Bool
sameDomain Map Int Int
tree1 Map Int Int
tree2, Bool
True)
, (forall k (f :: * -> * -> *) (g :: * -> * -> *) b c.
(Ord k, Iter f, Iter g) =>
f k b -> g k c -> Bool
sameDomain Map Int Int
tree2 Map Int Int
tree1, Bool
True)
, (forall k (f :: * -> * -> *) (g :: * -> * -> *) b c.
(Ord k, Iter f, Iter g) =>
f k b -> g k c -> Bool
sameDomain Map Int Int
tree1 Map Int Int
tree3, Bool
False)
, (forall s t. Embed s t => Exp t -> s
eval (Map Int Int
tree1 forall k (f :: * -> * -> *) (g :: * -> * -> *) s1 v s2 u.
(Ord k, Iter f, Iter g, HasExp s1 (f k v), HasExp s2 (g k u)) =>
s1 -> s2 -> Exp Bool
≍ Map Int Int
tree2), Bool
True)
, (forall s t. Embed s t => Exp t -> s
eval (Map Int Int
tree1 forall k (f :: * -> * -> *) (g :: * -> * -> *) s1 v s2 u.
(Ord k, Iter f, Iter g, HasExp s1 (f k v), HasExp s2 (g k u)) =>
s1 -> s2 -> Exp Bool
≍ Map Int Int
tree3), Bool
False)
, (forall s t. Embed s t => Exp t -> s
eval (Map Int Int
tree1 forall k (f :: * -> * -> *) (g :: * -> * -> *) s1 v s2 u.
(Ord k, Iter f, Iter g, HasExp s1 (f k v), HasExp s2 (g k u)) =>
s1 -> s2 -> Exp Bool
≍ Set Int
set1), Bool
True)
, (forall s t. Embed s t => Exp t -> s
eval (Map Int Int
tree3 forall k (f :: * -> * -> *) (g :: * -> * -> *) s1 v s2 u.
(Ord k, Iter f, Iter g, HasExp s1 (f k v), HasExp s2 (g k u)) =>
s1 -> s2 -> Exp Bool
≍ Set Int
set1), Bool
False)
]
)
where
tst :: a -> (a, a) -> TestTree
tst a
n (a
x, a
y) = String -> Assertion -> TestTree
testCase (String
"keysEqual " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show a
n) (forall a.
(Eq a, Show a, HasCallStack) =>
String -> a -> a -> Assertion
assertEqual (String
"keysEqual " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show a
n) a
y a
x)
testcase :: (Eq k, Eq v, Show k, Show v, Iter f) => String -> f k v -> [(k, v)] -> TestTree
testcase :: forall k v (f :: * -> * -> *).
(Eq k, Eq v, Show k, Show v, Iter f) =>
String -> f k v -> [(k, v)] -> TestTree
testcase String
nm f k v
col [(k, v)]
ans = String -> Assertion -> TestTree
testCase String
nm (forall a.
(Eq a, Show a, HasCallStack) =>
String -> a -> a -> Assertion
assertEqual String
nm [(k, v)]
ans (forall tuple.
Collect tuple -> forall ans. ans -> (tuple -> ans -> ans) -> ans
runCollect (forall (f :: * -> * -> *) k v. Iter f => f k v -> Collect (k, v)
fifo f k v
col) [] (:)))
fromListD :: (Ord k, Iter f) => BaseRep f k v -> [(k, v)] -> Query k v
fromListD :: forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep f k v
rep [(k, v)]
xs = forall (f :: * -> * -> *) k v.
(Iter f, Ord k) =>
BaseRep f k v -> f k v -> Query k v
BaseD BaseRep f k v
rep (forall k (f :: * -> * -> *) v.
Ord k =>
BaseRep f k v -> (v -> v -> v) -> [(k, v)] -> f k v
fromList BaseRep f k v
rep (\v
l v
_r -> v
l) [(k, v)]
xs)
testAnd1
, testAnd2
, testOr
, testDiff1
, testDiff2 ::
Iter g => String -> BaseRep g Int String -> TestTree
testAnd1 :: forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testAnd1 String
nm BaseRep g Int String
rep =
forall k v (f :: * -> * -> *).
(Eq k, Eq v, Show k, Show v, Iter f) =>
String -> f k v -> [(k, v)] -> TestTree
testcase
String
nm
(forall k v1 w. Ord k => Query k v1 -> Query k w -> Query k (v1, w)
AndD (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep g Int String
rep [(Int, String)]
l1) (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep g Int String
rep [(Int, String)]
l2))
[(Int
4, (String
"d", String
"d")), (Int
5, (String
"e", String
"e")), (Int
10, (String
"j", String
"j")), (Int
21, (String
"v", String
"v"))]
testAnd2 :: forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testAnd2 String
nm BaseRep g Int String
rep =
String -> Assertion -> TestTree
testCase
String
nm
( forall a.
(Eq a, Show a, HasCallStack) =>
String -> a -> a -> Assertion
assertEqual
String
nm
(forall tuple.
Collect tuple -> forall ans. ans -> (tuple -> ans -> ans) -> ans
runCollect (forall (f :: * -> * -> *) k v. Iter f => f k v -> Collect (k, v)
lifo (forall k v1 w. Ord k => Query k v1 -> Query k w -> Query k (v1, w)
AndD (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep g Int String
rep [(Int, String)]
l1) (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep g Int String
rep [(Int, String)]
l2))) [] (:))
(forall a. [a] -> [a]
reverse [(Int
4, (String
"d", String
"d")), (Int
5, (String
"e", String
"e")), (Int
10, (String
"j", String
"j")), (Int
21, (String
"v", String
"v"))])
)
testOr :: forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testOr String
nm BaseRep g Int String
rep =
forall k v (f :: * -> * -> *).
(Eq k, Eq v, Show k, Show v, Iter f) =>
String -> f k v -> [(k, v)] -> TestTree
testcase
String
nm
(forall k v.
Ord k =>
Query k v -> Query k v -> Fun (v -> v -> v) -> Query k v
OrD (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep g Int String
rep [(Int, String)]
l1) (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep g Int String
rep [(Int, String)]
l2) (forall a b c. (a -> b -> c) -> Fun (a -> b -> c)
lift (\String
x String
y -> String
x forall a. [a] -> [a] -> [a]
++ String
"-" forall a. [a] -> [a] -> [a]
++ String
y)))
[ (Int
1, String
"a")
, (Int
3, String
"c")
, (Int
4, String
"d-d")
, (Int
5, String
"e-e")
, (Int
6, String
"f")
, (Int
10, String
"j-j")
, (Int
11, String
"k")
, (Int
12, String
"l")
, (Int
21, String
"v-v")
, (Int
26, String
"z")
]
testDiff1 :: forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testDiff1 String
nm BaseRep g Int String
rep =
forall k v (f :: * -> * -> *).
(Eq k, Eq v, Show k, Show v, Iter f) =>
String -> f k v -> [(k, v)] -> TestTree
testcase
String
nm
(forall k v u. Ord k => Query k v -> Query k u -> Query k v
DiffD (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep g Int String
rep [(Int, String)]
l1) (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep g Int String
rep [(Int, String)]
l2))
[(Int
1, String
"a"), (Int
12, String
"l"), (Int
26, String
"z")]
testDiff2 :: forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testDiff2 String
nm BaseRep g Int String
rep = forall k v (f :: * -> * -> *).
(Eq k, Eq v, Show k, Show v, Iter f) =>
String -> f k v -> [(k, v)] -> TestTree
testcase String
nm (forall k v u. Ord k => Query k v -> Query k u -> Query k v
DiffD (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep g Int String
rep [(Int, String)]
l2) (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep g Int String
rep [(Int, String)]
l1)) [(Int
3, String
"c"), (Int
6, String
"f"), (Int
11, String
"k")]
testGuard :: (Show b, Iter f, Ord b) => String -> BaseRep f Int b -> [(Int, b)] -> TestTree
testGuard :: forall b (f :: * -> * -> *).
(Show b, Iter f, Ord b) =>
String -> BaseRep f Int b -> [(Int, b)] -> TestTree
testGuard String
nm BaseRep f Int b
rep [(Int, b)]
f =
forall k v (f :: * -> * -> *).
(Eq k, Eq v, Show k, Show v, Iter f) =>
String -> f k v -> [(k, v)] -> TestTree
testcase
String
nm
(forall k v. Ord k => Query k v -> Fun (k -> v -> Bool) -> Query k v
GuardD (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep f Int b
rep [(Int, b)]
f) (forall dom (f :: * -> * -> *) v rng.
(Ord dom, Iter f) =>
f dom v -> Fun (dom -> rng -> Bool)
domElem Sett Int ()
evens))
(forall a. (a -> Bool) -> [a] -> [a]
filter (forall a. Integral a => a -> Bool
even forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a, b) -> a
fst) [(Int, b)]
f)
testProj :: (Show k, Ord k, Iter f) => String -> BaseRep f k [Char] -> [(k, [Char])] -> TestTree
testProj :: forall k (f :: * -> * -> *).
(Show k, Ord k, Iter f) =>
String -> BaseRep f k String -> [(k, String)] -> TestTree
testProj String
nm BaseRep f k String
rep [(k, String)]
f =
forall k v (f :: * -> * -> *).
(Eq k, Eq v, Show k, Show v, Iter f) =>
String -> f k v -> [(k, v)] -> TestTree
testcase
String
nm
(forall k v1 v.
Ord k =>
Query k v1 -> Fun (k -> v1 -> v) -> Query k v
ProjectD (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep f k String
rep [(k, String)]
f) (forall a b c. (a -> b -> c) -> Fun (a -> b -> c)
lift (\k
_x String
y -> Char -> Int
ord (String
y forall a. [a] -> Int -> a
!! Int
0))))
[(k
k, Char -> Int
ord (String
v forall a. [a] -> Int -> a
!! Int
0)) | (k
k, String
v) <- [(k, String)]
f]
testAndP :: (Iter f, Iter g) => String -> BaseRep f Int String -> BaseRep g Int Int -> TestTree
testAndP :: forall (f :: * -> * -> *) (g :: * -> * -> *).
(Iter f, Iter g) =>
String -> BaseRep f Int String -> BaseRep g Int Int -> TestTree
testAndP String
nm BaseRep f Int String
rep1 BaseRep g Int Int
rep2 =
forall k v (f :: * -> * -> *).
(Eq k, Eq v, Show k, Show v, Iter f) =>
String -> f k v -> [(k, v)] -> TestTree
testcase
String
nm
(forall k v1 u v.
Ord k =>
Query k v1 -> Query k u -> Fun (k -> (v1, u) -> v) -> Query k v
AndPD (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep f Int String
rep1 [(Int, String)]
l1) (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep g Int Int
rep2 [(Int, Int)]
l3) forall x a b. Fun (x -> (a, b) -> b)
rngSnd)
[(Int
4, Int
12), (Int
12, Int
44)]
testChain :: (Iter f, Iter g) => String -> BaseRep f Int String -> BaseRep g String Int -> TestTree
testChain :: forall (f :: * -> * -> *) (g :: * -> * -> *).
(Iter f, Iter g) =>
String -> BaseRep f Int String -> BaseRep g String Int -> TestTree
testChain String
nm BaseRep f Int String
rep1 BaseRep g String Int
rep2 =
forall k v (f :: * -> * -> *).
(Eq k, Eq v, Show k, Show v, Iter f) =>
String -> f k v -> [(k, v)] -> TestTree
testcase
String
nm
(forall k v1 w v.
(Ord k, Ord v1) =>
Query k v1 -> Query v1 w -> Fun (k -> (v1, w) -> v) -> Query k v
ChainD (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep f Int String
rep1 [(Int, String)]
l4) (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep g String Int
rep2 [(String, Int)]
l5) (forall a b c. (a -> b -> c) -> Fun (a -> b -> c)
lift (\Int
x (String
y, Int
v) -> (Int
x, String
y, Int
v))))
[ (Int
1, (Int
1, String
"m", Int
105))
, (Int
2, (Int
2, String
"a", Int
101))
, (Int
6, (Int
6, String
"b", Int
102))
, (Int
12, (Int
12, String
"w", Int
108))
, (Int
50, (Int
50, String
"q", Int
107))
]
testChain2 :: (Iter f, Iter g) => String -> BaseRep f String Int -> BaseRep g Int String -> TestTree
testChain2 :: forall (f :: * -> * -> *) (g :: * -> * -> *).
(Iter f, Iter g) =>
String -> BaseRep f String Int -> BaseRep g Int String -> TestTree
testChain2 String
nm BaseRep f String Int
rep1 BaseRep g Int String
rep2 =
forall k v (f :: * -> * -> *).
(Eq k, Eq v, Show k, Show v, Iter f) =>
String -> f k v -> [(k, v)] -> TestTree
testcase
String
nm
(forall k v1 w v.
(Ord k, Ord v1) =>
Query k v1 -> Query v1 w -> Fun (k -> (v1, w) -> v) -> Query k v
ChainD (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep f String Int
rep1 [(String, Int)]
l5) (forall k (f :: * -> * -> *) v.
(Ord k, Iter f) =>
BaseRep f k v -> [(k, v)] -> Query k v
fromListD BaseRep g Int String
rep2 [(Int, String)]
l4) (forall a b c. (a -> b -> c) -> Fun (a -> b -> c)
lift (\String
x (Int
y, String
v) -> (String
x, Int
y, String
v))))
[(String
"m", (String
"m", Int
105, String
"Z"))]
testEpochEx :: TestTree
testEpochEx :: TestTree
testEpochEx =
String -> Assertion -> TestTree
testCase
String
"Epoch Boundary Example"
( forall a.
(Eq a, Show a, HasCallStack) =>
String -> a -> a -> Assertion
assertEqual
String
"Epoch Boundary Example"
(forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
6, Bool
True)])
(forall s t. Embed s t => Exp t -> s
eval (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (g :: * -> * -> *) v (f :: * -> * -> *).
(Ord k, Iter g, Ord v) =>
Exp (f k v) -> Exp (g v ()) -> Exp (f k v)
RRestrict (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Int String
delegs) (forall k. Ord k => k -> Exp (Single k ())
SetSingleton String
hk))) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Int Bool
state)))
)
where
delegs :: Map Int String
delegs = forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
5 :: Int, String
"a"), (Int
6, String
"b"), (Int
12, String
"c"), (Int
14, String
"e"), (Int
20, String
"f"), (Int
25, String
"g")]
hk :: String
hk = String
"b"
state :: Map Int Bool
state = forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Int
n, forall a. Integral a => a -> Bool
even Int
n) | Int
n <- [Int
1 .. Int
13]]
iterTests :: TestTree
iterTests :: TestTree
iterTests =
String -> [TestTree] -> TestTree
testGroup
String
"Iterator tests"
[ forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testAnd1 String
"(And l1 l2) as List, fifo" forall k v. Basic List => BaseRep List k v
ListR
, forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testAnd1 String
"(And l1 l2) as Map, fifo" forall k v. Basic Map => BaseRep Map k v
MapR
, forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testAnd2 String
"(And l1 l2) as List, lifo" forall k v. Basic List => BaseRep List k v
ListR
, forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testAnd2 String
"(And l1 l2) as Map, lifo" forall k v. Basic Map => BaseRep Map k v
MapR
, forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testOr String
"(Or l1 l2) as List" forall k v. Basic List => BaseRep List k v
ListR
, forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testOr String
"(Or l1 l2) as Map" forall k v. Basic Map => BaseRep Map k v
MapR
, forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testDiff1 String
"(Diff l1 l2) as List" forall k v. Basic List => BaseRep List k v
ListR
, forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testDiff2 String
"(Diff l2 l1) as List" forall k v. Basic List => BaseRep List k v
ListR
, forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testDiff1 String
"(Diff l1 l2) as Map" forall k v. Basic Map => BaseRep Map k v
MapR
, forall (g :: * -> * -> *).
Iter g =>
String -> BaseRep g Int String -> TestTree
testDiff2 String
"(Diff l2 l1) as Map" forall k v. Basic Map => BaseRep Map k v
MapR
, forall b (f :: * -> * -> *).
(Show b, Iter f, Ord b) =>
String -> BaseRep f Int b -> [(Int, b)] -> TestTree
testGuard String
"(Guard l1 even) as List" forall k v. Basic List => BaseRep List k v
ListR [(Int, String)]
l1
, forall b (f :: * -> * -> *).
(Show b, Iter f, Ord b) =>
String -> BaseRep f Int b -> [(Int, b)] -> TestTree
testGuard String
"(Guard l1 even) as Map" forall k v. Basic Map => BaseRep Map k v
MapR [(Int, String)]
l1
, forall b (f :: * -> * -> *).
(Show b, Iter f, Ord b) =>
String -> BaseRep f Int b -> [(Int, b)] -> TestTree
testGuard String
"(Guard l2 even) as List" forall k v. Basic List => BaseRep List k v
ListR [(Int, String)]
l2
, forall b (f :: * -> * -> *).
(Show b, Iter f, Ord b) =>
String -> BaseRep f Int b -> [(Int, b)] -> TestTree
testGuard String
"(Guard l2 even) as Map" forall k v. Basic Map => BaseRep Map k v
MapR [(Int, String)]
l2
, forall k (f :: * -> * -> *).
(Show k, Ord k, Iter f) =>
String -> BaseRep f k String -> [(k, String)] -> TestTree
testProj String
"(Proj l1 ord) as List" forall k v. Basic List => BaseRep List k v
ListR [(Int, String)]
l1
, forall k (f :: * -> * -> *).
(Show k, Ord k, Iter f) =>
String -> BaseRep f k String -> [(k, String)] -> TestTree
testProj String
"(Proj l1 ord) as Map" forall k v. Basic Map => BaseRep Map k v
MapR [(Int, String)]
l1
, forall k (f :: * -> * -> *).
(Show k, Ord k, Iter f) =>
String -> BaseRep f k String -> [(k, String)] -> TestTree
testProj String
"(Proj l2 ord) as List" forall k v. Basic List => BaseRep List k v
ListR [(Int, String)]
l2
, forall k (f :: * -> * -> *).
(Show k, Ord k, Iter f) =>
String -> BaseRep f k String -> [(k, String)] -> TestTree
testProj String
"(Proj l2 ord) as Map" forall k v. Basic Map => BaseRep Map k v
MapR [(Int, String)]
l2
, forall (f :: * -> * -> *) (g :: * -> * -> *).
(Iter f, Iter g) =>
String -> BaseRep f Int String -> BaseRep g Int Int -> TestTree
testAndP String
"(AndP l1:List l3:Map ord)" forall k v. Basic List => BaseRep List k v
ListR forall k v. Basic Map => BaseRep Map k v
MapR
, forall (f :: * -> * -> *) (g :: * -> * -> *).
(Iter f, Iter g) =>
String -> BaseRep f Int String -> BaseRep g Int Int -> TestTree
testAndP String
"(AndP l1:Map l3:List ord)" forall k v. Basic Map => BaseRep Map k v
MapR forall k v. Basic List => BaseRep List k v
ListR
, forall (f :: * -> * -> *) (g :: * -> * -> *).
(Iter f, Iter g) =>
String -> BaseRep f Int String -> BaseRep g Int Int -> TestTree
testAndP String
"(AndP l1:Map l3:List Map)" forall k v. Basic Map => BaseRep Map k v
MapR forall k v. Basic Map => BaseRep Map k v
MapR
, forall (f :: * -> * -> *) (g :: * -> * -> *).
(Iter f, Iter g) =>
String -> BaseRep f Int String -> BaseRep g String Int -> TestTree
testChain String
"(Chain l4:List l5:Map)" forall k v. Basic List => BaseRep List k v
ListR forall k v. Basic Map => BaseRep Map k v
MapR
, forall (f :: * -> * -> *) (g :: * -> * -> *).
(Iter f, Iter g) =>
String -> BaseRep f Int String -> BaseRep g String Int -> TestTree
testChain String
"(Chain l4:Map l5:List)" forall k v. Basic Map => BaseRep Map k v
MapR forall k v. Basic List => BaseRep List k v
ListR
, forall (f :: * -> * -> *) (g :: * -> * -> *).
(Iter f, Iter g) =>
String -> BaseRep f Int String -> BaseRep g String Int -> TestTree
testChain String
"(Chain l4:Map l5:List Map)" forall k v. Basic Map => BaseRep Map k v
MapR forall k v. Basic Map => BaseRep Map k v
MapR
, forall (f :: * -> * -> *) (g :: * -> * -> *).
(Iter f, Iter g) =>
String -> BaseRep f String Int -> BaseRep g Int String -> TestTree
testChain2 String
"(Chain2 l5:List l4:Map)" forall k v. Basic List => BaseRep List k v
ListR forall k v. Basic Map => BaseRep Map k v
MapR
, forall (f :: * -> * -> *) (g :: * -> * -> *).
(Iter f, Iter g) =>
String -> BaseRep f String Int -> BaseRep g Int String -> TestTree
testChain2 String
"(Chain2 l5:Map l4:List)" forall k v. Basic Map => BaseRep Map k v
MapR forall k v. Basic List => BaseRep List k v
ListR
, forall (f :: * -> * -> *) (g :: * -> * -> *).
(Iter f, Iter g) =>
String -> BaseRep f String Int -> BaseRep g Int String -> TestTree
testChain2 String
"(Chain2 l5:Map l4:List Map)" forall k v. Basic Map => BaseRep Map k v
MapR forall k v. Basic Map => BaseRep Map k v
MapR
, TestTree
testEpochEx
]
intersect2ways :: Map Int Char -> Map Int String -> Char -> Bool
intersect2ways :: Map Int Char -> Map Int String -> Char -> Bool
intersect2ways Map Int Char
delegs Map Int String
stake Char
hk =
forall k (f :: * -> * -> *) v.
Ord k =>
BaseRep f k v -> Collect (k, v) -> f k v
materialize forall k v. Basic Map => BaseRep Map k v
MapR (do (Int
x, Char
y, String
z) <- Map Int Char
delegs forall k (f :: * -> * -> *) (g :: * -> * -> *) b c.
(Ord k, Iter f, Iter g) =>
f k b -> g k c -> Collect (k, b, c)
`domEq` Map Int String
stake; Bool -> Collect ()
when (Char
y forall a. Eq a => a -> a -> Bool
== Char
hk); forall t. t -> Collect t
one (Int
x, String
z))
forall a. Eq a => a -> a -> Bool
== forall k v2 v1.
Ord k =>
(k -> v2 -> Bool) -> Map k v1 -> Map k v2 -> Map k v1
intersectDomPLeft (\Int
_k Char
v2 -> Char
v2 forall a. Eq a => a -> a -> Bool
== Char
hk) Map Int String
stake Map Int Char
delegs
intersectDomPLeftTest :: TestTree
intersectDomPLeftTest :: TestTree
intersectDomPLeftTest = forall a. Testable a => String -> a -> TestTree
testProperty String
"intersect2ways" Map Int Char -> Map Int String -> Char -> Bool
intersect2ways
ledgerStateProp :: Map Int Bool -> Map Int Char -> Map Char String -> Bool
ledgerStateProp :: Map Int Bool -> Map Int Char -> Map Char String -> Bool
ledgerStateProp Map Int Bool
xx Map Int Char
yy Map Char String
zz =
forall k (f :: * -> * -> *) v.
Ord k =>
BaseRep f k v -> Collect (k, v) -> f k v
materialize forall k v. Basic Map => BaseRep Map k v
MapR (do (Int
x, Bool
_, Char
y) <- Map Int Bool
xx forall k (f :: * -> * -> *) (g :: * -> * -> *) b c.
(Ord k, Iter f, Iter g) =>
f k b -> g k c -> Collect (k, b, c)
`domEq` Map Int Char
yy; Char
y forall (f :: * -> * -> *) k v.
(Iter f, Ord k) =>
k -> f k v -> Collect ()
`element` Map Char String
zz; forall t. t -> Collect t
one (Int
x, Char
y))
forall a. Eq a => a -> a -> Bool
== forall k v2 v1.
Ord k =>
(k -> v2 -> Bool) -> Map k v1 -> Map k v2 -> Map k v2
intersectDomP (\Int
_k Char
v -> forall k a. Ord k => k -> Map k a -> Bool
Map.member Char
v Map Char String
zz) Map Int Bool
xx Map Int Char
yy
ledgerStateTest :: TestTree
ledgerStateTest :: TestTree
ledgerStateTest = forall a. Testable a => String -> a -> TestTree
testProperty String
"ledgerStateExample2ways" Map Int Bool -> Map Int Char -> Map Char String -> Bool
ledgerStateProp
threeWay :: Map Int Char -> Map Int String -> Char -> Bool
threeWay :: Map Int Char -> Map Int String -> Char -> Bool
threeWay Map Int Char
delegs Map Int String
stake Char
hk =
forall k (f :: * -> * -> *) v. Ord k => Exp (f k v) -> f k v
runSet (forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom (Map Int Char
delegs forall k (g :: * -> * -> *) v s1 (f :: * -> * -> *) s2.
(Ord k, Iter g, Ord v, HasExp s1 (f k v), HasExp s2 (g v ())) =>
s1 -> s2 -> Exp (f k v)
▷ forall a. a -> Set a
Set.singleton Char
hk) forall k s1 s2 (f :: * -> * -> *) v.
(Ord k, HasExp s1 (Sett k ()), HasExp s2 (f k v)) =>
s1 -> s2 -> Exp (f k v)
◁ Map Int String
stake)
forall a. Eq a => a -> a -> Bool
== forall k v2 v1.
Ord k =>
(k -> v2 -> Bool) -> Map k v1 -> Map k v2 -> Map k v1
intersectDomPLeft (\Int
_k Char
v2 -> Char
v2 forall a. Eq a => a -> a -> Bool
== Char
hk) Map Int String
stake Map Int Char
delegs
Bool -> Bool -> Bool
&& forall k (f :: * -> * -> *) v. Ord k => Exp (f k v) -> f k v
runSet (forall k s (f :: * -> * -> *) v.
(Ord k, HasExp s (f k v)) =>
s -> Exp (Sett k ())
dom (Map Int Char
delegs forall k (g :: * -> * -> *) v s1 (f :: * -> * -> *) s2.
(Ord k, Iter g, Ord v, HasExp s1 (f k v), HasExp s2 (g v ())) =>
s1 -> s2 -> Exp (f k v)
▷ forall a. a -> Set a
Set.singleton Char
hk) forall k s1 s2 (f :: * -> * -> *) v.
(Ord k, HasExp s1 (Sett k ()), HasExp s2 (f k v)) =>
s1 -> s2 -> Exp (f k v)
◁ Map Int String
stake)
forall a. Eq a => a -> a -> Bool
== forall k (f :: * -> * -> *) v.
Ord k =>
BaseRep f k v -> Collect (k, v) -> f k v
materialize forall k v. Basic Map => BaseRep Map k v
MapR (do (Int
x, Char
y, String
z) <- Map Int Char
delegs forall k (f :: * -> * -> *) (g :: * -> * -> *) b c.
(Ord k, Iter f, Iter g) =>
f k b -> g k c -> Collect (k, b, c)
`domEq` Map Int String
stake; Bool -> Collect ()
when (Char
y forall a. Eq a => a -> a -> Bool
== Char
hk); forall t. t -> Collect t
one (Int
x, String
z))
threeWayTest :: TestTree
threeWayTest :: TestTree
threeWayTest = forall a. Testable a => String -> a -> TestTree
testProperty String
"eval-materialize-intersectDom" Map Int Char -> Map Int String -> Char -> Bool
threeWay
newtype Key = Key Int
deriving (Key -> Key -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Key -> Key -> Bool
$c/= :: Key -> Key -> Bool
== :: Key -> Key -> Bool
$c== :: Key -> Key -> Bool
Eq, Eq Key
Key -> Key -> Bool
Key -> Key -> Ordering
Key -> Key -> Key
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Key -> Key -> Key
$cmin :: Key -> Key -> Key
max :: Key -> Key -> Key
$cmax :: Key -> Key -> Key
>= :: Key -> Key -> Bool
$c>= :: Key -> Key -> Bool
> :: Key -> Key -> Bool
$c> :: Key -> Key -> Bool
<= :: Key -> Key -> Bool
$c<= :: Key -> Key -> Bool
< :: Key -> Key -> Bool
$c< :: Key -> Key -> Bool
compare :: Key -> Key -> Ordering
$ccompare :: Key -> Key -> Ordering
Ord)
instance Show Key where
show :: Key -> String
show (Key Int
n) = String
"k" forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show Int
n
newtype Range = Range Int
deriving (Range -> Range -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Range -> Range -> Bool
$c/= :: Range -> Range -> Bool
== :: Range -> Range -> Bool
$c== :: Range -> Range -> Bool
Eq, Eq Range
Range -> Range -> Bool
Range -> Range -> Ordering
Range -> Range -> Range
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Range -> Range -> Range
$cmin :: Range -> Range -> Range
max :: Range -> Range -> Range
$cmax :: Range -> Range -> Range
>= :: Range -> Range -> Bool
$c>= :: Range -> Range -> Bool
> :: Range -> Range -> Bool
$c> :: Range -> Range -> Bool
<= :: Range -> Range -> Bool
$c<= :: Range -> Range -> Bool
< :: Range -> Range -> Bool
$c< :: Range -> Range -> Bool
compare :: Range -> Range -> Ordering
$ccompare :: Range -> Range -> Ordering
Ord, Integer -> Range
Range -> Range
Range -> Range -> Range
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
fromInteger :: Integer -> Range
$cfromInteger :: Integer -> Range
signum :: Range -> Range
$csignum :: Range -> Range
abs :: Range -> Range
$cabs :: Range -> Range
negate :: Range -> Range
$cnegate :: Range -> Range
* :: Range -> Range -> Range
$c* :: Range -> Range -> Range
- :: Range -> Range -> Range
$c- :: Range -> Range -> Range
+ :: Range -> Range -> Range
$c+ :: Range -> Range -> Range
Num)
instance Show Range where
show :: Range -> String
show (Range Int
n) = forall a. Show a => a -> String
show Int
n
instance Semigroup Range where
Range Int
x <> :: Range -> Range -> Range
<> Range Int
y = Int -> Range
Range (Int
x forall a. Num a => a -> a -> a
+ Int
y)
instance Monoid Range where
mempty :: Range
mempty = Int -> Range
Range Int
0
flipRng :: (Ord b, Num b) => List a b -> List b b
flipRng :: forall b a. (Ord b, Num b) => List a b -> List b b
flipRng (UnSafeList [(a, b)]
xs) = forall k v. Ord k => (v -> v -> v) -> [(k, v)] -> List k v
fromPairs forall a. Num a => a -> a -> a
(+) (forall a b. (a -> b) -> [a] -> [b]
map (\(a
_a, b
b) -> (b
b, b
b)) [(a, b)]
xs)
duplicate :: Ord a => Set.Set a -> Map.Map a a
duplicate :: forall a. Ord a => Set a -> Map a a
duplicate Set a
s = forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr (\a
a Map a a
m -> forall k a. Ord k => k -> a -> Map k a -> Map k a
Map.insert a
a a
a Map a a
m) forall k a. Map k a
Map.empty Set a
s
btest :: Exp Bool -> Property
btest :: Exp Bool -> Property
btest Exp Bool
expr = forall t. Exp t -> t
compute Exp Bool
expr forall a. (Eq a, Show a) => a -> a -> Property
=== Exp Bool -> Bool
runBool Exp Bool
expr
qtest :: (Ord key, Eq (f key a), Show (f key a)) => Exp (f key a) -> Property
qtest :: forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest Exp (f key a)
expr = forall t. Exp t -> t
compute Exp (f key a)
expr forall a. (Eq a, Show a) => a -> a -> Property
=== forall k (f :: * -> * -> *) v. Ord k => Exp (f k v) -> f k v
runSet Exp (f key a)
expr
slowFastEquiv :: TestTree
slowFastEquiv :: TestTree
slowFastEquiv = forall a. Testable a => String -> a -> TestTree
testProperty String
"slowFastEquiv" Key
-> Range
-> Map Key Range
-> Map Key Range
-> Set Key
-> Set Key
-> Set Range
-> List Key Range
-> Property
slowProperties
slowProperties ::
Key ->
Range ->
Map Key Range ->
Map Key Range ->
Set.Set Key ->
Set.Set Key ->
Set.Set Range ->
List Key Range ->
Property
slowProperties :: Key
-> Range
-> Map Key Range
-> Map Key Range
-> Set Key
-> Set Key
-> Set Range
-> List Key Range
-> Property
slowProperties Key
k Range
v Map Key Range
m1 Map Key Range
m2 Set Key
s1 Set Key
s2 Set Range
rs List Key Range
ls =
forall prop. Testable prop => [prop] -> Property
conjoin forall a b. (a -> b) -> a -> b
$
forall a b. (a -> b) -> [a] -> [b]
map
(\(Property
prop, String
name) -> forall prop. Testable prop => String -> prop -> Property
counterexample String
name Property
prop)
[ (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1))), String
"slow1")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)), String
"slow2")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1))), String
"slow3")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)), String
"slow4")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k v. Ord k => k -> v -> Exp (Single k v)
Singleton Key
k Range
v)), String
"slow5")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Key
k)), String
"slow6")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)), String
"slow7")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (g :: * -> * -> *) v (f :: * -> * -> *).
(Ord k, Iter g, Ord v) =>
Exp (f k v) -> Exp (g v ()) -> Exp (f k v)
RRestrict (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Range
v))), String
"slow8")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (g :: * -> * -> *) v (f :: * -> * -> *).
(Ord k, Iter g, Ord v) =>
Exp (f k v) -> Exp (g v ()) -> Exp (f k v)
RRestrict (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Range
rs)))), String
"slow9")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (g :: * -> * -> *) v (f :: * -> * -> *).
(Ord k, Iter g, Ord v) =>
Exp (f k v) -> Exp (g v ()) -> Exp (f k v)
RExclude (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Range
v))), String
"slow10")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (g :: * -> * -> *) v (f :: * -> * -> *).
(Ord k, Iter g, Ord v) =>
Exp (f k v) -> Exp (g v ()) -> Exp (f k v)
RExclude (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Range
rs)))), String
"slow11")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Key
k) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1))), String
"slow12")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1))), String
"slow13")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DExclude (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Key
k) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1))), String
"slow14")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DExclude (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1))), String
"slow15")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k v (f :: * -> * -> *).
(Ord k, Ord v) =>
Exp (f k v) -> Exp (Sett v ())
Rng (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1))), String
"slow16")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k v (f :: * -> * -> *).
(Ord k, Ord v) =>
Exp (f k v) -> Exp (Sett v ())
Rng (forall k v. Ord k => k -> v -> Exp (Single k v)
Singleton Key
k Range
v)), String
"slow17")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k v (f :: * -> * -> *).
(Ord k, Ord v) =>
Exp (f k v) -> Exp (Sett v ())
Rng (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Key
k)), String
"slow18")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k v (f :: * -> * -> *).
(Ord k, Ord v) =>
Exp (f k v) -> Exp (Sett v ())
Rng (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)), String
"slow19")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)), String
"slow21")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Key
k) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)), String
"slow22")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k v. Ord k => k -> v -> Exp (Single k v)
Singleton Key
k ()) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)), String
"slow23")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)), String
"slow24")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (g :: * -> * -> *) v (f :: * -> * -> *).
(Ord k, Iter g, Ord v) =>
Exp (f k v) -> Exp (g v ()) -> Exp (f k v)
RRestrict (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Range
v))) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)), String
"slow25")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (g :: * -> * -> *) v (f :: * -> * -> *).
(Ord k, Iter g, Ord v) =>
Exp (f k v) -> Exp (g v ()) -> Exp (f k v)
RRestrict (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Range
rs)))) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)), String
"slow26")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)), String
"slow27")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2))), String
"slow28")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic List => BaseRep List k v
ListR List Key Range
ls)), String
"slow29")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic List => BaseRep List k v
ListR List Key Range
ls)), String
"slow30")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Key
k) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic List => BaseRep List k v
ListR List Key Range
ls)), String
"slow31")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k v. Ord k => k -> v -> Exp (Single k v)
Singleton Key
k Range
v)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic List => BaseRep List k v
ListR List Key Range
ls)), String
"slow32")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k v (f :: * -> * -> *).
(Ord k, Ord v) =>
Exp (f k v) -> Exp (Sett v ())
Rng (forall k v. Ord k => k -> v -> Exp (Single k v)
Singleton Key
k Range
v)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic List => BaseRep List k v
ListR (forall b a. (Ord b, Num b) => List a b -> List b b
flipRng List Key Range
ls))), String
"slow33")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DExclude (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Key
k) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)), String
"slow35")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DExclude (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k v. Ord k => k -> v -> Exp (Single k v)
Singleton Key
k Range
v)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)), String
"slow36")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DExclude (forall k v (f :: * -> * -> *).
(Ord k, Ord v) =>
Exp (f k v) -> Exp (Sett v ())
Rng (forall k v. Ord k => k -> v -> Exp (Single k v)
Singleton Range
v Key
k)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)), String
"slow37")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DExclude (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)), String
"slow38")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DExclude (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)), String
"slow39")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) v (f :: * -> * -> *).
(Ord k, Iter g, Ord v) =>
Exp (f k v) -> Exp (g v ()) -> Exp (f k v)
RExclude (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Range
rs))), String
"slow47")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) v (f :: * -> * -> *).
(Ord k, Iter g, Ord v) =>
Exp (f k v) -> Exp (g v ()) -> Exp (f k v)
RExclude (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Range
v)), String
"slow48")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) v (f :: * -> * -> *).
(Ord k, Iter g, Ord v) =>
Exp (f k v) -> Exp (g v ()) -> Exp (f k v)
RExclude (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic List => BaseRep List k v
ListR List Key Range
ls) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Range
rs))), String
"slow49")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) v (f :: * -> * -> *).
(Ord k, Iter g, Ord v) =>
Exp (f k v) -> Exp (g v ()) -> Exp (f k v)
RExclude (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic List => BaseRep List k v
ListR List Key Range
ls) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Single => BaseRep Single k v
SingleR forall k v. Single k v
Fail)), String
"slow50")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) v (f :: * -> * -> *).
(Ord k, Iter g, Ord v) =>
Exp (f k v) -> Exp (g v ()) -> Exp (f k v)
RRestrict (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Range
v)), String
"slow52")
,
( forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) v (f :: * -> * -> *).
(Ord k, Iter g, Ord v) =>
Exp (f k v) -> Exp (g v ()) -> Exp (f k v)
RRestrict (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)) (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR (forall a. Ord a => Set a -> Map a a
duplicate Set Range
rs))))
, String
"slow53"
)
,
( forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (g :: * -> * -> *) v (f :: * -> * -> *).
(Ord k, Iter g, Ord v) =>
Exp (f k v) -> Exp (g v ()) -> Exp (f k v)
RRestrict (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)) (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic List => BaseRep List k v
ListR (forall b a. (Ord b, Num b) => List a b -> List b b
flipRng List Key Range
ls))))
, String
"slow54"
)
, (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
Elem Key
k (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic List => BaseRep List k v
ListR List Key Range
ls))), String
"slow56")
, (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
Elem Key
k (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1))), String
"slow57")
, (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
Elem Key
k (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k v. Ord k => k -> v -> Exp (Single k v)
Singleton Key
k Range
v))), String
"slow58")
, (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
Elem Key
k (forall k v (f :: * -> * -> *).
(Ord k, Ord v) =>
Exp (f k v) -> Exp (Sett v ())
Rng (forall k v. Ord k => k -> v -> Exp (Single k v)
Singleton Range
v Key
k))), String
"slow59")
, (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
Elem Key
k (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Key
k)), String
"slow60")
, (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
Elem Key
k (forall k v (f :: * -> * -> *) (g :: * -> * -> *).
(Show k, Show v, Ord k) =>
Exp (f k v) -> Exp (g k v) -> Exp (f k v)
UnionOverrideLeft (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2)))), String
"slow61")
, (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
Elem Key
k (forall k (f :: * -> * -> *) v (g :: * -> * -> *).
Ord k =>
Exp (f k v) -> Exp (g k v) -> Exp (f k v)
UnionOverrideRight (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2)))), String
"slow62")
, (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
Elem Key
k (forall k n (f :: * -> * -> *) (g :: * -> * -> *).
(Ord k, Monoid n) =>
Exp (f k n) -> Exp (g k n) -> Exp (f k n)
UnionPlus (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2)))), String
"slow63")
, (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
Elem Key
k (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp (Sett k ())
Intersect (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2)))), String
"slow64")
, (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
Elem Key
k (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DRestrict (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1))) (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)))), String
"slow106")
, (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
Elem Key
k (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DExclude (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1))) (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)))), String
"slow107")
, (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
NotElem Key
k (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic List => BaseRep List k v
ListR List Key Range
ls))), String
"slow66")
, (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
NotElem Key
k (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1))), String
"slow67")
, (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
NotElem Key
k (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k v. Ord k => k -> v -> Exp (Single k v)
Singleton Key
k Range
v))), String
"slow68")
, (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
NotElem Key
k (forall k v (f :: * -> * -> *).
(Ord k, Ord v) =>
Exp (f k v) -> Exp (Sett v ())
Rng (forall k v. Ord k => k -> v -> Exp (Single k v)
Singleton Range
v Key
k))), String
"slow69")
, (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
NotElem Key
k (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Key
k)), String
"slow70")
, (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
NotElem Key
k (forall k v (f :: * -> * -> *) (g :: * -> * -> *).
(Show k, Show v, Ord k) =>
Exp (f k v) -> Exp (g k v) -> Exp (f k v)
UnionOverrideLeft (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2)))), String
"slow71")
, (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
NotElem Key
k (forall k (f :: * -> * -> *) v (g :: * -> * -> *).
Ord k =>
Exp (f k v) -> Exp (g k v) -> Exp (f k v)
UnionOverrideRight (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2)))), String
"slow72")
, (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
NotElem Key
k (forall k n (f :: * -> * -> *) (g :: * -> * -> *).
(Ord k, Monoid n) =>
Exp (f k n) -> Exp (g k n) -> Exp (f k n)
UnionPlus (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2)))), String
"slow73")
, (Exp Bool -> Property
btest (forall k (g :: * -> * -> *).
(Ord k, Iter g, Show k) =>
k -> Exp (g k ()) -> Exp Bool
NotElem Key
k (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp (Sett k ())
Intersect (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2)))), String
"slow74")
, (Exp Bool -> Property
btest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp Bool
Subset (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2))), String
"slow76")
, (Exp Bool -> Property
btest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp Bool
Subset (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)), String
"slow77")
, (Exp Bool -> Property
btest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp Bool
Subset (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1))), String
"slow78")
, (Exp Bool -> Property
btest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp Bool
Subset (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)), String
"slow79")
, (Exp Bool -> Property
btest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp Bool
Subset (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)) (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2))), String
"slow80")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp (Sett k ())
Intersect (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2))), String
"slow82")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp (Sett k ())
Intersect (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)), String
"slow83")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k v (f :: * -> * -> *) (g :: * -> * -> *).
(Show k, Show v, Ord k) =>
Exp (f k v) -> Exp (g k v) -> Exp (f k v)
UnionOverrideLeft (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic List => BaseRep List k v
ListR List Key Range
ls) (forall k v. Ord k => k -> v -> Exp (Single k v)
Singleton Key
k Range
v)), String
"slow85")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k v (f :: * -> * -> *) (g :: * -> * -> *).
(Show k, Show v, Ord k) =>
Exp (f k v) -> Exp (g k v) -> Exp (f k v)
UnionOverrideLeft (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)), String
"slow86")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k v (f :: * -> * -> *) (g :: * -> * -> *).
(Show k, Show v, Ord k) =>
Exp (f k v) -> Exp (g k v) -> Exp (f k v)
UnionOverrideLeft (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2))), String
"slow87")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k v (f :: * -> * -> *) (g :: * -> * -> *).
(Show k, Show v, Ord k) =>
Exp (f k v) -> Exp (g k v) -> Exp (f k v)
UnionOverrideLeft (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DExclude (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Key
k) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)), String
"slow88")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k v (f :: * -> * -> *) (g :: * -> * -> *).
(Show k, Show v, Ord k) =>
Exp (f k v) -> Exp (g k v) -> Exp (f k v)
UnionOverrideLeft (forall k (g :: * -> * -> *) (f :: * -> * -> *) v.
(Ord k, Iter g) =>
Exp (g k ()) -> Exp (f k v) -> Exp (f k v)
DExclude (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)), String
"slow89")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v (g :: * -> * -> *).
Ord k =>
Exp (f k v) -> Exp (g k v) -> Exp (f k v)
UnionOverrideRight (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic List => BaseRep List k v
ListR List Key Range
ls) (forall k v. Ord k => k -> v -> Exp (Single k v)
Singleton Key
k Range
v)), String
"slow91")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v (g :: * -> * -> *).
Ord k =>
Exp (f k v) -> Exp (g k v) -> Exp (f k v)
UnionOverrideRight (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)), String
"slow92")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) v (g :: * -> * -> *).
Ord k =>
Exp (f k v) -> Exp (g k v) -> Exp (f k v)
UnionOverrideRight (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2))), String
"slow93")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k n (f :: * -> * -> *) (g :: * -> * -> *).
(Ord k, Monoid n) =>
Exp (f k n) -> Exp (g k n) -> Exp (f k n)
UnionPlus (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)), String
"slow95")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k n (f :: * -> * -> *) (g :: * -> * -> *).
(Ord k, Monoid n) =>
Exp (f k n) -> Exp (g k n) -> Exp (f k n)
UnionPlus (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2))), String
"slow96")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k v. Ord k => k -> v -> Exp (Single k v)
Singleton Key
k Range
v), String
"slow98")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k. Ord k => k -> Exp (Single k ())
SetSingleton Key
k), String
"slow99")
, (Exp Bool -> Property
btest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp Bool
KeyEqual (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)), String
"slow100")
, (Exp Bool -> Property
btest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp Bool
KeyEqual (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1)) (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2))), String
"slow102")
, (Exp Bool -> Property
btest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp Bool
KeyEqual (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2))), String
"slow104")
, (Exp Bool -> Property
btest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp Bool
KeyEqual (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1))), String
"slow105")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp (f k v)
SetDiff (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2))), String
"slow108")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp (f k v)
SetDiff (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)), String
"slow109")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp (f k v)
SetDiff (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s1)) (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2))), String
"slow110")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp (f k v)
SetDiff (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k (f :: * -> * -> *) v.
Ord k =>
Exp (f k v) -> Exp (Sett k ())
Dom (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2))), String
"slow111")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp (f k v)
SetDiff (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m2)), String
"slow112")
, (forall key (f :: * -> * -> *) a.
(Ord key, Eq (f key a), Show (f key a)) =>
Exp (f key a) -> Property
qtest (forall k (f :: * -> * -> *) (g :: * -> * -> *) v u.
(Ord k, Iter f, Iter g) =>
Exp (f k v) -> Exp (g k u) -> Exp (f k v)
SetDiff (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k v. Basic Map => BaseRep Map k v
MapR Map Key Range
m1) (forall k (f :: * -> * -> *) v.
(Ord k, Basic f, Iter f) =>
BaseRep f k v -> f k v -> Exp (f k v)
Base forall k. Basic Sett => BaseRep Sett k ()
SetR (forall k. Set k -> Sett k ()
Sett Set Key
s2))), String
"slow113")
]
genSize :: Gen Int
genSize :: Gen Int
genSize =
forall a. HasCallStack => [(Int, Gen a)] -> Gen a
frequency
[ (Int
1, forall (m :: * -> *) a. Monad m => a -> m a
return Int
0)
, (Int
2, forall (m :: * -> *) a. Monad m => a -> m a
return Int
1)
, (Int
5, forall (m :: * -> *) a. Monad m => a -> m a
return Int
2)
, (Int
5, forall (m :: * -> *) a. Monad m => a -> m a
return Int
3)
, (Int
4, forall (m :: * -> *) a. Monad m => a -> m a
return Int
4)
, (Int
3, forall (m :: * -> *) a. Monad m => a -> m a
return Int
5)
, (Int
2, forall (m :: * -> *) a. Monad m => a -> m a
return Int
6)
, (Int
1, forall (m :: * -> *) a. Monad m => a -> m a
return Int
7)
]
instance Arbitrary Key where
arbitrary :: Gen Key
arbitrary = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Int -> Key
Key (forall a. Random a => (a, a) -> Gen a
choose (Int
1, Int
12))
instance Arbitrary Range where
arbitrary :: Gen Range
arbitrary = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Int -> Range
Range (forall a. Random a => (a, a) -> Gen a
choose (Int
1, Int
20))
instance (Ord k, Arbitrary k, Arbitrary v) => Arbitrary (List k v) where
arbitrary :: Gen (List k v)
arbitrary = do
Int
n <- Gen Int
genSize
[(k, v)]
xs <- forall a. Int -> Gen a -> Gen [a]
vectorOf Int
n forall a. Arbitrary a => Gen a
arbitrary
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall k v. Ord k => (v -> v -> v) -> [(k, v)] -> List k v
fromPairs (\v
_old v
new -> v
new) [(k, v)]
xs
instance (Ord k, Arbitrary k) => Arbitrary (Sett k ()) where
arbitrary :: Gen (Sett k ())
arbitrary = do
Int
n <- Gen Int
genSize
[k]
xs <- forall a. Int -> Gen a -> Gen [a]
vectorOf Int
n forall a. Arbitrary a => Gen a
arbitrary
forall (f :: * -> *) a. Applicative f => a -> f a
pure (forall k. Set k -> Sett k ()
Sett (forall a. Ord a => [a] -> Set a
Set.fromList [k]
xs))
setAlgTest :: TestTree
setAlgTest :: TestTree
setAlgTest =
String -> [TestTree] -> TestTree
testGroup
String
"Set Algebra Tests"
[ TestTree
evalTests
, TestTree
keysEqTests
, TestTree
iterTests
, TestTree
intersectDomPLeftTest
, TestTree
ledgerStateTest
, TestTree
threeWayTest
, TestTree
slowFastEquiv
]