diff --git a/src/Language/Lexer/Tlex.hs b/src/Language/Lexer/Tlex.hs
--- a/src/Language/Lexer/Tlex.hs
+++ b/src/Language/Lexer/Tlex.hs
@@ -17,7 +17,7 @@
 import qualified Language.Lexer.Tlex.Pipeline.Scanner2Nfa as TlexPipeline
 
 
-buildRunner :: Enum e => Scanner e a -> Runner e a
+buildRunner :: Enum unit => Scanner unit action -> Runner unit action
 buildRunner scanner =
     let nfa = NFA.buildNFA do TlexPipeline.scanner2Nfa scanner
         dfa = TlexPipeline.nfa2Dfa nfa
diff --git a/src/Language/Lexer/Tlex/Runner.hs b/src/Language/Lexer/Tlex/Runner.hs
--- a/src/Language/Lexer/Tlex/Runner.hs
+++ b/src/Language/Lexer/Tlex/Runner.hs
@@ -8,28 +8,35 @@
 import           Language.Lexer.Tlex.Prelude
 
 
-class (Enum e, Monad m) => TlexContext p e m | m -> p, m -> e where
-    tlexGetInputPart :: m (Maybe e)
-    tlexGetMark :: m p
+class (Enum unit, Monad m) => TlexContext mark unit m | m -> mark, m -> unit where
+    -- | Get a unit of current position from input, and move to next position.
+    tlexGetInputPart :: m (Maybe unit)
 
-data TlexResult p a
+    -- | Get a mark of current position.
+    tlexGetMark :: m mark
+
+data TlexResult mark action
     = TlexEndOfInput
+    -- ^ No more inputs.
     | TlexError
-    | TlexAccepted p a
+    -- ^ Some inputs are available, but not accepted.
+    | TlexAccepted mark action
+    -- ^ Accepted with a end position and an action.
     deriving (Eq, Show)
 
 
-data Runner e a = Runner
+data Runner unit action = Runner
     { tlexInitial :: Int -> Int
     -- ^ StartState -> (StateNum | -1)
-    , tlexAccept  :: Int -> Maybe a
+    , tlexAccept  :: Int -> Maybe action
     -- ^ StateNum -> Maybe Action
     , tlexTrans   :: Int -> Int -> Int
     -- ^ StateNum -> CodeUnit -> (StateNum | -1)
     }
     deriving Functor
 
-runRunner :: Enum s => TlexContext p c m => Runner c a -> s -> m (TlexResult p a)
+runRunner :: Enum state => TlexContext mark unit m
+    => Runner unit action -> state -> m (TlexResult mark action)
 runRunner runner s0 = case tlexInitial runner do fromEnum s0 of
         -1 -> error "unknown initial state"
         s  -> go s
diff --git a/src/Language/Lexer/Tlex/Syntax.hs b/src/Language/Lexer/Tlex/Syntax.hs
--- a/src/Language/Lexer/Tlex/Syntax.hs
+++ b/src/Language/Lexer/Tlex/Syntax.hs
@@ -24,53 +24,59 @@
 import qualified Language.Lexer.Tlex.Machine.Pattern as Pattern
 
 
-newtype Scanner e a = Scanner
-    { scannerRules :: [ScanRule e a]
+newtype Scanner unit action = Scanner
+    { scannerRules :: [ScanRule unit action]
     }
     deriving (Eq, Show, Functor)
 
-data ScanRule e a = ScanRule
+data ScanRule unit action = ScanRule
     { scanRuleStartStates    :: [Pattern.StartState]
-    , scanRulePattern        :: Pattern.Pattern e
-    , scanRuleSemanticAction :: a
+    , scanRulePattern        :: Pattern.Pattern unit
+    , scanRuleSemanticAction :: action
     }
     deriving (Eq, Show, Functor)
 
 
-buildScanner :: Enum e => ScannerBuilder s e f () -> Scanner e f
+buildScanner :: Enum unit
+    => ScannerBuilder state unit action () -> Scanner unit action
 buildScanner builder = Scanner
     { scannerRules = unScannerBuilderContext
         do execState builder do ScannerBuilderContext []
     }
 
-newtype ScannerBuilderContext s e f = ScannerBuilderContext
-    { unScannerBuilderContext :: [ScanRule e f]
+newtype ScannerBuilderContext state unit action = ScannerBuilderContext
+    { unScannerBuilderContext :: [ScanRule unit action]
     }
     deriving (Eq, Show, Functor)
 
-type ScannerBuilder s e f = State (ScannerBuilderContext s e f)
+type ScannerBuilder state unit action = State (ScannerBuilderContext state unit action)
 
-lexRule :: Enum s => Enum e
-    => [s] -> Pattern.Pattern e -> f -> ScannerBuilder s e f ()
+lexRule :: Enum state => Enum unit
+    => [state] -> Pattern.Pattern unit -> action -> ScannerBuilder state unit action ()
 lexRule ss p act = modify' \(ScannerBuilderContext rs0) ->
     ScannerBuilderContext
         do ScanRule [Pattern.startStateFromEnum s | s <- ss] p act:rs0
 
 
-anyoneP :: Enum e => Pattern.Pattern e
+-- | Wildcard pattern which accepts an any unit.
+anyoneP :: Enum unit => Pattern.Pattern unit
 anyoneP = Pattern.Range SymEnumSet.full
 
-maybeP :: Enum e => Pattern.Pattern e -> Pattern.Pattern e
+-- | Maybe pattern which accepts given pattern or nothing.
+maybeP :: Enum unit => Pattern.Pattern unit -> Pattern.Pattern unit
 maybeP x = orP [x, Pattern.Epsilon]
 
-someP :: Enum e => Pattern.Pattern e -> Pattern.Pattern e
+-- | Some pattern which accepts one given pattern or more times.
+someP :: Enum unit => Pattern.Pattern unit -> Pattern.Pattern unit
 someP x = x <> Pattern.Many x
 
-manyP :: Enum e => Pattern.Pattern e -> Pattern.Pattern e
+-- | Many pattern which accepts nothing or given pattern more times.
+manyP :: Enum unit => Pattern.Pattern unit -> Pattern.Pattern unit
 manyP x = Pattern.Many x
 
-{-# INLINE orP #-}
-orP :: Enum e => [Pattern.Pattern e] -> Pattern.Pattern e
+-- | Or pattern which accepts one of given patterns.
+orP :: Enum unit => [Pattern.Pattern unit] -> Pattern.Pattern unit
 orP = \case
   []   -> Pattern.Epsilon
   p:ps -> foldr (Pattern.:|:) p ps
+{-# INLINE orP #-}
diff --git a/tlex.cabal b/tlex.cabal
--- a/tlex.cabal
+++ b/tlex.cabal
@@ -2,12 +2,12 @@
 build-type:          Custom
 
 name:                tlex
-version:             0.4.0.0
+version:             0.4.0.1
 license:             Apache-2.0 OR MPL-2.0
 license-file:        LICENSE
 copyright:           (c) 2020 Mizunashi Mana
 author:              Mizunashi Mana
-maintainer:          mizunashi-mana@noreply.git
+maintainer:          contact@mizunashi.work
 
 category:            Parsing
 homepage:            https://github.com/mizunashi-mana/tlex
