Skip to content

Instantly share code, notes, and snippets.

@liamoc
Created September 27, 2015 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liamoc/d1295c91607e5bc9d2db to your computer and use it in GitHub Desktop.
Save liamoc/d1295c91607e5bc9d2db to your computer and use it in GitHub Desktop.
Quickcheck properties
Tests
basics
arbitrary instance: wf(l): OK (0.04s)
+++ OK, passed 5000 tests.
take, drop
take
commutativity: take n ∘ take m ≡ take m ∘ take n: OK (1.57s)
+++ OK, passed 5000 tests.
accumulativity: take m ∘ take n ≡ take (m ⊓ n): OK (1.54s)
+++ OK, passed 5000 tests.
bounds length: length (take m t) ≡ length t ⊓ m: OK (0.02s)
+++ OK, passed 5000 tests.
data refinement: take n ∘ fromList ≡ fromList ∘ take n: OK (1.15s)
+++ OK, passed 5000 tests.
data abstraction: toList ∘ take n ≡ take n ∘ toList: OK (0.80s)
+++ OK, passed 5000 tests.
identity: take (length t) t ≡ t: OK (2.91s)
+++ OK, passed 5000 tests.
empty-neutral: take n ε ≡ ε: OK (0.01s)
+++ OK, passed 5000 tests.
wellformedness invariant: wf(take n t): OK
+++ OK, passed 5000 tests.
drop
commutativity: drop n ∘ drop m ≡ drop m ∘ drop n: OK (0.31s)
+++ OK, passed 5000 tests.
accumulativity: drop n ∘ drop m ≡ drop (m + n): OK (0.28s)
+++ OK, passed 5000 tests.
reduces length: length (drop n t) ≡ length t ∸ n: OK (0.02s)
+++ OK, passed 5000 tests.
unappending: drop (length t) (t ∙ u) ≡ u: OK (2.95s)
+++ OK, passed 5000 tests.
data refinement: drop n ∘ fromList ≡ fromList ∘ drop n: OK (2.12s)
+++ OK, passed 5000 tests.
data abstraction: toList ∘ drop n ≡ drop n ∘ toList: OK (1.62s)
+++ OK, passed 5000 tests.
identity: drop 0 ≡ id: OK (2.93s)
+++ OK, passed 5000 tests.
empty-neutral: drop n ε ≡ ε: OK
+++ OK, passed 5000 tests.
wellformedness invariant: wf(drop n t): OK (0.03s)
+++ OK, passed 5000 tests.
take-drop: take n t ∙ drop n t ≡ t: OK (3.08s)
+++ OK, passed 5000 tests.
monoid operations
left identity: ε ∙ t ≡ t: OK (2.90s)
+++ OK, passed 5000 tests.
right identity: t ∙ ε ≡ t: OK (2.92s)
+++ OK, passed 5000 tests.
associativity: t ∙ (u ∙ v) ≡ (t ∙ u) ∙ v: OK (10.17s)
+++ OK, passed 5000 tests.
data refinement: fromList is a monoid morphism
identity: fromList [] ≡ ε: OK
+++ OK, passed 5000 tests.
append: fromList (a ++ b) ≡ fromList a ∙ fromList b: OK (6.51s)
+++ OK, passed 5000 tests.
data abstraction: toList is a monoid morphism
identity: toList ε ≡ []: OK
+++ OK, passed 5000 tests.
append: toList (a ∙ b) ≡ toList a ++ toList b: OK (4.65s)
+++ OK, passed 5000 tests.
length is a monoid morphism
identity: length ε ≡ 0: OK
+++ OK, passed 5000 tests.
append: length (a ∙ b) = length a + length b: OK (0.03s)
+++ OK, passed 5000 tests.
wellformedness invariant
identity: wf(ε): OK
+++ OK, passed 5000 tests.
append: wf(a ∙ b): OK (0.05s)
+++ OK, passed 5000 tests.
composed
data refinement: composed ∘ fromList ≡ mconcat: OK (2.79s)
+++ OK, passed 5000 tests.
data abstraction: composed ≡ mconcat ∘ toList: OK (3.06s)
+++ OK, passed 5000 tests.
composed is a monoid morphism
identity: composed ε ≡ ε: OK
+++ OK, passed 5000 tests.
append: composed (t ∙ u) ≡ composed t ∙ composed u: OK (6.55s)
+++ OK, passed 5000 tests.
(fromList, toList) is an isomorphism
fromList ∘ toList ≡ id: OK (3.23s)
+++ OK, passed 5000 tests.
toList ∘ fromList ≡ id: OK (2.31s)
+++ OK, passed 5000 tests.
All 36 tests passed (66.77s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment