diff --git a/Data/Text/Format/Heavy/Instances.hs b/Data/Text/Format/Heavy/Instances.hs
--- a/Data/Text/Format/Heavy/Instances.hs
+++ b/Data/Text/Format/Heavy/Instances.hs
@@ -16,6 +16,7 @@
 import Data.Word
 import Data.Int
 import Data.Maybe
+import Data.List (union)
 import qualified Data.Map as M
 import qualified Data.Text as T
 import qualified Data.Text.Encoding as TE
@@ -204,19 +205,32 @@
   lookupVar "0" (Single x) = Just $ Variable x
   lookupVar _ _ = Nothing
 
+instance Formatable a => ClosedVarContainer (Single a) where
+  allVarNames _ = ["0"]
+
 instance VarContainer () where
   lookupVar _ _ = Nothing
 
+instance ClosedVarContainer () where
+  allVarNames _ = []
+
 -- | Maybe container contains one variable (named 0); Nothing contains an empty string.
 instance Formatable a => VarContainer (Maybe a) where
   lookupVar "0" (Just x) = Just $ Variable x
   lookupVar "0" Nothing = Just $ Variable ()
   lookupVar _ _ = Nothing
 
+instance Formatable a => ClosedVarContainer (Maybe a) where
+  allVarNames Nothing = []
+  allVarNames (Just _) = ["0"]
+
 instance (Formatable a, Formatable b) => VarContainer (a, b) where
   lookupVar "0" (a,_) = Just $ Variable a
   lookupVar "1" (_,b) = Just $ Variable b
   lookupVar _ _ = Nothing
+
+instance (Formatable a, Formatable b) => ClosedVarContainer (a, b) where
+  allVarNames _ = ["0", "1"]
   
 instance (Formatable a, Formatable b, Formatable c) => VarContainer (a, b, c) where
   lookupVar "0" (a,_,_) = Just $ Variable a
@@ -224,6 +238,9 @@
   lookupVar "2" (_,_,c) = Just $ Variable c
   lookupVar _ _ = Nothing
   
+instance (Formatable a, Formatable b, Formatable c) => ClosedVarContainer (a, b, c) where
+  allVarNames _ = ["0", "1", "2"]
+
 instance (Formatable a, Formatable b, Formatable c, Formatable d) => VarContainer (a, b, c, d) where
   lookupVar "0" (a,_,_,_) = Just $ Variable a
   lookupVar "1" (_,b,_,_) = Just $ Variable b
@@ -231,6 +248,9 @@
   lookupVar "3" (_,_,_,d) = Just $ Variable d
   lookupVar _ _ = Nothing
 
+instance (Formatable a, Formatable b, Formatable c, Formatable d) => ClosedVarContainer (a, b, c, d) where
+  allVarNames _ = ["0", "1", "2", "3"]
+
 instance (Formatable a, Formatable b, Formatable c, Formatable d, Formatable e)
      => VarContainer (a, b, c, d, e) where
   lookupVar "0" (a,_,_,_,_) = Just $ Variable a
@@ -240,6 +260,10 @@
   lookupVar "4" (_,_,_,_,e) = Just $ Variable e
   lookupVar _ _ = Nothing
 
+instance (Formatable a, Formatable b, Formatable c, Formatable d, Formatable e)
+     => ClosedVarContainer (a, b, c, d, e) where
+  allVarNames _ = ["0", "1", "2", "3", "4"]
+
 instance (Formatable a, Formatable b, Formatable c, Formatable d, Formatable e, Formatable f)
      => VarContainer (a, b, c, d, e, f) where
   lookupVar "0" (a,_,_,_,_,_) = Just $ Variable a
@@ -250,6 +274,10 @@
   lookupVar "5" (_,_,_,_,_,f) = Just $ Variable f
   lookupVar _ _ = Nothing
 
+instance (Formatable a, Formatable b, Formatable c, Formatable d, Formatable e, Formatable f)
+     => ClosedVarContainer (a, b, c, d, e, f) where
+  allVarNames _ = ["0", "1", "2", "3", "4", "5"]
+
 instance (Formatable a, Formatable b, Formatable c, Formatable d, Formatable e, Formatable f, Formatable g)
      => VarContainer (a, b, c, d, e, f, g) where
   lookupVar "0" (a,_,_,_,_,_,_) = Just $ Variable a
@@ -261,6 +289,10 @@
   lookupVar "6" (_,_,_,_,_,_,g) = Just $ Variable g
   lookupVar _ _ = Nothing
 
