diff --git a/Data/IntMultiSet.hs b/Data/IntMultiSet.hs
--- a/Data/IntMultiSet.hs
+++ b/Data/IntMultiSet.hs
@@ -361,6 +361,10 @@
 
 -- | /O(log n)/. Retrieves the minimal element of the multiset, and the set stripped from that element
 -- Returns @Nothing@ when passed an empty multiset.
+--
+-- Examples:
+-- >>> minView $ fromList [100, 100, 200, 300]
+-- Just (100,fromOccurList [(100,1),(200,1),(300,1)])
 minView :: IntMultiSet -> Maybe (Key, IntMultiSet)
 minView x
   | null x    = Nothing
@@ -368,10 +372,14 @@
 
 -- | /O(log n)/. Retrieves the maximal element of the multiset, and the set stripped from that element
 -- @fail@s (in the monad) when passed an empty multiset.
+--
+-- Examples:
+-- >>> maxView $ fromList [100, 100, 200, 300]
+-- Just (300,fromOccurList [(100,2),(200,1)])
 maxView :: IntMultiSet -> Maybe (Key, IntMultiSet)
 maxView x
   | null x    = Nothing
-  | otherwise = Just (deleteFindMin x)
+  | otherwise = Just (deleteFindMax x)
 
 {--------------------------------------------------------------------
   Union, Difference, Intersection
diff --git a/Data/MultiSet.hs b/Data/MultiSet.hs
--- a/Data/MultiSet.hs
+++ b/Data/MultiSet.hs
@@ -347,6 +347,10 @@
 -- | /O(log n)/. Retrieves the minimal element of the multiset,
 --   and the set with that element removed.
 --   Returns @Nothing@ when passed an empty multiset.
+--
+-- Examples:
+-- >>> minView $ fromList ['a', 'a', 'b', 'c']
+-- Just ('a',fromOccurList [('a',1),('b',1),('c',1)])
 minView :: MultiSet a -> Maybe (a, MultiSet a)
 minView x
   | null x    = Nothing
@@ -355,10 +359,14 @@
 -- | /O(log n)/. Retrieves the maximal element of the multiset,
 --   and the set with that element removed.
 --   Returns @Nothing@ when passed an empty multiset.
+--
+-- Examples:
+-- >>> maxView $ fromList ['a', 'a', 'b', 'c']
+-- Just ('c',fromOccurList [('a',2),('b',1)])
 maxView :: MultiSet a -> Maybe (a, MultiSet a)
 maxView x
   | null x    = Nothing
-  | otherwise = Just (deleteFindMin x)
+  | otherwise = Just (deleteFindMax x)
 
 {--------------------------------------------------------------------
   Union, Difference, Intersection
diff --git a/multiset.cabal b/multiset.cabal
--- a/multiset.cabal
+++ b/multiset.cabal
@@ -1,5 +1,5 @@
 name:             multiset
-version:          0.3.0
+version:          0.3.1
 author:           Twan van Laarhoven
 maintainer:       twanvl@gmail.com
 bug-reports:      https://github.com/twanvl/multiset/issues
@@ -11,7 +11,7 @@
 license:          BSD3
 license-file:     LICENSE
 build-type:       Simple
-Cabal-version:    >= 1.6
+Cabal-version:    >= 1.10
 extra-source-files: include/Typeable.h
 
 source-repository head
@@ -19,9 +19,20 @@
     location: http://github.com/twanvl/multiset.git
 
 Library
+  default-language:   Haskell2010
   exposed-modules:    Data.MultiSet, Data.IntMultiSet
 
   include-dirs:       include
-  extensions:         CPP
+  default-extensions: CPP
   ghc-options:        -Wall
   build-depends:      containers >= 0.5, base >= 4 && < 5
+
+test-suite doctests
+  default-language:   Haskell2010
+  type:               exitcode-stdio-1.0
+  ghc-options:        -threaded
+  hs-source-dirs:     test
+  main-is:            Main.hs
+  build-depends:      Glob
+                    , base >= 4 && < 5
+                    , doctest
diff --git a/test/Main.hs b/test/Main.hs
new file mode 100644
--- /dev/null
+++ b/test/Main.hs
@@ -0,0 +1,10 @@
+module Main (main) where
+
+import System.FilePath.Glob (glob)
+import Test.DocTest (doctest)
+
+main :: IO ()
+main = do
+  glob "Data/**/*.hs" >>= doctest
+  glob "test/**/*.hs" >>= doctest
+
