summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Properties.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/Properties.hs b/tests/Properties.hs
index 83aba87..19ccf49 100644
--- a/tests/Properties.hs
+++ b/tests/Properties.hs
@@ -17,6 +17,7 @@ import System.Random
import Text.Printf
import Data.List (nub,sort,group,sort,intersperse,genericLength)
import Data.Map (keys,elems)
+import qualified Data.Map as M
-- ---------------------------------------------------------------------
-- QuickCheck properties for the StackSet
@@ -40,6 +41,10 @@ fromList (o,m,xs) = view o $ foldr (\(i,ys) s ->
-- ---------------------------------------------------------------------
+-- | /O(n)/. Number of stacks
+size :: T -> Int
+size = M.size . stacks
+
-- | Height of stack 'n'
height :: Int -> T -> Int
height i w = length (index i w)