+instance (Formatable a, Formatable b, Formatable c, Formatable d, Formatable e, Formatable f, Formatable g)
+     => ClosedVarContainer (a, b, c, d, e, f, g) where
+  allVarNames _ = ["0", "1", "2", "3", "4", "5", "6"]
+
 instance (Formatable a, Formatable b, Formatable c, Formatable d, Formatable e, Formatable f, Formatable g,
           Formatable h)
      => VarContainer (a, b, c, d, e, f, g, h) where
@@ -275,6 +307,11 @@
   lookupVar _ _ = Nothing
 
 instance (Formatable a, Formatable b, Formatable c, Formatable d, Formatable e, Formatable f, Formatable g,
+          Formatable h)
+     => ClosedVarContainer (a, b, c, d, e, f, g, h) where
+  allVarNames _ = ["0", "1", "2", "3", "4", "5", "6", "7"]
+
+instance (Formatable a, Formatable b, Formatable c, Formatable d, Formatable e, Formatable f, Formatable g,
           Formatable h, Formatable i)
      => VarContainer (a, b, c, d, e, f, g, h, i) where
   lookupVar "0" (a,_,_,_,_,_,_,_,_) = Just $ Variable a
@@ -289,6 +326,11 @@
   lookupVar _ _ = Nothing
 
 instance (Formatable a, Formatable b, Formatable c, Formatable d, Formatable e, Formatable f, Formatable g,
+          Formatable h, Formatable i)
+     => ClosedVarContainer (a, b, c, d, e, f, g, h, i) where
+  allVarNames _ = ["0", "1", "2", "3", "4", "5", "6", "7", "8"]
+
+instance (Formatable a, Formatable b, Formatable c, Formatable d, Formatable e, Formatable f, Formatable g,
           Formatable h, Formatable i, Formatable j)
      => VarContainer (a, b, c, d, e, f, g, h, i, j) where
   lookupVar "0" (a,_,_,_,_,_,_,_,_,_) = Just $ Variable a
@@ -303,6 +345,11 @@
   lookupVar "9" (_,_,_,_,_,_,_,_,_,j) = Just $ Variable j
   lookupVar _ _ = Nothing
 
+instance (Formatable a, Formatable b, Formatable c, Formatable d, Formatable e, Formatable f, Formatable g,
+          Formatable h, Formatable i, Formatable j)
+     => ClosedVarContainer (a, b, c, d, e, f, g, h, i, j) where
+  allVarNames _ = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
+
 instance Formatable a => VarContainer (Several a) where
   lookupVar name (Several lst) =
     if not $ TL.all isDigit name
@@ -312,12 +359,21 @@
                then Nothing
                else Just $ Variable (lst !! n)
   
+instance Formatable a => ClosedVarContainer (Several a) where
+  allVarNames (Several lst) = map (TL.pack . show) [0 .. length lst - 1]
+
 instance Formatable x => VarContainer [(TL.Text, x)] where
   lookupVar name pairs = Variable `fmap` lookup name pairs
 
+instance Formatable x => ClosedVarContainer [(TL.Text, x)] where
+  allVarNames pairs = map fst pairs
+
 instance Formatable x => VarContainer (M.Map TL.Text x) where
   lookupVar name pairs = Variable `fmap` M.lookup name pairs
 
+instance Formatable x => ClosedVarContainer (M.Map TL.Text x) where
+  allVarNames pairs = M.keys pairs
+
 -- | Variable container which contains fixed value for any variable name.
 data DefaultValue = DefaultValue Variable
 
@@ -336,6 +392,10 @@
     case lookupVar name c1 of
       Just result -> Just result
       Nothing -> lookupVar name c2
+
+instance (ClosedVarContainer c1, ClosedVarContainer c2) => ClosedVarContainer (ThenCheck c1 c2) where
+  allVarNames (ThenCheck c1 c2) =
+    allVarNames c1 `union` allVarNames c2
 
 -- | Use variables from specified container, or use default value if
 -- variable is not found in container.
diff --git a/Data/Text/Format/Heavy/Types.hs b/Data/Text/Format/Heavy/Types.hs
--- a/Data/Text/Format/Heavy/Types.hs
+++ b/Data/Text/Format/Heavy/Types.hs
@@ -78,5 +78,8 @@
 class VarContainer c where
   lookupVar :: VarName -> c -> Maybe Variable
 
+class VarContainer c => ClosedVarContainer c where
+  allVarNames :: c -> [VarName]
+
 ------------------------------------------------------------------------------
 
diff --git a/text-format-heavy.cabal b/text-format-heavy.cabal
--- a/text-format-heavy.cabal
+++ b/text-format-heavy.cabal
@@ -1,5 +1,5 @@
 name:                text-format-heavy
-version:             0.1.5.0
+version:             0.1.5.1
 synopsis:            Full-weight string formatting library, analog of Python's string.format
 description:         This package contains full-featured string formatting function, similar to
                      Python's string.format. Features include:
