summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikitaVolkov <>2018-12-06 11:40:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-12-06 11:40:00 (GMT)
commita272bdc578894d516419faf89be396d2144813a4 (patch)
tree7c5ed276fdf7e786593b19b97e5d30227a32760f
parent7cd90778ac8b0b5468345c90e890283107dc646e (diff)
version 0.2.7HEAD0.2.7master
-rw-r--r--deque.cabal2
-rw-r--r--library/Deque.hs6
2 files changed, 7 insertions, 1 deletions
diff --git a/deque.cabal b/deque.cabal
index ea39fc9..b7d0c0b 100644
--- a/deque.cabal
+++ b/deque.cabal
@@ -1,5 +1,5 @@
name: deque
-version: 0.2.6
+version: 0.2.7
synopsis: Double-ended queue
description:
An implementation of Double-Ended Queue (aka Dequeue or Deque)
diff --git a/library/Deque.hs b/library/Deque.hs
index 8d5cb7b..6a319e5 100644
--- a/library/Deque.hs
+++ b/library/Deque.hs
@@ -131,6 +131,12 @@ reverse (Deque snocList consList) =
Deque consList snocList
-- |
+-- /O(1)/.
+null :: Deque a -> Bool
+null (Deque snocList consList) =
+ List.null snocList && List.null consList
+
+-- |
-- /O(1)/, occasionally /O(n)/.
head :: Deque a -> Maybe a
head =