Skip to content

Commit

Permalink
Remove nulls from generated JSON
Browse files Browse the repository at this point in the history
Fixes #39.
  • Loading branch information
sellout committed May 20, 2024
1 parent a1b799e commit 502aba6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/Hpack/Dhall.hs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import Dhall.Core (Expr)
import Dhall.Parser (Src, exprFromText)
import Dhall.Import (loadWith, emptyStatus)
import Dhall.TypeCheck (typeOf)
import Dhall.JSON (dhallToJSON)
import Dhall.JSON (dhallToJSON, omitNull)
import Dhall.Pretty (prettyExpr, layoutOpts)
import qualified Prettyprinter as PP
import qualified Prettyprinter.Render.Text as PP
Expand Down Expand Up @@ -129,7 +129,7 @@ textToJson
textToJson settings text = runExceptT $ do
expr <- liftIO $ check settings text
_ <- liftResult $ typeOf expr
liftResult $ ([],) <$> dhallToJSON expr
liftResult $ ([],) . omitNull <$> dhallToJSON expr
where
liftResult :: (Show b, Monad m) => Either b a -> ExceptT String m a
liftResult = ExceptT . return . first show
Expand Down

0 comments on commit 502aba6

Please sign in to comment.