Skip to content

Move normalization code from Dhall.Core to a new module Dhall.Normalize #1452

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 30 additions & 29 deletions dhall/dhall.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -484,41 +484,42 @@ Library
TemplateHaskell

Exposed-Modules:
Dhall,
Dhall.Binary,
Dhall.Context,
Dhall.Core,
Dhall.Crypto,
Dhall.Diff,
Dhall.Tags,
Dhall.Format,
Dhall.Freeze,
Dhall.Import,
Dhall.Lint,
Dhall.Main,
Dhall.Map,
Dhall.Optics,
Dhall.Set,
Dhall.Src,
Dhall.Parser,
Dhall.Parser.Expression,
Dhall.Parser.Token,
Dhall.Pretty,
Dhall.Repl,
Dhall.Tutorial,
Dhall.TypeCheck,
Dhall
Dhall.Binary
Dhall.Context
Dhall.Core
Dhall.Crypto
Dhall.Diff
Dhall.Format
Dhall.Freeze
Dhall.Import
Dhall.Lint
Dhall.Main
Dhall.Map
Dhall.Optics
Dhall.Parser
Dhall.Parser.Expression
Dhall.Parser.Token
Dhall.Pretty
Dhall.Repl
Dhall.Set
Dhall.Src
Dhall.Tags
Dhall.Tutorial
Dhall.TypeCheck
Dhall.Util
Dhall.Version
if !flag(cross)
Exposed-Modules:
Dhall.TH
Other-Modules:
Dhall.Pretty.Internal,
Dhall.Parser.Combinators,
Dhall.URL,
Dhall.Import.Types,
Dhall.Syntax,
Dhall.Eval,
Dhall.Eval
Dhall.Import.Types
Dhall.Normalize
Dhall.Parser.Combinators
Dhall.Pretty.Internal
Dhall.Syntax
Dhall.URL
Paths_dhall
Autogen-Modules:
Paths_dhall
Expand Down
2 changes: 1 addition & 1 deletion dhall/src/Dhall.hs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ import Data.Typeable (Typeable)
import Data.Vector (Vector)
import Data.Void (Void)
import Data.Word (Word8, Word16, Word32, Word64)
import Dhall.Core (Expr(..), Chunks(..), DhallDouble(..))
import Dhall.Syntax (Expr(..), Chunks(..), DhallDouble(..))
import Dhall.Import (Imported(..))
import Dhall.Parser (Src(..))
import Dhall.TypeCheck (DetailedTypeError(..), TypeError)
Expand Down
8 changes: 4 additions & 4 deletions dhall/src/Dhall/Binary.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module Dhall.Binary
import Codec.CBOR.Term (Term(..))
import Control.Applicative (empty, (<|>))
import Control.Exception (Exception)
import Dhall.Core
import Dhall.Syntax
( Binding(..)
, Chunks(..)
, Const(..)
Expand Down Expand Up @@ -55,7 +55,7 @@ import qualified Control.Monad as Monad
import qualified Data.ByteArray
import qualified Data.ByteString
import qualified Data.Sequence
import qualified Dhall.Core
import qualified Dhall.Syntax
import qualified Dhall.Crypto
import qualified Dhall.Map
import qualified Dhall.Set
Expand Down Expand Up @@ -375,7 +375,7 @@ instance ToTerm a => ToTerm (Expr Void a) where
encode (Let a b) =
TList ([ TInt 25 ] ++ as₁ ++ [ b₁ ])
where
MultiLet as₀ b₀ = Dhall.Core.multiLet a b
MultiLet as₀ b₀ = Dhall.Syntax.multiLet a b

as₁ = do
Binding _ x₀ _ mA₀ _ a₀ <- toList as₀
Expand Down Expand Up @@ -922,7 +922,7 @@ strip55799Tag term =
-- This 'Dhall.Core.denote's the expression before encoding it. To encode an
-- already denoted expression, it is more efficient to directly use 'encode'.
encodeExpression :: Expr s Import -> Term
encodeExpression e = encode (Dhall.Core.denote e :: Expr Void Import)
encodeExpression e = encode (Dhall.Syntax.denote e :: Expr Void Import)

-- | Decode a Dhall expression from a CBOR `Term`
decodeExpression :: FromTerm a => Term -> Either DecodingFailure (Expr s a)
Expand Down
Loading