diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,10 @@
+1.2.7
+
+* Build against `dhall-1.21.0`
+* Support GHC 7.10.3
+    * See: https://github.com/dhall-lang/dhall-haskell/pull/814
+* Add new `--omitEmpty` flag for omitting nulls and empty records
+
 1.2.6
 
 * Add `--version` flag
diff --git a/dhall-json.cabal b/dhall-json.cabal
--- a/dhall-json.cabal
+++ b/dhall-json.cabal
@@ -1,8 +1,8 @@
 Name: dhall-json
-Version: 1.2.6
+Version: 1.2.7
 Cabal-Version: >=1.8.0.2
 Build-Type: Simple
-Tested-With: GHC == 7.10.2, GHC == 8.0.1
+Tested-With: GHC == 7.10.3, GHC == 8.4.3, GHC == 8.6.1
 License: BSD3
 License-File: LICENSE
 Copyright: 2017 Gabriel Gonzalez
@@ -35,7 +35,7 @@
     Build-Depends:
         base                      >= 4.8.0.0  && < 5   ,
         aeson                     >= 1.0.0.0  && < 1.5 ,
-        dhall                     >= 1.19.0   && < 1.21,
+        dhall                     >= 1.19.0   && < 1.22,
         optparse-applicative      >= 0.14.0.0 && < 0.15,
         text                      >= 0.11.1.0 && < 1.3 ,
         unordered-containers                     < 0.3
@@ -63,6 +63,7 @@
     Main-Is: Main.hs
     Build-Depends:
         base                                   ,
+        aeson                                  ,
         bytestring                       < 0.11,
         dhall                                  ,
         dhall-json                             ,
