diff --git a/language-nix.cabal b/language-nix.cabal
--- a/language-nix.cabal
+++ b/language-nix.cabal
@@ -1,9 +1,9 @@
--- This file has been generated from package.yaml by hpack version 0.7.0.
+-- This file has been generated from package.yaml by hpack version 0.12.0.
 --
 -- see: https://github.com/sol/hpack
 
 name:           language-nix
-version:        2.1
+version:        2.1.0.1
 synopsis:       Data types and useful functions to represent and manipulate the Nix language.
 description:    Data types and useful functions to represent and manipulate the Nix language.
 category:       Distribution, Language
@@ -13,7 +13,7 @@
 maintainer:     simons@cryp.to
 license:        BSD3
 license-file:   LICENSE
-tested-with:    GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.2
+tested-with:    GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.1
 build-type:     Simple
 cabal-version:  >= 1.10
 
@@ -38,6 +38,8 @@
       Language.Nix.Binding
       Language.Nix.Identifier
       Language.Nix.Path
+  other-modules:
+      Paths_language_nix
   default-language: Haskell2010
 
 test-suite spec
diff --git a/src/Language/Nix/Identifier.hs b/src/Language/Nix/Identifier.hs
--- a/src/Language/Nix/Identifier.hs
+++ b/src/Language/Nix/Identifier.hs
@@ -4,55 +4,10 @@
 {-# LANGUAGE TemplateHaskell #-}
 
 module Language.Nix.Identifier
-  (
-    -- | Identifiers in Nix are essentially strings. They can be constructed
-    -- (and viewed) with the 'ident' isomorphism. For the sake of convenience,
-    -- @Identifier@s are an instance of the 'IsString' class.
-    --
-    -- Reasonable people restrict themselves to identifiers of the form
-    -- @[a-zA-Z_][a-zA-Z0-9_'-]*@, because these don't need quoting. The
-    -- methods of the 'Text' class can be used to parse and pretty-print an
-    -- identifier with proper quoting:
-    --
-    -- >>> disp (ident # "test")
-    -- test
-    -- >>> disp (ident # "foo.bar")
-    -- "foo.bar"
-    --
-    -- prop> \str -> Just (ident # str) == simpleParse (quote str)
-    -- prop> \i -> Just (i :: Identifier) == simpleParse (display i)
-    Identifier
-
-  , -- | An isomorphism that allows conversion of 'Identifier' from/to the
-    -- standard 'String' type via 'review'.
-    --
-    -- prop> \str -> fromString str == ident # str
-    -- prop> \str -> set ident str undefined == ident # str
-    -- prop> \str -> view ident (review ident str) == str
-    ident
-
-  , -- | Helper function to quote a given identifier string if necessary.
-    --
-    -- >>> putStrLn (quote "abc")
-    -- abc
-    -- >>> putStrLn (quote "abc.def")
-    -- "abc.def"
-    quote
-
-  , -- | Checks whether a given string needs quoting when interpreted as an
-    -- 'Identifier'. Simple identifiers that don't need quoting match the
-    -- regular expression @^[a-zA-Z_][a-zA-Z0-9_'-]*$@.
-    needsQuoting
-
-  , -- | 'ReadP' parser for simple identifiers, i.e. those that don't need
-    -- quoting.
-    parseSimpleIdentifier
-
-  , -- | 'ReadP' parser for quoted identifiers, i.e. those that /do/ need
-    -- quoting.
-    parseQuotedIdentifier
-
-  ) where
+  ( Identifier, ident, quote, needsQuoting
+  , parseSimpleIdentifier, parseQuotedIdentifier
+  )
+  where
 
 import Control.DeepSeq
 import Control.Lens
@@ -65,9 +20,31 @@
 import Test.QuickCheck
 import Text.PrettyPrint as PP
 
+-- | Identifiers in Nix are essentially strings. They can be constructed
+-- (and viewed) with the 'ident' isomorphism. For the sake of convenience,
+-- @Identifier@s are an instance of the 'IsString' class.
+--
+-- Reasonable people restrict themselves to identifiers of the form
+-- @[a-zA-Z_][a-zA-Z0-9_'-]*@, because these don't need quoting. The
+-- methods of the 'Text' class can be used to parse and pretty-print an
+-- identifier with proper quoting:
+--
+-- >>> disp (ident # "test")
+-- test
+-- >>> disp (ident # "foo.bar")
+-- "foo.bar"
+--
+-- prop> \str -> Just (ident # str) == simpleParse (quote str)
+-- prop> \i -> Just (i :: Identifier) == simpleParse (display i)
 declareLenses [d| newtype Identifier = Identifier { ident :: String }
                     deriving (Show, Eq, Ord, IsString, Generic)
               |]
+-- ^ An isomorphism that allows conversion of 'Identifier' from/to the
+-- standard 'String' type via 'review'.
+--
+-- prop> \str -> fromString str == ident # str
+-- prop> \str -> set ident str undefined == ident # str
+-- prop> \str -> view ident (review ident str) == str
 
 instance NFData Identifier where
   rnf (Identifier str) = rnf str
@@ -80,12 +57,16 @@
   disp = view (ident . to quote . to text)
   parse = parseQuotedIdentifier <++ parseSimpleIdentifier
 
+-- | 'ReadP' parser for simple identifiers, i.e. those that don't need
+-- quoting.
 parseSimpleIdentifier :: ReadP r Identifier
 parseSimpleIdentifier = do
   c <- satisfy (\x -> x == '_' || isAlpha x)
   cs <- munch (\x -> x `elem` "_'-" || isAlphaNum x)
   return (Identifier (c:cs))
 
+-- | 'ReadP' parser for quoted identifiers, i.e. those that /do/ need
+-- quoting.
 parseQuotedIdentifier :: ReadP r Identifier
 parseQuotedIdentifier = Identifier . read . fst
                      <$> gather (between (ReadP.char '"') (ReadP.char '"') (many qString))
@@ -99,9 +80,18 @@
       c2 <- get
       return [c1,c2]
 
+-- | Checks whether a given string needs quoting when interpreted as an
+-- 'Identifier'. Simple identifiers that don't need quoting match the
+-- regular expression @^[a-zA-Z_][a-zA-Z0-9_'-]*$@.
 needsQuoting :: String -> Bool
 needsQuoting s = null r || not (any (null . snd) r)
   where r = readP_to_S parseSimpleIdentifier s
 
+-- | Helper function to quote a given identifier string if necessary.
+--
+-- >>> putStrLn (quote "abc")
+-- abc
+-- >>> putStrLn (quote "abc.def")
+-- "abc.def"
 quote :: String -> String
 quote s = if needsQuoting s then show s else s
diff --git a/src/Language/Nix/Path.hs b/src/Language/Nix/Path.hs
--- a/src/Language/Nix/Path.hs
+++ b/src/Language/Nix/Path.hs
@@ -16,6 +16,9 @@
 import Test.QuickCheck
 import Text.PrettyPrint as PP
 
+-- $setup
+-- >>> import Control.Exception
+
 -- | Paths are non-empty lists of identifiers in Nix.
 --
 -- >>> path # [ident # "yo"]
@@ -23,8 +26,9 @@
 --
 -- Any attempt to construct the empty path throws an 'error':
 --
--- >>> path # []
--- Path *** Exception: Nix paths cannot be empty
+-- >>> :set -XScopedTypeVariables
+-- >>> either (\(_::SomeException) -> "empty paths are illegal") show <$> try (evaluate (path # []))
+-- "empty paths are illegal"
 --
 -- Paths can be pretty-printed and parsed with the 'Text' class:
 --