diff --git a/dhall-to-json/Main.hs b/dhall-to-json/Main.hs
--- a/dhall-to-json/Main.hs
+++ b/dhall-to-json/Main.hs
@@ -1,4 +1,3 @@
-{-# LANGUAGE ApplicativeDo     #-}
 {-# LANGUAGE RecordWildCards   #-}
 {-# LANGUAGE OverloadedStrings #-}
 
@@ -7,6 +6,7 @@
 import Control.Applicative ((<|>))
 import Control.Exception (SomeException)
 import Control.Monad (when)
+import Data.Aeson (Value)
 import Data.Monoid ((<>))
 import Data.Version (showVersion)
 import Dhall.JSON (Conversion)
@@ -29,19 +29,19 @@
 data Options = Options
     { explain    :: Bool
     , pretty     :: Bool
-    , omitNull   :: Bool
+    , omission   :: Value -> Value
     , version    :: Bool
     , conversion :: Conversion
     }
 
 parseOptions :: Parser Options
-parseOptions = Options.Applicative.helper <*> do
-    explain    <- parseExplain
-    pretty     <- parsePretty
-    omitNull   <- parseOmitNull
-    version    <- parseVersion
-    conversion <- Dhall.JSON.parseConversion
-    return (Options {..})
+parseOptions =
+        Options
+    <$> parseExplain
+    <*> parsePretty
+    <*> Dhall.JSON.parseOmission
+    <*> parseVersion
+    <*> Dhall.JSON.parseConversion
   where
     parseExplain =
         Options.Applicative.switch
@@ -69,12 +69,6 @@
         defaultBehavior =
             pure False
 
-    parseOmitNull =
-        Options.Applicative.switch
-            (   Options.Applicative.long "omitNull"
-            <>  Options.Applicative.help "Omit record fields that are null"
-            )
-
     parseVersion =
         Options.Applicative.switch
             (   Options.Applicative.long "version"
@@ -84,7 +78,7 @@
 parserInfo :: ParserInfo Options
 parserInfo =
     Options.Applicative.info
-        parseOptions
+        (Options.Applicative.helper <*> parseOptions)
         (   Options.Applicative.fullDesc
         <>  Options.Applicative.progDesc "Compile Dhall to JSON"
         )
@@ -112,11 +106,9 @@
 
         let explaining = if explain then Dhall.detailed else id
 
-        let omittingNull = if omitNull then Dhall.JSON.omitNull else id
-
         stdin <- Data.Text.IO.getContents
 
-        json <- omittingNull <$> explaining (Dhall.JSON.codeToValue conversion "(stdin)" stdin)
+        json <- omission <$> explaining (Dhall.JSON.codeToValue conversion "(stdin)" stdin)
 
         Data.ByteString.Char8.putStrLn $ Data.ByteString.Lazy.toStrict $ encode json
 
diff --git a/dhall-to-yaml/Main.hs b/dhall-to-yaml/Main.hs
--- a/dhall-to-yaml/Main.hs
+++ b/dhall-to-yaml/Main.hs
@@ -1,10 +1,10 @@
-{-# LANGUAGE ApplicativeDo     #-}
 {-# LANGUAGE OverloadedStrings #-}
 {-# LANGUAGE RecordWildCards   #-}
 
 module Main where
 
 import Control.Exception (SomeException)
+import Data.Aeson (Value)
 import Data.Monoid ((<>))
 import Dhall.JSON (Conversion)
 import Options.Applicative (Parser, ParserInfo)
@@ -23,18 +23,18 @@
 
 data Options = Options
     { explain    :: Bool
-    , omitNull   :: Bool
+    , omission   :: Value -> Value
     , documents  :: Bool
     , conversion :: Conversion
     }
 
 parseOptions :: Parser Options
-parseOptions = Options.Applicative.helper <*> do
-    explain    <- parseExplain
-    omitNull   <- parseOmitNull
-    documents  <- parseDocuments
-    conversion <- Dhall.JSON.parseConversion
-    return (Options {..})
+parseOptions =
+        Options
+    <$> parseExplain
+    <*> Dhall.JSON.parseOmission
+    <*> parseDocuments
+    <*> Dhall.JSON.parseConversion
   where
     parseExplain =
         Options.Applicative.switch
@@ -42,12 +42,6 @@
             <>  Options.Applicative.help "Explain error messages in detail"
             )
 
-    parseOmitNull =
-        Options.Applicative.switch
-            (   Options.Applicative.long "omitNull"
-            <>  Options.Applicative.help "Omit record fields that are null"
-            )
-
     parseDocuments =
         Options.Applicative.switch
             (   Options.Applicative.long "documents"
@@ -57,7 +51,7 @@
 parserInfo :: ParserInfo Options
 parserInfo =
     Options.Applicative.info
-        parseOptions
+        (Options.Applicative.helper <*> parseOptions)
         (   Options.Applicative.fullDesc
         <>  Options.Applicative.progDesc "Compile Dhall to YAML"
         )
@@ -71,11 +65,9 @@
     handle $ do
         let explaining = if explain then Dhall.detailed else id
 
-        let omittingNull = if omitNull then Dhall.JSON.omitNull else id
-
         stdin <- Data.Text.IO.getContents
 
-        json <- omittingNull <$> explaining (Dhall.JSON.codeToValue conversion "(stdin)" stdin)
+        json <- omission <$> explaining (Dhall.JSON.codeToValue conversion "(stdin)" stdin)
 
         let yaml = case (documents, json) of
               (True, Data.Yaml.Array elems)
diff --git a/src/Dhall/JSON.hs b/src/Dhall/JSON.hs
--- a/src/Dhall/JSON.hs
+++ b/src/Dhall/JSON.hs
@@ -1,4 +1,3 @@
-{-# LANGUAGE ApplicativeDo      #-}
 {-# LANGUAGE DeriveDataTypeable #-}
 {-# LANGUAGE OverloadedLists    #-}
 {-# LANGUAGE OverloadedStrings  #-}
@@ -162,6 +161,8 @@
     -- * Dhall to JSON
       dhallToJSON
     , omitNull
+    , omitEmpty
+    , parseOmission
     , Conversion(..)
     , convertToHomogeneousMaps
     , parseConversion
@@ -330,8 +331,9 @@
 
 -- | Omit record fields that are @null@
 omitNull :: Value -> Value
-omitNull (Object object) =
-    Object (fmap omitNull (Data.HashMap.Strict.filter (/= Null) object))
+omitNull (Object object) = Object fields
+  where
+    fields =Data.HashMap.Strict.filter (/= Null) (fmap omitNull object)
 omitNull (Array array) =
     Array (fmap omitNull array)
 omitNull (String string) =
@@ -343,6 +345,40 @@
 omitNull Null =
     Null
 
+{-| Omit record fields that are @null@ or records whose transitive fields are
+    all null
+-}
+omitEmpty :: Value -> Value
+omitEmpty (Object object) =
+    if null fields then Null else Object fields
+  where
+    fields = Data.HashMap.Strict.filter (/= Null) (fmap omitEmpty object)
+omitEmpty (Array array) =
+    Array (fmap omitEmpty array)
+omitEmpty (String string) =
+    String string
+omitEmpty (Number number) =
+    Number number
+omitEmpty (Bool bool) =
+    Bool bool
+omitEmpty Null =
+    Null
+
+-- | Parser for command-line options related to omitting fields
+parseOmission :: Parser (Value -> Value)
+parseOmission =
+        Options.Applicative.flag'
+            omitNull
+            (   Options.Applicative.long "omitNull"
+            <>  Options.Applicative.help "Omit record fields that are null"
+            )
+    <|> Options.Applicative.flag'
+            omitEmpty
+            (   Options.Applicative.long "omitEmpty"
+            <>  Options.Applicative.help "Omit record fields that are null or empty records"
+            )
+    <|> pure id
+
 {-| Specify whether or not to convert association lists of type
     @List { mapKey: Text, mapValue : v }@ to records
 -}
@@ -518,6 +554,9 @@
             a' = loop a
             b' = loop b
 
+        Dhall.Core.TextShow ->
+            Dhall.Core.TextShow
+
         Dhall.Core.List ->
             Dhall.Core.List
 
@@ -665,11 +704,6 @@
             b' =      loop b
             c' = fmap loop c
 
-        Dhall.Core.Constructors a ->
-            Dhall.Core.Constructors a'
-          where
-            a' = loop a
-
         Dhall.Core.Field a b ->
             Dhall.Core.Field a' b
           where
@@ -694,15 +728,13 @@
         Dhall.Core.Embed a ->
             Dhall.Core.Embed a
 
+-- | Parser for command-line options related to homogeneous map support
 parseConversion :: Parser Conversion
 parseConversion =
         conversion
     <|> noConversion
   where
-    conversion = do
-        mapKey   <- parseKeyField
-        mapValue <- parseValueField
-        return (Conversion {..})
+    conversion = Conversion <$> parseKeyField <*> parseValueField
       where
         parseKeyField =
             Options.Applicative.strOption
