diff --git a/LICENSE b/LICENSE index 64ae5e82c..d240dd1fc 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2017 Gabriel Gonzalez +Copyright (c) 2018 Gabriel Gonzalez All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/README.md b/README.md index a5a1a19ac..cf6b3a903 100644 --- a/README.md +++ b/README.md @@ -1,142 +1,25 @@ -# `dhall 1.18.0` +# `dhall-haskell` -Dhall is a programmable configuration language that is not Turing-complete +This repository is a shared repository for all of the `dhall-*` Haskell +packages, including: -You can think of Dhall as: JSON + functions + types + imports +* [`dhall`](./dhall) +* [`dhall-bash`](./dhall-bash) +* [`dhall-json`](./dhall-json) +* [`dhall-text`](./dhall-text) -You will probably want to read the language-agnostic README here: +Navigate to each package's directory for their respective `README`s -* [`dhall-lang` `README`](https://github.com/dhall-lang/dhall-lang/blob/master/README.md) +# Quick start -This repository (and this `README`) focuses on the Haskell implementation of -Dhall +You can build all of the packages by running: -## Motivation - -*"Why not configure my program using JSON or YAML?"* - -JSON or YAML are suitable for small configuration files, but larger -configuration files with complex schemas require programming language features -to reduce repetition. Otherwise, the repetitive configuration files become -error-prone and difficult to maintain/migrate. - -This post explains in more detail the motivation behind programmable -configuration files: - -* [Programmable configuration files](https://github.com/dhall-lang/dhall-lang/wiki/Programmable-configuration-files) - -*"Why not configure my program using Haskell code?"* - -You probably don't want to rebuild your program every time you make a -configuration change. Recompilation is slow and requires the GHC toolchain -to be installed anywhere you want to make configuration changes. - -## Quick start - -Given this Haskell program saved to `example.hs`: - -```haskell --- example.hs - -{-# LANGUAGE DeriveGeneric #-} -{-# LANGUAGE OverloadedStrings #-} - -import Dhall - -data Example = Example { foo :: Integer, bar :: Vector Double } - deriving (Generic, Show) - -instance Interpret Example - -main :: IO () -main = do - x <- input auto "./config" - print (x :: Example) -``` - -... which reads in this configuration file: - -```bash -$ cat ./config -{ foo = 1 -, bar = ./bar -} -``` - -... which in turn references this other file: - -``` -$ cat ./bar -[3.0, 4.0, 5.0] ``` - -... you can interpret the Haskell program like this: - -```bash -$ nix-shell nix/test-dhall.nix -[nix-shell]$ runghc example.hs -Example {foo = 1, bar = [3.0,4.0,5.0]} -``` - -You can also interpret Dhall programs directly using the installed command-line -compiler: - -```bash -$ dhall -List/head Double ./bar - -Optional Double - -Some 3.0 -``` - -... and you can reference remote expressions or functions by their URL, too: - -```bash -$ dhall -let null = https://raw.githubusercontent.com/dhall-lang/Prelude/35deff0d41f2bf86c42089c6ca16665537f54d75/List/null -in null Double ./bar - -Bool - -False -``` - -Now go read the -[Dhall tutorial](https://hackage.haskell.org/package/dhall/docs/Dhall-Tutorial.html) -to learn more - -## Building this project - -Nix + Cabal is the recommended workflow for project development since continuous -integration uses Nix to build and test the project. Other development tools and -workflows are also supported on a best-effort basis. - -You can build the project using only Nix by running this command from the root -of the repository: - -```bash $ nix-build ``` -More commonly, you will want to incrementally build the project using `cabal`. -You can either do so inside of a `nix-shell`: - -```bash -$ nix-shell -[nix-shell]$ cabal configure -[nix-shell]$ cabal build -[nix-shell]$ cabal test -``` - -... or you can add `nix: True` to your `~/.cabal/config` file and then you can -run the same `cabal` commands without an explicit `nix-shell`: - -```bash -$ cabal configure -$ cabal build -$ cabal test -``` +... or you can run `nix-build` within each package's respective directory to +build just that one package. ## Development status diff --git a/default.nix b/default.nix index 61041724d..6fa14a51e 100644 --- a/default.nix +++ b/default.nix @@ -1 +1,5 @@ -(import ./shared.nix {}).dhall +let + shared = import ./nix/shared.nix {}; + +in + { inherit (shared) dhall dhall-bash dhall-json dhall-text; } diff --git a/dhall-bash/LICENSE b/dhall-bash/LICENSE new file mode 100644 index 000000000..d240dd1fc --- /dev/null +++ b/dhall-bash/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2018 Gabriel Gonzalez +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +3. Neither the name of the author nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/dhall-bash/README.md b/dhall-bash/README.md new file mode 100644 index 000000000..0422781a0 --- /dev/null +++ b/dhall-bash/README.md @@ -0,0 +1,34 @@ +# `dhall-bash 1.0.16` + +[![Hackage](https://img.shields.io/hackage/v/dhall-bash.svg)](https://hackage.haskell.org/package/dhall-bash) + +This `dhall-bash` package provides a Dhall to Bash compiler so that you can +easily marshall Dhall values into your Bash scripts + +This does not compile all available Dhall language constructs into Bash and +only supports extracting primitive values, lists, optional values and records +from normalized expressions. + +## Quick start + +If you have Nix installed, then you can build and install this package using: + +```bash +$ nix-env --install --file default.nix +$ dhall-to-bash <<< '1' +1 +$ dhall-to-bash <<< '"ABC" ++ "DEF"' +ABCDEF +$ dhall-to-bash --declare FOO <<< '"ABC" ++ "DEF"' +declare -r FOO=ABCDEF +$ eval $(dhall-to-bash --declare FOO <<< '"ABC" ++ "DEF"') +$ echo "${FOO}" +ABCDEF +$ dhall-to-bash --declare BAR +let replicate = https://ipfs.io/ipfs/QmcTbCdS21pCxXysTzEiucDuwwLWbLUWNSKwkJVfwpy2zK/Prelude/List/replicate +in replicate +10 Integer 1 + +declare -r -a BAR=(1 1 1 1 1 1 1 1 1 1) +$ dhall-to-bash --declare BAZ <<< '{ qux = 1, xyzzy = True }' +declare -r -A BAZ=([qux]=1 [xyzzy]=true) +``` diff --git a/Setup.hs b/dhall-bash/Setup.hs similarity index 100% rename from Setup.hs rename to dhall-bash/Setup.hs diff --git a/dhall-bash/default.nix b/dhall-bash/default.nix new file mode 100644 index 000000000..9c06d3d75 --- /dev/null +++ b/dhall-bash/default.nix @@ -0,0 +1 @@ +(import ../nix/shared.nix {}).dhall-bash diff --git a/dhall-bash/dhall-bash.cabal b/dhall-bash/dhall-bash.cabal new file mode 100644 index 000000000..7952dd59a --- /dev/null +++ b/dhall-bash/dhall-bash.cabal @@ -0,0 +1,51 @@ +Name: dhall-bash +Version: 1.0.16 +Cabal-Version: >=1.8.0.2 +Build-Type: Simple +Tested-With: GHC == 7.10.2, GHC == 8.0.1 +License: BSD3 +License-File: LICENSE +Copyright: 2017 Gabriel Gonzalez +Author: Gabriel Gonzalez +Maintainer: Gabriel439@gmail.com +Bug-Reports: https://github.com/dhall-lang/dhall-haskell/issues +Synopsis: Compile Dhall to Bash +Description: + Use this package if you want to compile Dhall expressions to Bash. + You can use this package as a library or an executable: + . + * See the "Dhall.Bash" module if you want to use this package as a library + . + * Use the @dhall-to-bash@ if you want an executable + . + The "Dhall.Bash" module also contains instructions for how to use this + package +Category: Compiler +Source-Repository head + Type: git + Location: https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-bash + +Library + Hs-Source-Dirs: src + Build-Depends: + base >= 4.8.0.0 && < 5 , + bytestring < 0.11, + containers < 0.6 , + dhall >= 1.18.0 && < 1.19, + neat-interpolation < 0.4 , + shell-escape < 0.3 , + text >= 0.2 && < 1.3 + Exposed-Modules: Dhall.Bash + GHC-Options: -Wall + +Executable dhall-to-bash + Hs-Source-Dirs: exec + Main-Is: Main.hs + Build-Depends: + base , + bytestring , + dhall , + dhall-bash , + optparse-generic >= 1.1.1 && < 1.4 , + text + GHC-Options: -Wall diff --git a/dhall-bash/exec/Main.hs b/dhall-bash/exec/Main.hs new file mode 100644 index 000000000..ed8081e0f --- /dev/null +++ b/dhall-bash/exec/Main.hs @@ -0,0 +1,73 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE DeriveAnyClass #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE TypeOperators #-} + +module Main where + +import Control.Exception (SomeException) +import Data.ByteString (ByteString) +import Options.Generic (Generic, ParseRecord, type ()(..)) +import System.Exit (ExitCode(..)) + +import qualified Control.Exception +import qualified Data.ByteString +import qualified Data.Text.IO +import qualified Dhall +import qualified Dhall.Bash +import qualified Dhall.Import +import qualified Dhall.Parser +import qualified Dhall.TypeCheck +import qualified GHC.IO.Encoding +import qualified Options.Generic +import qualified System.Exit +import qualified System.IO + +data Options = Options + { explain :: Bool + "Explain error messages in detail" + , declare :: Maybe ByteString + "Declare the given variable as a statement instead of an expression" + } deriving (Generic, ParseRecord) + +main :: IO () +main = do + GHC.IO.Encoding.setLocaleEncoding GHC.IO.Encoding.utf8 + Options {..} <- Options.Generic.getRecord "Compile Dhall to Bash" + + (if unHelpful explain then Dhall.detailed else id) (handle (do + inText <- Data.Text.IO.getContents + + expr <- case Dhall.Parser.exprFromText "(stdin)" inText of + Left err -> Control.Exception.throwIO err + Right expr -> return expr + + expr' <- Dhall.Import.load expr + case Dhall.TypeCheck.typeOf expr' of + Left err -> Control.Exception.throwIO err + Right _ -> return () + + bytes <- case unHelpful declare of + Nothing -> do + case Dhall.Bash.dhallToExpression expr' of + Left err -> Control.Exception.throwIO err + Right bytes -> return bytes + Just var -> do + case Dhall.Bash.dhallToStatement expr' var of + Left err -> Control.Exception.throwIO err + Right bytes -> return bytes + Data.ByteString.putStr bytes )) + +handle :: IO a -> IO a +handle = Control.Exception.handle handler + where + handler :: SomeException -> IO a + handler e = case Control.Exception.fromException e of + Just ExitSuccess -> do + Control.Exception.throwIO e + _ -> do + System.IO.hPutStrLn System.IO.stderr "" + System.IO.hPrint System.IO.stderr e + System.Exit.exitFailure diff --git a/dhall-bash/shell.nix b/dhall-bash/shell.nix new file mode 100644 index 000000000..e21a65993 --- /dev/null +++ b/dhall-bash/shell.nix @@ -0,0 +1 @@ +(import ../nix/shared.nix {}).shell-dhall-bash diff --git a/dhall-bash/src/Dhall/Bash.hs b/dhall-bash/src/Dhall/Bash.hs new file mode 100644 index 000000000..0a421e974 --- /dev/null +++ b/dhall-bash/src/Dhall/Bash.hs @@ -0,0 +1,296 @@ +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE QuasiQuotes #-} + +{-| This library exports two utilities for compiling Dhall expressions to Bash: + + * `dhallToExpression`, which emits a Bash expression (i.e. a valid + right-hand side for an assignment) + + * `dhallToStatement`, which emits a Bash @declare@ or @unset@ statement + suitable for use with `eval` + + `dhallToExpression` only supports the conversion of primitive values, such + as: + + * @Bool@ - which translates to a string that is either @"true"@ or @"false"@ + * @Natural@ - which translates to a Bash integer + * @Integer@ - which translates to a Bash integer + * @Text@ - which translates to a Bash string (properly escaped if necessary) + + The @dhall-to-bash@ executable by default tries to compile Dhall expressions + to Bash expressions using the `dhallToExpression` function. For example: + +> $ dhall-to-bash <<< 'True' +> true +> $ dhall-to-bash <<< 'False' +> false +> $ dhall-to-bash <<< '1' +> 1 +> $ dhall-to-bash <<< '+1' +> 1 +> $ dhall-to-bash <<< '"ABC"' +> ABC +> $ dhall-to-bash <<< '" X "' +> $' X ' +> $ dhall-to-bash <<< 'Natural/even +100' +> true + + The output of `dhallToExpression` is a valid Bash expression that can be + embedded anywhere Bash expressions are valid, such as the right-hand side of + an assignment statement: + +> $ FOO=$(dhall-to-bash <<< 'List/length Integer [1, 2, 3]') +> $ echo "${FOO}" +> 3 + + `dhallToStatement` supports a wider range of expressions by also adding + support for: + + * @Optional@ - which translates to a variable which is either set or unset + * @List@ - which translates to a Bash array + * records - which translate to Bash associative arrays + + The @dhall-to-bash@ executable can emit a statement instead of an expression + if you add the @--declare@ flag specifying which variable to set or unset. + For example: + +> $ dhall-to-bash --declare FOO <<< '[] : Optional Integer' +> unset FOO +> $ dhall-to-bash --declare FOO <<< '[1] : Optional Integer' +> declare -r -i FOO=1 +> $ dhall-to-bash --declare FOO <<< '[[1] : Optional Integer] : Optional (Optional Integer)' +> declare -r -i FOO=1 +> $ dhall-to-bash --declare FOO <<< '[[] : Optional Integer] : Optional (Optional Integer)' +> unset FOO +> $ dhall-to-bash --declare FOO <<< '[1, 2, 3]' +> declare -r -a FOO=(1 2 3) +> $ dhall-to-bash --declare FOO <<< '{ bar = 1, baz = True }' +> declare -r -A FOO=([bar]=1 [baz]=true) + + The output of `dhallToExpression` is either a @declare@ or @unset@ Bash + statement that you can pass to @eval@: + +> $ eval $(dhall-to-bash --declare FOO <<< '{ bar = 1, baz = True }') +> $ echo "${FOO[bar]}" +> 1 +> $ echo "${FOO[baz]}" +> true + + @dhall-to-bash@ declares variables read-only (i.e. @-r@) to prevent you from + accidentally overwriting, deleting or mutating variables: + +> $ eval $(dist/build/dhall-to-bash/dhall-to-bash --declare BAR <<< '1') +> $ echo "${BAR"} +> 1 +> $ unset BAR +> bash: unset: BAR: cannot unset: readonly variable +> $ eval $(dist/build/dhall-to-bash/dhall-to-bash --declare BAR <<< '2') +> bash: declare: BAR: readonly variable + +-} + +module Dhall.Bash ( + -- * Dhall to Bash + dhallToExpression + , dhallToStatement + + -- * Exceptions + , ExpressionError(..) + , StatementError(..) + ) where + +import Control.Exception (Exception) +import Data.Bifunctor (first) +import Data.ByteString +import Data.Monoid ((<>)) +import Data.Typeable (Typeable) +import Dhall.Core (Expr(..), Chunks(..)) +import Dhall.TypeCheck + +import qualified Data.Foldable +import qualified Data.Text +import qualified Data.Text.Encoding +import qualified Dhall.Core +import qualified Dhall.Map +import qualified NeatInterpolation +import qualified Text.ShellEscape + +_ERROR :: Data.Text.Text +_ERROR = "\ESC[1;31mError\ESC[0m" + +{-| This is the exception type for errors that might arise when translating + Dhall expressions to Bash statements + + Because the majority of Dhall language features do not easily translate to + Bash this just returns the expression that failed +-} +data StatementError + = UnsupportedStatement (Expr X X) + | UnsupportedSubexpression (Expr X X) + deriving (Typeable) + +instance Show StatementError where + show (UnsupportedStatement e) = + Data.Text.unpack [NeatInterpolation.text| +$_ERROR: Cannot translate to a Bash statement + +Explanation: Only primitive values, records, ❰List❱s, and ❰Optional❱ values can +be translated from Dhall to a Bash statement + +The following Dhall expression could not be translated to a Bash statement: + +↳ $txt +|] + where + txt = Dhall.Core.pretty e + + show (UnsupportedSubexpression e) = + -- Carefully note: No tip suggesting `--declare` since it won't work + -- here (and the user is already using `--declare`) + Data.Text.unpack [NeatInterpolation.text| +$_ERROR: Cannot translate to a Bash expression + +Explanation: Only primitive values can be translated from Dhall to a Bash +expression + +The following Dhall expression could not be translated to a Bash expression: + +↳ $txt +|] + where + txt = Dhall.Core.pretty e + +instance Exception StatementError + +{-| This is the exception type for errors that might arise when translating + Dhall expressions to Bash expressions + + Because the majority of Dhall language features do not easily translate to + Bash this just returns the expression that failed +-} +data ExpressionError = UnsupportedExpression (Expr X X) deriving (Typeable) + +instance Show ExpressionError where + show (UnsupportedExpression e) = + Data.Text.unpack [NeatInterpolation.text| +$_ERROR: Cannot translate to a Bash expression + +Explanation: Only primitive values can be translated from Dhall to a Bash +expression + +The following Dhall expression could not be translated to a Bash expression: + +↳ $txt$tip +|] + where + txt = Dhall.Core.pretty e + + tip = case e of + OptionalLit _ _ -> "\n\n" <> [NeatInterpolation.text| +Tip: You can convert an ❰Optional❱ value to a Bash statement using the --declare +flag +|] + ListLit _ _ -> "\n\n" <> [NeatInterpolation.text| +Tip: You can convert a ❰List❱ to a Bash statement using the --declare flag +|] + RecordLit _ -> "\n\n" <> [NeatInterpolation.text| +Tip: You can convert a record to a Bash statement using the --declare flag +|] + _ -> "" + +instance Exception ExpressionError + +{-| Compile a Dhall expression to a Bash statement that @declare@s or @unset@s a + a variable of your choice + + This only supports: + + * @Bool@s + * @Natural@s + * @Integer@s + * @Text@s + * @Optional@s + * @List@s + * records + -} +dhallToStatement + :: Expr s X + -- ^ Dhall expression to compile + -> ByteString + -- ^ Variable to @declare@ or @unset@ + -> Either StatementError ByteString + -- ^ Bash statement or compile failure +dhallToStatement expr0 var0 = go (Dhall.Core.normalize expr0) + where + var = Text.ShellEscape.bytes (Text.ShellEscape.bash var0) + + adapt (UnsupportedExpression e) = UnsupportedSubexpression e + + go (BoolLit a) = do + go (TextLit (if a then "true" else "false")) + go (NaturalLit a) = do + go (IntegerLit (fromIntegral a)) + go (IntegerLit a) = do + e <- first adapt (dhallToExpression (IntegerLit a)) + let bytes = "declare -r -i " <> var <> "=" <> e + return bytes + go (TextLit a) = do + e <- first adapt (dhallToExpression (TextLit a)) + let bytes = "declare -r " <> var <> "=" <> e + return bytes + go (ListLit _ bs) = do + bs' <- first adapt (mapM dhallToExpression bs) + let bytes + = "declare -r -a " + <> var + <> "=(" + <> Data.ByteString.intercalate " " (Data.Foldable.toList bs') + <> ")" + return bytes + go (OptionalLit _ bs) = do + case bs of + Nothing -> return ("unset " <> var) + Just b -> go b + go (RecordLit a) = do + let process (k, v) = do + v' <- dhallToExpression v + let bytes = Data.Text.Encoding.encodeUtf8 k + let k' = Text.ShellEscape.bytes (Text.ShellEscape.bash bytes) + return ("[" <> k' <> "]=" <> v') + kvs' <- first adapt (traverse process (Dhall.Map.toList a)) + let bytes + = "declare -r -A " + <> var + <> "=(" + <> Data.ByteString.intercalate " " kvs' + <> ")" + return bytes + go e = Left (UnsupportedStatement e) + +{-| Compile a Dhall expression to a Bash expression + + This only supports: + + * @Bool@s + * @Natural@s + * @Integer@s + * @Text@s + -} +dhallToExpression + :: Expr s X + -- ^ Dhall expression to compile + -> Either ExpressionError ByteString + -- ^ Bash expression or compile failure +dhallToExpression expr0 = go (Dhall.Core.normalize expr0) + where + go (BoolLit a) = do + go (TextLit (if a then "true" else "false")) + go (NaturalLit a) = do + go (IntegerLit (fromIntegral a)) + go (IntegerLit a) = do + go (TextLit (Chunks [] (Data.Text.pack (show a)))) + go (TextLit (Chunks [] a)) = do + let bytes = Data.Text.Encoding.encodeUtf8 a + return (Text.ShellEscape.bytes (Text.ShellEscape.bash bytes)) + go e = Left (UnsupportedExpression e) diff --git a/dhall-json/.gitignore b/dhall-json/.gitignore new file mode 100644 index 000000000..52a91e04c --- /dev/null +++ b/dhall-json/.gitignore @@ -0,0 +1,3 @@ +dist +dist-* +.stack-work/ diff --git a/dhall-json/CHANGELOG.md b/dhall-json/CHANGELOG.md new file mode 100644 index 000000000..12ca1e9b6 --- /dev/null +++ b/dhall-json/CHANGELOG.md @@ -0,0 +1,108 @@ +1.2.4 + +* Build against `dhall-1.18.0` + * See: https://github.com/dhall-lang/dhall-json/pull/61 + * See: https://github.com/dhall-lang/dhall-json/pull/63 + * See: https://github.com/dhall-lang/dhall-json/pull/67 +* New `dhall-to-yaml` `--documents` flag for generating split documents + * See: https://github.com/dhall-lang/dhall-json/pull/59 +* Build against `yaml-0.10.2.0` + * This improves the multi-line string literals in generated YAML + * See: https://github.com/dhall-lang/dhall-json/pull/57 + +1.2.3 + +* Correctly handle nested association lists +* Increase upper bound on `dhall` dependency +* Increase upper bound on `yaml` dependency + +1.2.2 + +* Increase upper bound on `dhall` dependency +* Increase upper bound on `yaml` dependency + +1.2.1 + +* Add support for preserving sum type tags +* Sort keys when pretty-printing JSON +* Increase upper bound on `dhall` dependency + +1.2.0 + +* BREAKING CHANGE: Add support for converting association lists to JSON records + * This changes the behavior for records with two keys named `mapKey` and + `mapValue` +* Fix `--help` to not print `ExitSuccess` +* Fix lower bound on `dhall` dependency +* Remove `optparse-generic` dependency +* Increase upper bound on `dhall` dependency + +1.1.0 + +* BREAKING CHANGE: Build against `dhall-1.13.0` + * This requires a breaking change to the type of `codeToValue` + +1.0.13 + +* Add `--omitNull` flag to omit null-valued fields from generated JSON records +* Add `codeToValue` +* Increase upper bound on `dhall` dependency + +1.0.12 + +* Increase upper bound on `aeson` dependency +* Increase upper bound on `dhall` dependency + +1.0.11 + +* Increase upper bound on `dhall` dependency +* Increase upper bound on `optparse-generic` dependency + +1.0.10 + +* Increase upper bound on `dhall` dependency + +1.0.9 + +* Add trailing newline to JSON output +* Remove dependency on `QuasiQuotes` + +1.0.8 + +* Increase upper bound on `dhall` dependency + +1.0.7 + +* Add `--pretty` flag +* Increase upper bound on `dhall` dependency + +1.0.6 + +* Increase upper bound on `aeson` dependency +* Increase upper bound on `dhall` dependency + +1.0.5 + +* Increase upper bound on `optparse-generic` dependency +* Increase upper bound on `trifecta` dependency + +1.0.4 + +* Increase upper bound on `dhall` dependency + +1.0.3 + +* Increase upper bound on `dhall` dependency + +1.0.2 + +* Add support for translating unions by stripping the tag +* Increase upper bound on `dhall` dependency + +1.0.1 + +* Increase upper bound on `dhall` dependency + +1.0.0 + +* Initial release diff --git a/dhall-json/LICENSE b/dhall-json/LICENSE new file mode 100644 index 000000000..d240dd1fc --- /dev/null +++ b/dhall-json/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2018 Gabriel Gonzalez +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +3. Neither the name of the author nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/dhall-json/README.md b/dhall-json/README.md new file mode 100644 index 000000000..7ee38645c --- /dev/null +++ b/dhall-json/README.md @@ -0,0 +1,27 @@ +# `dhall-json 1.2.4` + +[![Hackage](https://img.shields.io/hackage/v/dhall-json.svg)](https://hackage.haskell.org/package/dhall-json) + +This `dhall-json` package provides a Dhall to JSON compiler and a Dhall to YAML +compiler. The reason this package is called `dhall-json` is that the Haskell +`yaml` library uses the same data structure as Haskell's `aeson` library for +JSON + +## Quick start + +If you have Nix installed then you can build and run this package using: + +```bash +$ nix-build +$ result/bin/dhall-to-json <<< "{ foo = 1, bar = True }" +{"foo":1,"bar":true} +$ result/bin/dhall-to-json <<< "List/head Integer ([] : List Integer)" +null +$ result/bin/dhall-to-yaml <<< "{ foo = [1, 2, 3] : List Integer, bar = { baz = True } }" +foo: +- 1 +- 2 +- 3 +bar: + baz: true +``` diff --git a/dhall-json/Setup.hs b/dhall-json/Setup.hs new file mode 100644 index 000000000..9a994af67 --- /dev/null +++ b/dhall-json/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/dhall-json/cabal.project b/dhall-json/cabal.project new file mode 100644 index 000000000..e6fdbadb4 --- /dev/null +++ b/dhall-json/cabal.project @@ -0,0 +1 @@ +packages: . diff --git a/dhall-json/default.nix b/dhall-json/default.nix new file mode 100644 index 000000000..737208859 --- /dev/null +++ b/dhall-json/default.nix @@ -0,0 +1 @@ +(import ../nix/shared.nix {}).dhall-json diff --git a/dhall-json/dhall-json.cabal b/dhall-json/dhall-json.cabal new file mode 100644 index 000000000..ccbdb6494 --- /dev/null +++ b/dhall-json/dhall-json.cabal @@ -0,0 +1,85 @@ +Name: dhall-json +Version: 1.2.4 +Cabal-Version: >=1.8.0.2 +Build-Type: Simple +Tested-With: GHC == 7.10.2, GHC == 8.0.1 +License: BSD3 +License-File: LICENSE +Copyright: 2017 Gabriel Gonzalez +Author: Gabriel Gonzalez +Maintainer: Gabriel439@gmail.com +Bug-Reports: https://github.com/dhall-lang/dhall-haskell/issues +Synopsis: Compile Dhall to JSON or YAML +Description: + Use this package if you want to compile Dhall expressions to JSON or YAML. + You can use this package as a library or an executable: + . + * See the "Dhall.JSON" module if you want to use this package as a library + . + * Use the @dhall-to-json@ or @dhall-to-yaml@ programs from this package if + you want an executable + . + The "Dhall.JSON" module also contains instructions for how to use this + package +Category: Compiler +Extra-Source-Files: + CHANGELOG.md + tasty/data/*.dhall + tasty/data/*.json +Source-Repository head + Type: git + Location: https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-json + +Library + Hs-Source-Dirs: src + Build-Depends: + base >= 4.8.0.0 && < 5 , + aeson >= 1.0.0.0 && < 1.5 , + dhall >= 1.18.0 && < 1.19, + optparse-applicative >= 0.14.0.0 && < 0.15, + text >= 0.11.1.0 && < 1.3 , + unordered-containers < 0.3 + Exposed-Modules: Dhall.JSON + GHC-Options: -Wall + +Executable dhall-to-json + Hs-Source-Dirs: dhall-to-json + Main-Is: Main.hs + Build-Depends: + base , + aeson , + aeson-pretty < 0.9 , + bytestring < 0.11, + dhall , + dhall-json , + optparse-applicative , + text + GHC-Options: -Wall + +Executable dhall-to-yaml + Hs-Source-Dirs: dhall-to-yaml + Main-Is: Main.hs + Build-Depends: + base , + bytestring < 0.11, + dhall , + dhall-json , + optparse-applicative , + yaml >= 0.5.0 && < 0.11, + vector , + text + GHC-Options: -Wall + +Test-Suite tasty + Type: exitcode-stdio-1.0 + Hs-Source-Dirs: tasty + Main-Is: Main.hs + Build-Depends: + base, + aeson , + bytestring , + dhall , + dhall-json , + tasty < 1.2, + text , + tasty-hunit >= 0.2 diff --git a/dhall-json/dhall-to-json/Main.hs b/dhall-json/dhall-to-json/Main.hs new file mode 100644 index 000000000..f1fda41ae --- /dev/null +++ b/dhall-json/dhall-to-json/Main.hs @@ -0,0 +1,100 @@ +{-# LANGUAGE ApplicativeDo #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE OverloadedStrings #-} + +module Main where + +import Control.Exception (SomeException) +import Data.Monoid ((<>)) +import Dhall.JSON (Conversion) +import Options.Applicative (Parser, ParserInfo) + +import qualified Control.Exception +import qualified Data.Aeson +import qualified Data.Aeson.Encode.Pretty +import qualified Data.ByteString.Char8 +import qualified Data.ByteString.Lazy +import qualified Data.Text.IO +import qualified Dhall +import qualified Dhall.JSON +import qualified GHC.IO.Encoding +import qualified Options.Applicative +import qualified System.Exit +import qualified System.IO + +data Options = Options + { explain :: Bool + , pretty :: Bool + , omitNull :: Bool + , conversion :: Conversion + } + +parseOptions :: Parser Options +parseOptions = Options.Applicative.helper <*> do + explain <- parseExplain + pretty <- parsePretty + omitNull <- parseOmitNull + conversion <- Dhall.JSON.parseConversion + return (Options {..}) + where + parseExplain = + Options.Applicative.switch + ( Options.Applicative.long "explain" + <> Options.Applicative.help "Explain error messages in detail" + ) + + parsePretty = + Options.Applicative.switch + ( Options.Applicative.long "pretty" + <> Options.Applicative.help "Pretty print generated JSON" + ) + + parseOmitNull = + Options.Applicative.switch + ( Options.Applicative.long "omitNull" + <> Options.Applicative.help "Omit record fields that are null" + ) + +parserInfo :: ParserInfo Options +parserInfo = + Options.Applicative.info + parseOptions + ( Options.Applicative.fullDesc + <> Options.Applicative.progDesc "Compile Dhall to JSON" + ) + +main :: IO () +main = do + GHC.IO.Encoding.setLocaleEncoding GHC.IO.Encoding.utf8 + + Options {..} <- Options.Applicative.execParser parserInfo + + handle $ do + let config = Data.Aeson.Encode.Pretty.Config + { Data.Aeson.Encode.Pretty.confIndent = Data.Aeson.Encode.Pretty.Spaces 2 + , Data.Aeson.Encode.Pretty.confCompare = compare + , Data.Aeson.Encode.Pretty.confNumFormat = Data.Aeson.Encode.Pretty.Generic + , Data.Aeson.Encode.Pretty.confTrailingNewline = False } + let encode = + if pretty + then Data.Aeson.Encode.Pretty.encodePretty' config + else Data.Aeson.encode + + 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) + + Data.ByteString.Char8.putStrLn $ Data.ByteString.Lazy.toStrict $ encode json + +handle :: IO a -> IO a +handle = Control.Exception.handle handler + where + handler :: SomeException -> IO a + handler e = do + System.IO.hPutStrLn System.IO.stderr "" + System.IO.hPrint System.IO.stderr e + System.Exit.exitFailure diff --git a/dhall-json/dhall-to-yaml/Main.hs b/dhall-json/dhall-to-yaml/Main.hs new file mode 100644 index 000000000..cec56beb3 --- /dev/null +++ b/dhall-json/dhall-to-yaml/Main.hs @@ -0,0 +1,96 @@ +{-# LANGUAGE ApplicativeDo #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} + +module Main where + +import Control.Exception (SomeException) +import Data.Monoid ((<>)) +import Dhall.JSON (Conversion) +import Options.Applicative (Parser, ParserInfo) + +import qualified Control.Exception +import qualified Data.ByteString +import qualified Data.Text.IO +import qualified Data.Vector +import qualified Data.Yaml +import qualified Dhall +import qualified Dhall.JSON +import qualified GHC.IO.Encoding +import qualified Options.Applicative +import qualified System.Exit +import qualified System.IO + +data Options = Options + { explain :: Bool + , omitNull :: Bool + , documents :: Bool + , conversion :: Conversion + } + +parseOptions :: Parser Options +parseOptions = Options.Applicative.helper <*> do + explain <- parseExplain + omitNull <- parseOmitNull + documents <- parseDocuments + conversion <- Dhall.JSON.parseConversion + return (Options {..}) + where + parseExplain = + Options.Applicative.switch + ( Options.Applicative.long "explain" + <> 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" + <> Options.Applicative.help "If given a Dhall list, output a document for every element" + ) + +parserInfo :: ParserInfo Options +parserInfo = + Options.Applicative.info + parseOptions + ( Options.Applicative.fullDesc + <> Options.Applicative.progDesc "Compile Dhall to YAML" + ) + +main :: IO () +main = do + GHC.IO.Encoding.setLocaleEncoding GHC.IO.Encoding.utf8 + + Options {..} <- Options.Applicative.execParser parserInfo + + 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) + + let yaml = case (documents, json) of + (True, Data.Yaml.Array elems) + -> Data.ByteString.intercalate "\n---\n" + $ fmap Data.Yaml.encode + $ Data.Vector.toList elems + _ -> Data.Yaml.encode json + + Data.ByteString.putStr yaml + +handle :: IO a -> IO a +handle = Control.Exception.handle handler + where + handler :: SomeException -> IO a + handler e = do + System.IO.hPutStrLn System.IO.stderr "" + System.IO.hPrint System.IO.stderr e + System.Exit.exitFailure diff --git a/dhall-json/examples/travis.dhall b/dhall-json/examples/travis.dhall new file mode 100644 index 000000000..1c91d31b7 --- /dev/null +++ b/dhall-json/examples/travis.dhall @@ -0,0 +1,178 @@ + let OperatingSystem = < Linux : {} | OSX : {} > + +in let operatingSystem = constructors OperatingSystem + +in let Addon = { apt : { packages : List Text, sources : List Text } } + +in let makeInclude = + λ ( args + : { ghc : + Text + , cabal : + Text + , deploy : + Bool + , os : + OperatingSystem + } + ) + → let release = + if args.deploy then " DEPLOY_GITHUB_RELEASE=TRUE" else "" + + in { env = + "CABALVER=${args.cabal} GHCVER=${args.ghc}${release}" + , compiler = + ": #GHC ${args.ghc}" + , addons = + merge + { Linux = + λ(_ : {}) + → [ { apt = + { packages = + [ "cabal-install-${args.cabal}" + , "ghc-${args.ghc}" + ] + , sources = + [ "hvr-ghc" ] + } + } + ] : Optional Addon + , OSX = + λ(_ : {}) → [] : Optional Addon + } + args.os + , os = + merge + { Linux = + λ(_ : {}) → [] : Optional Text + , OSX = + λ(_ : {}) → [ "osx" ] : Optional Text + } + args.os + } + +in { language = + "c" + , sudo = + False + , cache = + { directories = [ "\$HOME/.cabsnap", "\$HOME/.cabal/packages" ] } + , before_cache = + [ "rm -fv \$HOME/.cabal/packages/hackage.haskell.org/build-reports.log" + , "rm -fv \$HOME/.cabal/packages/hackage.haskell.org/00-index.tar" + ] + , matrix = + { include = + [ makeInclude + { ghc = + "7.10.2" + , cabal = + "1.22" + , deploy = + False + , os = + operatingSystem.Linux {=} + } + , makeInclude + { ghc = + "8.0.1" + , cabal = + "1.24" + , deploy = + True + , os = + operatingSystem.Linux {=} + } + , makeInclude + { ghc = + "8.0.1" + , cabal = + "1.24" + , deploy = + True + , os = + operatingSystem.OSX {=} + } + ] + } + , before_install = + [ "unset CC" + , "export PATH=/opt/ghc/\$GHCVER/bin:/opt/cabal/\$CABALVER/bin:\$PATH" + , '' + if [ "$TRAVIS_OS_NAME" = osx ]; + then + brew update; + brew install cabal-install; + brew install gnu-sed --with-default-names; + fi + '' + ] + , install = + [ "cabal --version" + , "echo \"\$(ghc --version) [\$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]\"" + , '' + if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ]; + then + zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz > + $HOME/.cabal/packages/hackage.haskell.org/00-index.tar; + fi + '' + , "travis_retry cabal update -v" + , "sed -i 's/^jobs:/-- jobs:/' \${HOME}/.cabal/config" + , "cabal install --only-dependencies --enable-tests --enable-benchmarks --dry -v > installplan.txt" + , "sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt" + , '' + if diff -u $HOME/.cabsnap/installplan.txt installplan.txt; + then + echo "cabal build-cache HIT"; + rm -rfv .ghc; + cp -a $HOME/.cabsnap/ghc $HOME/.ghc; + cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/; + else + echo "cabal build-cache MISS"; + rm -rf $HOME/.cabsnap; + mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin; + cabal install --only-dependencies --enable-tests --enable-benchmarks; + fi + '' + , '' + if [ ! -d $HOME/.cabsnap ]; + then + echo "snapshotting package-db to build-cache"; + mkdir $HOME/.cabsnap; + cp -a $HOME/.ghc $HOME/.cabsnap/ghc; + cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/; + fi + '' + ] + , script = + [ "if [ -f configure.ac ]; then autoreconf -i; fi" + , "cabal configure --enable-tests --enable-benchmarks -v2" + , "cabal build" + , "cabal test" + , "cabal check" + , "cabal sdist" + , '' + SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz && + (cd dist && cabal install --force-reinstalls "$SRC_TGZ") + '' + ] + , before_deploy = + [ "tar --create --file \"\$TRAVIS_OS_NAME.tar\" --files-from /dev/null" + , "tar --append --file \"\$TRAVIS_OS_NAME.tar\" --directory dist/build/dhall-to-json dhall-to-json" + , "tar --append --file \"\$TRAVIS_OS_NAME.tar\" --directory dist/build/dhall-to-yaml dhall-to-yaml" + , "gzip \"\$TRAVIS_OS_NAME.tar\"" + ] + , deploy = + { provider = + "releases" + , api_key = + "\$GITHUB_OAUTH_TOKEN" + , file = + "\$TRAVIS_OS_NAME.tar.gz" + , on = + { condition = "\$DEPLOY_GITHUB_RELEASE = true", tags = True } + , skip_cleanup = + True + } + } diff --git a/dhall-json/examples/travis.yml b/dhall-json/examples/travis.yml new file mode 100644 index 000000000..530425479 --- /dev/null +++ b/dhall-json/examples/travis.yml @@ -0,0 +1,104 @@ +# This file has been generated -- see https://github.com/hvr/multi-ghc-travis +language: c +sudo: false + +cache: + directories: + - $HOME/.cabsnap + - $HOME/.cabal/packages + +before_cache: + - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log + - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar + +matrix: + include: + - env: CABALVER=1.22 GHCVER=7.10.2 + compiler: ": #GHC 7.10.2" + addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.2], sources: [hvr-ghc]}} + - env: CABALVER=1.24 GHCVER=8.0.1 DEPLOY_GITHUB_RELEASE=true + compiler: ": #GHC 8.0.1" + addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1], sources: [hvr-ghc]}} + - env: CABALVER=1.24 GHCVER=8.0.1 DEPLOY_GITHUB_RELEASE=true + compiler: ": #GHC 8.0.1" + os: osx + +before_install: + - unset CC + - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH + # Work around travis issue by updating Homebrew: https://github.com/travis-ci/travis-ci/issues/8552 + - if [ "$TRAVIS_OS_NAME" = osx ]; + then + brew update; + brew install cabal-install; + brew install gnu-sed --with-default-names; + fi + +install: + - cabal --version + - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]" + - if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ]; + then + zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz > + $HOME/.cabal/packages/hackage.haskell.org/00-index.tar; + fi + - travis_retry cabal update -v + - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config + - cabal install --only-dependencies --enable-tests --enable-benchmarks --dry -v > installplan.txt + - sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt + +# check whether current requested install-plan matches cached package-db snapshot + - if diff -u $HOME/.cabsnap/installplan.txt installplan.txt; + then + echo "cabal build-cache HIT"; + rm -rfv .ghc; + cp -a $HOME/.cabsnap/ghc $HOME/.ghc; + cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/; + else + echo "cabal build-cache MISS"; + rm -rf $HOME/.cabsnap; + mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin; + cabal install --only-dependencies --enable-tests --enable-benchmarks; + fi + +# snapshot package-db on cache miss + - if [ ! -d $HOME/.cabsnap ]; + then + echo "snapshotting package-db to build-cache"; + mkdir $HOME/.cabsnap; + cp -a $HOME/.ghc $HOME/.cabsnap/ghc; + cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/; + fi + +# Here starts the actual work to be performed for the package under test; +# any command which exits with a non-zero exit code causes the build to fail. +script: + - if [ -f configure.ac ]; then autoreconf -i; fi + - cabal configure --enable-tests --enable-benchmarks -v2 # -v2 provides useful information for debugging + - cabal build # this builds all libraries and executables (including tests/benchmarks) + - cabal test + - cabal check + - cabal sdist # tests that a source-distribution can be generated + +# Check that the resulting source distribution can be built & installed. +# If there are no other `.tar.gz` files in `dist`, this can be even simpler: +# `cabal install --force-reinstalls dist/*-*.tar.gz` + - SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz && + (cd dist && cabal install --force-reinstalls "$SRC_TGZ") + +before_deploy: + - tar --create --file "$TRAVIS_OS_NAME.tar" --files-from /dev/null + - tar --append --file "$TRAVIS_OS_NAME.tar" --directory dist/build/dhall-to-json dhall-to-json + - tar --append --file "$TRAVIS_OS_NAME.tar" --directory dist/build/dhall-to-yaml dhall-to-yaml + - gzip "$TRAVIS_OS_NAME.tar" + +deploy: + provider: releases + api_key: "$GITHUB_OAUTH_TOKEN" + file: "$TRAVIS_OS_NAME.tar.gz" + on: + condition: $DEPLOY_GITHUB_RELEASE = true + tags: true + skip_cleanup: true + +# EOF diff --git a/dhall-json/release.nix b/dhall-json/release.nix new file mode 100644 index 000000000..f585ce8c8 --- /dev/null +++ b/dhall-json/release.nix @@ -0,0 +1,8 @@ +let + default = (import ./default.nix); + +in + { dhall-json = default.all; + + inherit (default) tarball; + } diff --git a/dhall-json/shell.nix b/dhall-json/shell.nix new file mode 100644 index 000000000..a6d2531ae --- /dev/null +++ b/dhall-json/shell.nix @@ -0,0 +1 @@ +(import ../nix/shared.nix {}).shell-dhall-json diff --git a/dhall-json/src/Dhall/JSON.hs b/dhall-json/src/Dhall/JSON.hs new file mode 100644 index 000000000..cc5c487ea --- /dev/null +++ b/dhall-json/src/Dhall/JSON.hs @@ -0,0 +1,751 @@ +{-# LANGUAGE ApplicativeDo #-} +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE OverloadedLists #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} + +{-| This library only exports a single `dhallToJSON` function for translating a + Dhall syntax tree to a JSON syntax tree (i.e. a `Value`) for the @aeson@ + library + + NOTE: The @yaml@ library uses the same `Value` type to represent YAML + files, so you can use this to convert Dhall expressions to YAML, too + + See the @dhall@ package if you would like to transform Dhall source code + into a Dhall syntax tree. Similarly, see the @aeson@ package if you would + like to translate a JSON syntax tree into JSON. + + This package also provides @dhall-to-json@ and @dhall-to-yaml@ executables + which you can use to compile Dhall source code directly to JSON or YAML for + your convenience + + Not all Dhall expressions can be converted to JSON since JSON is not a + programming language. The only things you can convert are: + + * @Bool@s + * @Natural@s + * @Integer@s + * @Double@s + * @Text@ + * @List@s + * @Optional@ values + * unions + * records + + Dhall @Bool@s translate to JSON bools: + +> $ dhall-to-json <<< 'True' +> true +> $ dhall-to-json <<< 'False' +> false + + Dhall numbers translate to JSON numbers: + +> $ dhall-to-json <<< '+2' +> 2 +> $ dhall-to-json <<< '2' +> 2 +> $ dhall-to-json <<< '2.3' +> 2.3 + + Dhall @Text@ translates to JSON text: + +> $ dhall-to-json <<< '"ABC"' +> "ABC" + + Dhall @List@s translate to JSON lists: + +> $ dhall-to-json <<< '[1, 2, 3] : List Integer' +> [1,2,3] + + Dhall @Optional@ values translate to @null@ if absent and the unwrapped + value otherwise: + +> $ dhall-to-json <<< '[] : Optional Integer' +> null +> $ dhall-to-json <<< '[1] : Optional Integer' +> 1 + + Dhall records translate to JSON records: + +> $ dhall-to-json <<< '{ foo = 1, bar = True }' +> {"foo":1,"bar":true} + + Dhall unions translate to the wrapped value: + +> $ dhall-to-json <<< "< Left = +2 | Right : Natural>" +> 2 +> $ cat config +> [ < Person = { age = +47, name = "John" } +> | Place : { location : Text } +> > +> , < Place = { location = "North Pole" } +> | Person : { age : Natural, name : Text } +> > +> , < Place = { location = "Sahara Desert" } +> | Person : { age : Natural, name : Text } +> > +> , < Person = { age = +35, name = "Alice" } +> | Place : { location : Text } +> > +> ] +> $ dhall-to-json <<< "./config" +> [{"age":47,"name":"John"},{"location":"North Pole"},{"location":"Sahara Desert"},{"age":35,"name":"Alice"}] + + You can preserve the name of the alternative if you wrap the value in a + record with three fields: + + * @contents@: The union literal that you want to preserve the tag of + + * @field@: the name of the field that will store the name of the + alternative + + * @nesting@: A value of type @\< Inline : {} | Nested : Text \>@. + + If @nesting@ is set to @Inline@ and the union literal stored in @contents@ + contains a record then the name of the alternative is stored inline within + the same record. For example, this code: + +> let Example = < Left : { foo : Natural } | Right : { bar : Bool } > +> +> in let example = constructors Example +> +> in let Nesting = < Inline : {} | Nested : Text > +> +> in let nesting = constructors Nesting +> +> in { field = "name" +> , nesting = nesting.Inline {=} +> , contents = example.Left { foo = 2 } +> } + + ... produces this JSON: + +> { +> "foo": 2, +> "name": "Left" +> } + + If @nesting@ is set to @Nested nestedField@ then the union is store + underneath a field named @nestedField@. For example, this code: + +> let Example = < Left : { foo : Natural } | Right : { bar : Bool } > +> +> in let example = constructors Example +> +> in let Nesting = < Inline : {} | Nested : Text > +> +> in let nesting = constructors Nesting +> +> in { field = "name" +> , nesting = nesting.Nested "value" +> , contents = example.Left { foo = 2 } +> } + + ... produces this JSON: + +> { +> "name": "Left", +> "value": { +> "foo": 2 +> } +> } + + Also, all Dhall expressions are normalized before translation to JSON: + +> $ dhall-to-json <<< "True == False" +> false + +-} + +module Dhall.JSON ( + -- * Dhall to JSON + dhallToJSON + , omitNull + , Conversion(..) + , convertToHomogeneousMaps + , parseConversion + , codeToValue + + -- * Exceptions + , CompileError(..) + ) where + +import Control.Applicative (empty, (<|>)) +import Control.Monad (guard) +import Control.Exception (Exception, throwIO) +import Data.Aeson (Value(..), ToJSON(..)) +import Data.Monoid ((<>), mempty) +import Data.Text (Text) +import Data.Typeable (Typeable) +import Dhall.Core (Expr) +import Dhall.TypeCheck (X) +import Dhall.Map (Map) +import Options.Applicative (Parser) + +import qualified Data.Foldable +import qualified Data.HashMap.Strict +import qualified Data.List +import qualified Data.Ord +import qualified Data.Text +import qualified Dhall.Core +import qualified Dhall.Import +import qualified Dhall.Map +import qualified Dhall.Parser +import qualified Dhall.TypeCheck +import qualified Options.Applicative + +{-| This is the exception type for errors that might arise when translating + Dhall to JSON + + Because the majority of Dhall language features do not translate to JSON + this just returns the expression that failed +-} +data CompileError = Unsupported (Expr X X) deriving (Typeable) + +instance Show CompileError where + show (Unsupported e) = + Data.Text.unpack $ + "" <> _ERROR <> ": Cannot translate to JSON \n\ + \ \n\ + \Explanation: Only primitive values, records, unions, ❰List❱s, and ❰Optional❱ \n\ + \values can be translated from Dhall to JSON \n\ + \ \n\ + \The following Dhall expression could not be translated to JSON: \n\ + \ \n\ + \↳ " <> txt <> " " + where + txt = Dhall.Core.pretty e + +_ERROR :: Data.Text.Text +_ERROR = "\ESC[1;31mError\ESC[0m" + +instance Exception CompileError + +{-| Convert a Dhall expression to the equivalent JSON expression + +>>> :set -XOverloadedStrings +>>> :set -XOverloadedLists +>>> import Dhall.Core +>>> dhallToJSON (RecordLit [("foo", IntegerLit 1), ("bar", TextLit "ABC")]) +Right (Object (fromList [("foo",Number 1.0),("bar",String "ABC")])) +>>> fmap Data.Aeson.encode it +Right "{\"foo\":1,\"bar\":\"ABC\"}" +-} +dhallToJSON :: Expr s X -> Either CompileError Value +dhallToJSON e0 = loop (Dhall.Core.normalize e0) + where + loop e = case e of + Dhall.Core.BoolLit a -> return (toJSON a) + Dhall.Core.NaturalLit a -> return (toJSON a) + Dhall.Core.IntegerLit a -> return (toJSON a) + Dhall.Core.DoubleLit a -> return (toJSON a) + Dhall.Core.TextLit (Dhall.Core.Chunks [] a) -> do + return (toJSON a) + Dhall.Core.ListLit _ a -> do + a' <- traverse loop a + return (toJSON a') + Dhall.Core.OptionalLit _ a -> do + a' <- traverse loop a + return (toJSON a') + Dhall.Core.Some a -> do + a' <- loop a + return (toJSON a') + Dhall.Core.App Dhall.Core.None _ -> do + return Data.Aeson.Null + Dhall.Core.RecordLit a -> + case toOrderedList a of + [ ( "contents" + , Dhall.Core.UnionLit alternativeName contents _ + ) + , ( "field" + , Dhall.Core.TextLit + (Dhall.Core.Chunks [] field) + ) + , ( "nesting" + , Dhall.Core.UnionLit + "Nested" + (Dhall.Core.TextLit + (Dhall.Core.Chunks [] nestedField) + ) + [ ("Inline", Dhall.Core.Record []) ] + ) + ] -> do + contents' <- loop contents + + let taggedValue = + Dhall.Map.fromList + [ ( field + , toJSON alternativeName + ) + , ( nestedField + , contents' + ) + ] + + return (Data.Aeson.toJSON ( Dhall.Map.toMap taggedValue )) + + [ ( "contents" + , Dhall.Core.UnionLit + alternativeName + (Dhall.Core.RecordLit contents) + _ + ) + , ( "field" + , Dhall.Core.TextLit + (Dhall.Core.Chunks [] field) + ) + , ( "nesting" + , Dhall.Core.UnionLit + "Inline" + (Dhall.Core.RecordLit []) + [ ("Nested", Dhall.Core.Text) ] + ) + ] -> do + let contents' = + Dhall.Map.insert + field + (Dhall.Core.TextLit + (Dhall.Core.Chunks + [] + alternativeName + ) + ) + contents + + loop (Dhall.Core.RecordLit contents') + _ -> do + a' <- traverse loop a + return (Data.Aeson.toJSON (Dhall.Map.toMap a')) + Dhall.Core.UnionLit _ b _ -> loop b + _ -> Left (Unsupported e) + +toOrderedList :: Ord k => Map k v -> [(k, v)] +toOrderedList = + Data.List.sortBy (Data.Ord.comparing fst) + . Dhall.Map.toList + +-- | Omit record fields that are @null@ +omitNull :: Value -> Value +omitNull (Object object) = + Object (fmap omitNull (Data.HashMap.Strict.filter (/= Null) object)) +omitNull (Array array) = + Array (fmap omitNull array) +omitNull (String string) = + String string +omitNull (Number number) = + Number number +omitNull (Bool bool) = + Bool bool +omitNull Null = + Null + +{-| Specify whether or not to convert association lists of type + @List { mapKey: Text, mapValue : v }@ to records +-} +data Conversion + = NoConversion + | Conversion { mapKey :: Text, mapValue :: Text } + +{-| Convert association lists to homogeneous maps + + This converts an association list of the form: + + > [ { mapKey = k0, mapValue = v0 }, { mapKey = k1, mapValue = v1 } ] + + ... to a record of the form: + + > { k0 = v0, k1 = v1 } +-} +convertToHomogeneousMaps :: Conversion -> Expr s X -> Expr s X +convertToHomogeneousMaps NoConversion e0 = e0 +convertToHomogeneousMaps (Conversion {..}) e0 = loop (Dhall.Core.normalize e0) + where + loop e = case e of + Dhall.Core.Const a -> + Dhall.Core.Const a + + Dhall.Core.Var v -> + Dhall.Core.Var v + + Dhall.Core.Lam a b c -> + Dhall.Core.Lam a b' c' + where + b' = loop b + c' = loop c + + Dhall.Core.Pi a b c -> + Dhall.Core.Pi a b' c' + where + b' = loop b + c' = loop c + + Dhall.Core.App a b -> + Dhall.Core.App a' b' + where + a' = loop a + b' = loop b + + Dhall.Core.Let a b c d -> + Dhall.Core.Let a b' c' d' + where + b' = fmap loop b + c' = loop c + d' = loop d + + Dhall.Core.Annot a b -> + Dhall.Core.Annot a' b' + where + a' = loop a + b' = loop b + + Dhall.Core.Bool -> + Dhall.Core.Bool + + Dhall.Core.BoolLit a -> + Dhall.Core.BoolLit a + + Dhall.Core.BoolAnd a b -> + Dhall.Core.BoolAnd a' b' + where + a' = loop a + b' = loop b + + Dhall.Core.BoolOr a b -> + Dhall.Core.BoolOr a' b' + where + a' = loop a + b' = loop b + + Dhall.Core.BoolEQ a b -> + Dhall.Core.BoolEQ a' b' + where + a' = loop a + b' = loop b + + Dhall.Core.BoolNE a b -> + Dhall.Core.BoolNE a' b' + where + a' = loop a + b' = loop b + + Dhall.Core.BoolIf a b c -> + Dhall.Core.BoolIf a' b' c' + where + a' = loop a + b' = loop b + c' = loop c + + Dhall.Core.Natural -> + Dhall.Core.Natural + + Dhall.Core.NaturalLit a -> + Dhall.Core.NaturalLit a + + Dhall.Core.NaturalFold -> + Dhall.Core.NaturalFold + + Dhall.Core.NaturalBuild -> + Dhall.Core.NaturalBuild + + Dhall.Core.NaturalIsZero -> + Dhall.Core.NaturalIsZero + + Dhall.Core.NaturalEven -> + Dhall.Core.NaturalEven + + Dhall.Core.NaturalOdd -> + Dhall.Core.NaturalOdd + + Dhall.Core.NaturalToInteger -> + Dhall.Core.NaturalToInteger + + Dhall.Core.NaturalShow -> + Dhall.Core.NaturalShow + + Dhall.Core.NaturalPlus a b -> + Dhall.Core.NaturalPlus a' b' + where + a' = loop a + b' = loop b + + Dhall.Core.NaturalTimes a b -> + Dhall.Core.NaturalTimes a' b' + where + a' = loop a + b' = loop b + + Dhall.Core.Integer -> + Dhall.Core.Integer + + Dhall.Core.IntegerLit a -> + Dhall.Core.IntegerLit a + + Dhall.Core.IntegerShow -> + Dhall.Core.IntegerShow + + Dhall.Core.IntegerToDouble -> + Dhall.Core.IntegerToDouble + + Dhall.Core.Double -> + Dhall.Core.Double + + Dhall.Core.DoubleLit a -> + Dhall.Core.DoubleLit a + + Dhall.Core.DoubleShow -> + Dhall.Core.DoubleShow + + Dhall.Core.Text -> + Dhall.Core.Text + + Dhall.Core.TextLit (Dhall.Core.Chunks a b) -> + Dhall.Core.TextLit (Dhall.Core.Chunks a' b) + where + a' = fmap (fmap loop) a + + Dhall.Core.TextAppend a b -> + Dhall.Core.TextAppend a' b' + where + a' = loop a + b' = loop b + + Dhall.Core.List -> + Dhall.Core.List + + Dhall.Core.ListLit a b -> + case transform of + Just c -> loop c + Nothing -> Dhall.Core.ListLit a' b' + where + elements = Data.Foldable.toList b + + toKeyValue :: Expr s X -> Maybe (Text, Expr s X) + toKeyValue (Dhall.Core.RecordLit m) = do + guard (Data.Foldable.length m == 2) + + key <- Dhall.Map.lookup mapKey m + value <- Dhall.Map.lookup mapValue m + + keyText <- case key of + Dhall.Core.TextLit (Dhall.Core.Chunks [] keyText) -> + return keyText + + _ -> + empty + + return (keyText, value) + toKeyValue _ = do + empty + + transform = + case elements of + [] -> + case a of + Just (Dhall.Core.Record m) -> do + guard (Data.Foldable.length m == 2) + guard (Dhall.Map.member mapKey m) + guard (Dhall.Map.member mapValue m) + return (Dhall.Core.RecordLit mempty) + _ -> do + empty + + _ -> do + keyValues <- traverse toKeyValue elements + + let recordLiteral = + Dhall.Map.fromList keyValues + + return (Dhall.Core.RecordLit recordLiteral) + + a' = fmap loop a + b' = fmap loop b + + Dhall.Core.ListAppend a b -> + Dhall.Core.ListAppend a' b' + where + a' = loop a + b' = loop b + + Dhall.Core.ListBuild -> + Dhall.Core.ListBuild + + Dhall.Core.ListFold -> + Dhall.Core.ListFold + + Dhall.Core.ListLength -> + Dhall.Core.ListLength + + Dhall.Core.ListHead -> + Dhall.Core.ListHead + + Dhall.Core.ListLast -> + Dhall.Core.ListLast + + Dhall.Core.ListIndexed -> + Dhall.Core.ListIndexed + + Dhall.Core.ListReverse -> + Dhall.Core.ListReverse + + Dhall.Core.Optional -> + Dhall.Core.Optional + + Dhall.Core.OptionalLit a b -> + Dhall.Core.OptionalLit a' b' + where + a' = loop a + b' = fmap loop b + + Dhall.Core.Some a -> + Dhall.Core.Some a' + where + a' = loop a + + Dhall.Core.None -> + Dhall.Core.None + + Dhall.Core.OptionalFold -> + Dhall.Core.OptionalFold + + Dhall.Core.OptionalBuild -> + Dhall.Core.OptionalBuild + + Dhall.Core.Record a -> + Dhall.Core.Record a' + where + a' = fmap loop a + + Dhall.Core.RecordLit a -> + Dhall.Core.RecordLit a' + where + a' = fmap loop a + + Dhall.Core.Union a -> + Dhall.Core.Union a' + where + a' = fmap loop a + + Dhall.Core.UnionLit a b c -> + Dhall.Core.UnionLit a b' c' + where + b' = loop b + c' = fmap loop c + + Dhall.Core.Combine a b -> + Dhall.Core.Combine a' b' + where + a' = loop a + b' = loop b + + Dhall.Core.CombineTypes a b -> + Dhall.Core.CombineTypes a' b' + where + a' = loop a + b' = loop b + + Dhall.Core.Prefer a b -> + Dhall.Core.Prefer a' b' + where + a' = loop a + b' = loop b + + Dhall.Core.Merge a b c -> + Dhall.Core.Merge a' b' c' + where + a' = loop a + 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 + a' = loop a + + Dhall.Core.Project a b -> + Dhall.Core.Project a' b + where + a' = loop a + + Dhall.Core.ImportAlt a b -> + Dhall.Core.ImportAlt a' b' + where + a' = loop a + b' = loop b + + Dhall.Core.Note a b -> + Dhall.Core.Note a b' + where + b' = loop b + + Dhall.Core.Embed a -> + Dhall.Core.Embed a + +parseConversion :: Parser Conversion +parseConversion = + conversion + <|> noConversion + where + conversion = do + mapKey <- parseKeyField + mapValue <- parseValueField + return (Conversion {..}) + where + parseKeyField = + Options.Applicative.strOption + ( Options.Applicative.long "key" + <> Options.Applicative.help "Reserved key field name for association lists" + <> Options.Applicative.value "mapKey" + <> Options.Applicative.showDefaultWith Data.Text.unpack + ) + + parseValueField = + Options.Applicative.strOption + ( Options.Applicative.long "value" + <> Options.Applicative.help "Reserved value field name for association lists" + <> Options.Applicative.value "mapValue" + <> Options.Applicative.showDefaultWith Data.Text.unpack + ) + + noConversion = + Options.Applicative.flag' + NoConversion + ( Options.Applicative.long "noMaps" + <> Options.Applicative.help "Disable conversion of association lists to homogeneous maps" + ) + + +{-| Convert a piece of Text carrying a Dhall inscription to an equivalent JSON Value + +>>> :set -XOverloadedStrings +>>> import Dhall.Core +>>> Dhall.JSON.codeToValue "(stdin)" "{ a = 1 }" +>>> Object (fromList [("a",Number 1.0)]) +-} +codeToValue + :: Conversion + -> Text -- ^ Describe the input for the sake of error location. + -> Text -- ^ Input text. + -> IO Value +codeToValue conversion name code = do + parsedExpression <- case Dhall.Parser.exprFromText (Data.Text.unpack name) code of + Left err -> Control.Exception.throwIO err + Right parsedExpression -> return parsedExpression + + resolvedExpression <- Dhall.Import.load parsedExpression + + case Dhall.TypeCheck.typeOf resolvedExpression of + Left err -> Control.Exception.throwIO err + Right _ -> return () + + let convertedExpression = + convertToHomogeneousMaps conversion resolvedExpression + + case dhallToJSON convertedExpression of + Left err -> Control.Exception.throwIO err + Right json -> return json diff --git a/dhall-json/stack.yaml b/dhall-json/stack.yaml new file mode 100644 index 000000000..c5ce25485 --- /dev/null +++ b/dhall-json/stack.yaml @@ -0,0 +1,6 @@ +resolver: lts-12.13 +extra-deps: + - dhall-1.18.0 + - megaparsec-7.0.1 + - repline-0.2.0.0 + - serialise-0.2.1.0 diff --git a/dhall-json/tasty/Main.hs b/dhall-json/tasty/Main.hs new file mode 100644 index 000000000..cd2fb783a --- /dev/null +++ b/dhall-json/tasty/Main.hs @@ -0,0 +1,62 @@ +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} + +module Main where + +import Dhall.JSON (Conversion(..)) +import Test.Tasty (TestTree) + +import qualified Control.Exception +import qualified Data.Aeson +import qualified Data.ByteString.Lazy +import qualified Data.Text.IO +import qualified Dhall.Import +import qualified Dhall.JSON +import qualified Dhall.Parser +import qualified Test.Tasty +import qualified Test.Tasty.HUnit + +main :: IO () +main = Test.Tasty.defaultMain testTree + +testTree :: TestTree +testTree = + Test.Tasty.testGroup "dhall-json" + [ issue48 + ] + +issue48 :: TestTree +issue48 = Test.Tasty.HUnit.testCase "Issue #48" assertion + where + assertion = do + let file = "./tasty/data/issue48.dhall" + + code <- Data.Text.IO.readFile file + + parsedExpression <- case Dhall.Parser.exprFromText file code of + Left exception -> Control.Exception.throwIO exception + Right parsedExpression -> return parsedExpression + + resolvedExpression <- Dhall.Import.load parsedExpression + + let mapKey = "mapKey" + let mapValue = "mapValue" + let conversion = Conversion {..} + + let convertedExpression = + Dhall.JSON.convertToHomogeneousMaps conversion resolvedExpression + + actualValue <- case Dhall.JSON.dhallToJSON convertedExpression of + Left exception -> Control.Exception.throwIO exception + Right actualValue -> return actualValue + + bytes <- Data.ByteString.Lazy.readFile "./tasty/data/issue48.json" + + expectedValue <- case Data.Aeson.eitherDecode bytes of + Left string -> fail string + Right expectedValue -> return expectedValue + + let message = + "Conversion to homogeneous maps did not generate the expected JSON output" + + Test.Tasty.HUnit.assertEqual message expectedValue actualValue diff --git a/dhall-json/tasty/data/issue48.dhall b/dhall-json/tasty/data/issue48.dhall new file mode 100644 index 000000000..2ad9c3854 --- /dev/null +++ b/dhall-json/tasty/data/issue48.dhall @@ -0,0 +1 @@ +[ { mapKey = "somekey", mapValue = [ { mapKey = "\$gt", mapValue = 100 } ] } ] diff --git a/dhall-json/tasty/data/issue48.json b/dhall-json/tasty/data/issue48.json new file mode 100644 index 000000000..f8ba4021f --- /dev/null +++ b/dhall-json/tasty/data/issue48.json @@ -0,0 +1,5 @@ +{ + "somekey": { + "$gt": 100 + } +} diff --git a/dhall-text/LICENSE b/dhall-text/LICENSE new file mode 100644 index 000000000..d240dd1fc --- /dev/null +++ b/dhall-text/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2018 Gabriel Gonzalez +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +3. Neither the name of the author nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/dhall-text/README.md b/dhall-text/README.md new file mode 100644 index 000000000..99e30ec23 --- /dev/null +++ b/dhall-text/README.md @@ -0,0 +1,98 @@ +# `dhall-text 1.0.13` + +[![Hackage](https://img.shields.io/hackage/v/dhall-text.svg)](https://hackage.haskell.org/package/dhall-text) + +This `dhall-text` package provides a `dhall-to-text` executable which you can +use to template text using the Dhall configuration language. + +For example, suppose you save the following files to your current directory: + +```haskell +$ cat Person +-- Dhall is a typed programming language + +-- This file is the type of an anonymous record +{ name : Text, upvotes : Natural } +``` + +```haskell +$ cat people +-- Dhall natively supports lists and anonymous records + +[ { name = "Maria" , upvotes = 14 } +, { name = "Jordan", upvotes = 2 } +, { name = "Pranav", upvotes = 1 } +] + +-- This file has type: +-- +-- ./people : List { name : Text, upvotes : Natural } +-- +-- ... or just: +-- +-- ./people : List ./Person +``` + +```haskell +$ cat make-item + -- You can define anonymous functions in Dhall using a backslash (i.e. `\`) + \(person : ./Person) -- You can import any type or expression by its path + + -- Dhall supports multiline strings that strip leading whitespace and Dhall + -- supports string interpolation, too, using `${...}` syntax +-> '' +
  • + ${Natural/show person.upvotes} + ${person.name} +
  • + '' + +-- This file has type: +-- +-- ./make-item : ./Person -> Text +``` + +```haskell +$ cat make-items + -- You can also import any type or expression by its URL + let List/map = https://raw.githubusercontent.com/dhall-lang/Prelude/302881a17491f3c72238975a6c3e7aab603b9a96/List/map +in let Text/concat = https://raw.githubusercontent.com/dhall-lang/Prelude/302881a17491f3c72238975a6c3e7aab603b9a96/Text/concat +in \(people : List ./Person) +-> Text/concat (List/map ./Person Text ./make-item people) + +-- This file has type: +-- +-- ./make-items : List ./Person -> Text +``` + +Templating HTML is just ordinary function application: + +```bash +$ dhall-to-text <<< './make-items ./people' +
  • + 14 + Maria +
  • + +
  • + 2 + Jordan +
  • + +
  • + 1 + Pranav +
  • + +``` + +To learn more about the Dhall configuration language, +[read the tutorial](https://hackage.haskell.org/package/dhall/docs/Dhall-Tutorial.html) + +## Quick start + +If you have Nix then you can install this package using: + +```bash +$ nix-env --install --file default.nix +``` diff --git a/dhall-text/Setup.hs b/dhall-text/Setup.hs new file mode 100644 index 000000000..9a994af67 --- /dev/null +++ b/dhall-text/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/dhall-text/default.nix b/dhall-text/default.nix new file mode 100644 index 000000000..c2d08a183 --- /dev/null +++ b/dhall-text/default.nix @@ -0,0 +1 @@ +(import ../nix/shared.nix {}).dhall-text diff --git a/dhall-text/dhall-text.cabal b/dhall-text/dhall-text.cabal new file mode 100644 index 000000000..30741c78f --- /dev/null +++ b/dhall-text/dhall-text.cabal @@ -0,0 +1,33 @@ +Name: dhall-text +Version: 1.0.13 +Cabal-Version: >=1.8.0.2 +Build-Type: Simple +Tested-With: GHC == 7.10.2, GHC == 8.0.1 +License: BSD3 +License-File: LICENSE +Copyright: 2017 Gabriel Gonzalez +Author: Gabriel Gonzalez +Maintainer: Gabriel439@gmail.com +Bug-Reports: https://github.com/dhall-lang/dhall-haskell/issues +Synopsis: Template text using Dhall +Description: + This package provides a @dhall-to-text@ executable that templates text using + the Dhall configuration language +Category: Compiler +Extra-Source-Files: + README.md +Source-Repository head + Type: git + Location: https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-text + +Executable dhall-to-text + Hs-Source-Dirs: exec + Main-Is: Main.hs + Build-Depends: + base >= 4.8.0.0 && < 5 , + dhall >= 1.15.0 && < 1.19, + optparse-applicative < 0.15, + text >= 0.11.1.0 && < 1.3 + GHC-Options: -Wall + Other-Modules: + Paths_dhall_text diff --git a/dhall-text/exec/Main.hs b/dhall-text/exec/Main.hs new file mode 100644 index 000000000..fbe85f6f8 --- /dev/null +++ b/dhall-text/exec/Main.hs @@ -0,0 +1,63 @@ +{-# LANGUAGE RecordWildCards #-} + +import Control.Applicative ((<|>)) +import Data.Monoid ((<>)) +import Options.Applicative (Parser, ParserInfo) + +import qualified Data.Text.IO +import qualified Data.Version +import qualified Dhall +import qualified Options.Applicative +import qualified Paths_dhall_text + +data Options + = Default { explain :: Bool } + | Version + +parseOptions :: Parser Options +parseOptions = parseVersion <|> parseDefault + where + parseVersion = + Options.Applicative.subparser + ( Options.Applicative.command "version" parserInfoVersion + <> Options.Applicative.metavar "version" + ) + where + parserInfoVersion = + Options.Applicative.info parser + ( Options.Applicative.fullDesc + <> Options.Applicative.progDesc "Display version" + ) + + parser = + Options.Applicative.helper <*> pure Version + + parseDefault = Default <$> parseExplain + where + parseExplain = + Options.Applicative.switch + ( Options.Applicative.long "explain" + <> Options.Applicative.help "Explain error messages in detail" + ) + +parserInfoOptions :: ParserInfo Options +parserInfoOptions = + Options.Applicative.info + (Options.Applicative.helper <*> parseOptions) + ( Options.Applicative.progDesc "Template text using Dhall" + <> Options.Applicative.fullDesc + ) + +main :: IO () +main = do + options <- Options.Applicative.execParser parserInfoOptions + + case options of + Default {..} -> do + let detail = if explain then Dhall.detailed else id + code <- Data.Text.IO.getContents + text <- detail (Dhall.input Dhall.auto code) + Data.Text.IO.putStr text + + Version -> do + putStrLn (Data.Version.showVersion Paths_dhall_text.version) diff --git a/dhall-text/shell.nix b/dhall-text/shell.nix new file mode 100644 index 000000000..1e4f6ed4d --- /dev/null +++ b/dhall-text/shell.nix @@ -0,0 +1 @@ +(import ../nix/shared.nix {}).shell-dhall-text diff --git a/dhall-text/stack.yaml b/dhall-text/stack.yaml new file mode 100644 index 000000000..bcf1ee428 --- /dev/null +++ b/dhall-text/stack.yaml @@ -0,0 +1,4 @@ +resolver: lts-11.9 + +extra-deps: + - dhall-1.14.0 diff --git a/CHANGELOG.md b/dhall/CHANGELOG.md similarity index 100% rename from CHANGELOG.md rename to dhall/CHANGELOG.md diff --git a/dhall/LICENSE b/dhall/LICENSE new file mode 100644 index 000000000..d240dd1fc --- /dev/null +++ b/dhall/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2018 Gabriel Gonzalez +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +3. Neither the name of the author nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Prelude/Monoid b/dhall/Prelude/Monoid similarity index 100% rename from Prelude/Monoid rename to dhall/Prelude/Monoid diff --git a/Prelude/package.dhall b/dhall/Prelude/package.dhall similarity index 100% rename from Prelude/package.dhall rename to dhall/Prelude/package.dhall diff --git a/dhall/README.md b/dhall/README.md new file mode 100644 index 000000000..e0e994fc5 --- /dev/null +++ b/dhall/README.md @@ -0,0 +1,141 @@ +# `dhall 1.18.0` + +[![Hackage](https://img.shields.io/hackage/v/dhall.svg)](https://hackage.haskell.org/package/dhall) + +Dhall is a programmable configuration language that is not Turing-complete + +You can think of Dhall as: JSON + functions + types + imports + +You will probably want to read the language-agnostic README here: + +* [`dhall-lang` `README`](https://github.com/dhall-lang/dhall-lang/blob/master/README.md) + +This repository (and this `README`) focuses on the Haskell implementation of +Dhall + +## Motivation + +*"Why not configure my program using JSON or YAML?"* + +JSON or YAML are suitable for small configuration files, but larger +configuration files with complex schemas require programming language features +to reduce repetition. Otherwise, the repetitive configuration files become +error-prone and difficult to maintain/migrate. + +This post explains in more detail the motivation behind programmable +configuration files: + +* [Programmable configuration files](https://github.com/dhall-lang/dhall-lang/wiki/Programmable-configuration-files) + +*"Why not configure my program using Haskell code?"* + +You probably don't want to rebuild your program every time you make a +configuration change. Recompilation is slow and requires the GHC toolchain +to be installed anywhere you want to make configuration changes. + +## Quick start + +Given this Haskell program saved to `example.hs`: + +```haskell +-- example.hs + +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE OverloadedStrings #-} + +import Dhall + +data Example = Example { foo :: Integer, bar :: Vector Double } + deriving (Generic, Show) + +instance Interpret Example + +main :: IO () +main = do + x <- input auto "./config" + print (x :: Example) +``` + +... which reads in this configuration file: + +```bash +$ cat ./config +{ foo = 1 +, bar = ./bar +} +``` + +... which in turn references this other file: + +``` +$ cat ./bar +[3.0, 4.0, 5.0] +``` + +... you can interpret the Haskell program like this: + +```bash +$ nix-shell ../nix/test-dhall.nix +[nix-shell]$ runghc example.hs +Example {foo = 1, bar = [3.0,4.0,5.0]} +``` + +You can also interpret Dhall programs directly using the installed command-line +compiler: + +```bash +$ dhall +List/head Double ./bar + +Optional Double + +Some 3.0 +``` + +... and you can reference remote expressions or functions by their URL, too: + +```bash +$ dhall +let null = https://raw.githubusercontent.com/dhall-lang/Prelude/35deff0d41f2bf86c42089c6ca16665537f54d75/List/null +in null Double ./bar + +Bool + +False +``` + +Now go read the +[Dhall tutorial](https://hackage.haskell.org/package/dhall/docs/Dhall-Tutorial.html) +to learn more + +## Building this project + +Nix + Cabal is the recommended workflow for project development since continuous +integration uses Nix to build and test the project. Other development tools and +workflows are also supported on a best-effort basis. + +You can build the project using only Nix by running this command from the root +of the repository: + +```bash +$ nix-build +``` + +More commonly, you will want to incrementally build the project using `cabal`. +You can either do so inside of a `nix-shell`: + +```bash +$ nix-shell +[nix-shell]$ cabal configure +[nix-shell]$ cabal build +[nix-shell]$ cabal test +``` + +... or you can add `nix: True` to your `~/.cabal/config` file and then you can +run the same `cabal` commands without an explicit `nix-shell`: + +```bash +$ cabal configure +$ cabal build +$ cabal test +``` diff --git a/dhall/Setup.hs b/dhall/Setup.hs new file mode 100644 index 000000000..9a994af67 --- /dev/null +++ b/dhall/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/benchmark/deep-nested-large-record/BigEnum.dhall b/dhall/benchmark/deep-nested-large-record/BigEnum.dhall similarity index 100% rename from benchmark/deep-nested-large-record/BigEnum.dhall rename to dhall/benchmark/deep-nested-large-record/BigEnum.dhall diff --git a/benchmark/deep-nested-large-record/LittleEnum.dhall b/dhall/benchmark/deep-nested-large-record/LittleEnum.dhall similarity index 100% rename from benchmark/deep-nested-large-record/LittleEnum.dhall rename to dhall/benchmark/deep-nested-large-record/LittleEnum.dhall diff --git a/benchmark/deep-nested-large-record/Main.hs b/dhall/benchmark/deep-nested-large-record/Main.hs similarity index 100% rename from benchmark/deep-nested-large-record/Main.hs rename to dhall/benchmark/deep-nested-large-record/Main.hs diff --git a/benchmark/deep-nested-large-record/prelude.dhall b/dhall/benchmark/deep-nested-large-record/prelude.dhall similarity index 100% rename from benchmark/deep-nested-large-record/prelude.dhall rename to dhall/benchmark/deep-nested-large-record/prelude.dhall diff --git a/benchmark/dhall-command/Main.hs b/dhall/benchmark/dhall-command/Main.hs similarity index 100% rename from benchmark/dhall-command/Main.hs rename to dhall/benchmark/dhall-command/Main.hs diff --git a/benchmark/examples/issue108.dhall b/dhall/benchmark/examples/issue108.dhall similarity index 100% rename from benchmark/examples/issue108.dhall rename to dhall/benchmark/examples/issue108.dhall diff --git a/benchmark/examples/issue108.dhall.bin b/dhall/benchmark/examples/issue108.dhall.bin similarity index 100% rename from benchmark/examples/issue108.dhall.bin rename to dhall/benchmark/examples/issue108.dhall.bin diff --git a/benchmark/parser/Main.hs b/dhall/benchmark/parser/Main.hs similarity index 100% rename from benchmark/parser/Main.hs rename to dhall/benchmark/parser/Main.hs diff --git a/dhall/default.nix b/dhall/default.nix new file mode 100644 index 000000000..52b5fec84 --- /dev/null +++ b/dhall/default.nix @@ -0,0 +1 @@ +(import ../nix/shared.nix {}).dhall diff --git a/dhall.cabal b/dhall/dhall.cabal similarity index 99% rename from dhall.cabal rename to dhall/dhall.cabal index 77ae6a929..6efeb5c72 100644 --- a/dhall.cabal +++ b/dhall/dhall.cabal @@ -105,7 +105,7 @@ Extra-Source-Files: Source-Repository head Type: git - Location: https://github.com/dhall-lang/dhall-haskell + Location: https://github.com/dhall-lang/dhall-haskell/tree/master/dhall Flag with-http Description: Include support for importing dhall modules from HTTP URLs diff --git a/dhall/Main.hs b/dhall/dhall/Main.hs similarity index 100% rename from dhall/Main.hs rename to dhall/dhall/Main.hs diff --git a/doctest/Main.hs b/dhall/doctest/Main.hs similarity index 100% rename from doctest/Main.hs rename to dhall/doctest/Main.hs diff --git a/examples/True b/dhall/examples/True similarity index 100% rename from examples/True rename to dhall/examples/True diff --git a/dhall/shell.nix b/dhall/shell.nix new file mode 100644 index 000000000..2241fe8bb --- /dev/null +++ b/dhall/shell.nix @@ -0,0 +1 @@ +(import ../nix/shared.nix { coverage = true; }).shell-dhall diff --git a/src/Dhall.hs b/dhall/src/Dhall.hs similarity index 100% rename from src/Dhall.hs rename to dhall/src/Dhall.hs diff --git a/src/Dhall/Binary.hs b/dhall/src/Dhall/Binary.hs similarity index 100% rename from src/Dhall/Binary.hs rename to dhall/src/Dhall/Binary.hs diff --git a/src/Dhall/Context.hs b/dhall/src/Dhall/Context.hs similarity index 100% rename from src/Dhall/Context.hs rename to dhall/src/Dhall/Context.hs diff --git a/src/Dhall/Core.hs b/dhall/src/Dhall/Core.hs similarity index 100% rename from src/Dhall/Core.hs rename to dhall/src/Dhall/Core.hs diff --git a/src/Dhall/Core.hs-boot b/dhall/src/Dhall/Core.hs-boot similarity index 100% rename from src/Dhall/Core.hs-boot rename to dhall/src/Dhall/Core.hs-boot diff --git a/src/Dhall/Diff.hs b/dhall/src/Dhall/Diff.hs similarity index 100% rename from src/Dhall/Diff.hs rename to dhall/src/Dhall/Diff.hs diff --git a/src/Dhall/Format.hs b/dhall/src/Dhall/Format.hs similarity index 100% rename from src/Dhall/Format.hs rename to dhall/src/Dhall/Format.hs diff --git a/src/Dhall/Freeze.hs b/dhall/src/Dhall/Freeze.hs similarity index 100% rename from src/Dhall/Freeze.hs rename to dhall/src/Dhall/Freeze.hs diff --git a/src/Dhall/Hash.hs b/dhall/src/Dhall/Hash.hs similarity index 100% rename from src/Dhall/Hash.hs rename to dhall/src/Dhall/Hash.hs diff --git a/src/Dhall/Import.hs b/dhall/src/Dhall/Import.hs similarity index 100% rename from src/Dhall/Import.hs rename to dhall/src/Dhall/Import.hs diff --git a/src/Dhall/Import/HTTP.hs b/dhall/src/Dhall/Import/HTTP.hs similarity index 100% rename from src/Dhall/Import/HTTP.hs rename to dhall/src/Dhall/Import/HTTP.hs diff --git a/src/Dhall/Import/Types.hs b/dhall/src/Dhall/Import/Types.hs similarity index 100% rename from src/Dhall/Import/Types.hs rename to dhall/src/Dhall/Import/Types.hs diff --git a/src/Dhall/Lint.hs b/dhall/src/Dhall/Lint.hs similarity index 100% rename from src/Dhall/Lint.hs rename to dhall/src/Dhall/Lint.hs diff --git a/src/Dhall/Main.hs b/dhall/src/Dhall/Main.hs similarity index 100% rename from src/Dhall/Main.hs rename to dhall/src/Dhall/Main.hs diff --git a/src/Dhall/Map.hs b/dhall/src/Dhall/Map.hs similarity index 100% rename from src/Dhall/Map.hs rename to dhall/src/Dhall/Map.hs diff --git a/src/Dhall/Parser.hs b/dhall/src/Dhall/Parser.hs similarity index 100% rename from src/Dhall/Parser.hs rename to dhall/src/Dhall/Parser.hs diff --git a/src/Dhall/Parser/Combinators.hs b/dhall/src/Dhall/Parser/Combinators.hs similarity index 100% rename from src/Dhall/Parser/Combinators.hs rename to dhall/src/Dhall/Parser/Combinators.hs diff --git a/src/Dhall/Parser/Expression.hs b/dhall/src/Dhall/Parser/Expression.hs similarity index 100% rename from src/Dhall/Parser/Expression.hs rename to dhall/src/Dhall/Parser/Expression.hs diff --git a/src/Dhall/Parser/Token.hs b/dhall/src/Dhall/Parser/Token.hs similarity index 100% rename from src/Dhall/Parser/Token.hs rename to dhall/src/Dhall/Parser/Token.hs diff --git a/src/Dhall/Pretty.hs b/dhall/src/Dhall/Pretty.hs similarity index 100% rename from src/Dhall/Pretty.hs rename to dhall/src/Dhall/Pretty.hs diff --git a/src/Dhall/Pretty/Internal.hs b/dhall/src/Dhall/Pretty/Internal.hs similarity index 100% rename from src/Dhall/Pretty/Internal.hs rename to dhall/src/Dhall/Pretty/Internal.hs diff --git a/src/Dhall/Pretty/Internal.hs-boot b/dhall/src/Dhall/Pretty/Internal.hs-boot similarity index 100% rename from src/Dhall/Pretty/Internal.hs-boot rename to dhall/src/Dhall/Pretty/Internal.hs-boot diff --git a/src/Dhall/Repl.hs b/dhall/src/Dhall/Repl.hs similarity index 100% rename from src/Dhall/Repl.hs rename to dhall/src/Dhall/Repl.hs diff --git a/src/Dhall/TH.hs b/dhall/src/Dhall/TH.hs similarity index 100% rename from src/Dhall/TH.hs rename to dhall/src/Dhall/TH.hs diff --git a/src/Dhall/Tutorial.hs b/dhall/src/Dhall/Tutorial.hs similarity index 100% rename from src/Dhall/Tutorial.hs rename to dhall/src/Dhall/Tutorial.hs diff --git a/src/Dhall/TypeCheck.hs b/dhall/src/Dhall/TypeCheck.hs similarity index 100% rename from src/Dhall/TypeCheck.hs rename to dhall/src/Dhall/TypeCheck.hs diff --git a/src/Dhall/Util.hs b/dhall/src/Dhall/Util.hs similarity index 100% rename from src/Dhall/Util.hs rename to dhall/src/Dhall/Util.hs diff --git a/stack-lts-11.yaml b/dhall/stack-lts-11.yaml similarity index 100% rename from stack-lts-11.yaml rename to dhall/stack-lts-11.yaml diff --git a/stack-lts-6.yaml b/dhall/stack-lts-6.yaml similarity index 100% rename from stack-lts-6.yaml rename to dhall/stack-lts-6.yaml diff --git a/stack.yaml b/dhall/stack.yaml similarity index 100% rename from stack.yaml rename to dhall/stack.yaml diff --git a/tests/Format.hs b/dhall/tests/Format.hs similarity index 100% rename from tests/Format.hs rename to dhall/tests/Format.hs diff --git a/tests/Import.hs b/dhall/tests/Import.hs similarity index 100% rename from tests/Import.hs rename to dhall/tests/Import.hs diff --git a/tests/Normalization.hs b/dhall/tests/Normalization.hs similarity index 100% rename from tests/Normalization.hs rename to dhall/tests/Normalization.hs diff --git a/tests/Parser.hs b/dhall/tests/Parser.hs similarity index 100% rename from tests/Parser.hs rename to dhall/tests/Parser.hs diff --git a/tests/QuickCheck.hs b/dhall/tests/QuickCheck.hs similarity index 100% rename from tests/QuickCheck.hs rename to dhall/tests/QuickCheck.hs diff --git a/tests/Regression.hs b/dhall/tests/Regression.hs similarity index 100% rename from tests/Regression.hs rename to dhall/tests/Regression.hs diff --git a/tests/Tests.hs b/dhall/tests/Tests.hs similarity index 100% rename from tests/Tests.hs rename to dhall/tests/Tests.hs diff --git a/tests/Tutorial.hs b/dhall/tests/Tutorial.hs similarity index 100% rename from tests/Tutorial.hs rename to dhall/tests/Tutorial.hs diff --git a/tests/TypeCheck.hs b/dhall/tests/TypeCheck.hs similarity index 100% rename from tests/TypeCheck.hs rename to dhall/tests/TypeCheck.hs diff --git a/tests/Util.hs b/dhall/tests/Util.hs similarity index 100% rename from tests/Util.hs rename to dhall/tests/Util.hs diff --git a/tests/format/asciiA.dhall b/dhall/tests/format/asciiA.dhall similarity index 100% rename from tests/format/asciiA.dhall rename to dhall/tests/format/asciiA.dhall diff --git a/tests/format/asciiB.dhall b/dhall/tests/format/asciiB.dhall similarity index 100% rename from tests/format/asciiB.dhall rename to dhall/tests/format/asciiB.dhall diff --git a/tests/format/emptyRecordA.dhall b/dhall/tests/format/emptyRecordA.dhall similarity index 100% rename from tests/format/emptyRecordA.dhall rename to dhall/tests/format/emptyRecordA.dhall diff --git a/tests/format/emptyRecordB.dhall b/dhall/tests/format/emptyRecordB.dhall similarity index 100% rename from tests/format/emptyRecordB.dhall rename to dhall/tests/format/emptyRecordB.dhall diff --git a/tests/format/escapeNumericLabelA.dhall b/dhall/tests/format/escapeNumericLabelA.dhall similarity index 100% rename from tests/format/escapeNumericLabelA.dhall rename to dhall/tests/format/escapeNumericLabelA.dhall diff --git a/tests/format/escapeNumericLabelB.dhall b/dhall/tests/format/escapeNumericLabelB.dhall similarity index 100% rename from tests/format/escapeNumericLabelB.dhall rename to dhall/tests/format/escapeNumericLabelB.dhall diff --git a/tests/format/escapeSingleQuotedOpenInterpolationA.dhall b/dhall/tests/format/escapeSingleQuotedOpenInterpolationA.dhall similarity index 100% rename from tests/format/escapeSingleQuotedOpenInterpolationA.dhall rename to dhall/tests/format/escapeSingleQuotedOpenInterpolationA.dhall diff --git a/tests/format/escapeSingleQuotedOpenInterpolationB.dhall b/dhall/tests/format/escapeSingleQuotedOpenInterpolationB.dhall similarity index 100% rename from tests/format/escapeSingleQuotedOpenInterpolationB.dhall rename to dhall/tests/format/escapeSingleQuotedOpenInterpolationB.dhall diff --git a/tests/format/fieldOrderA.dhall b/dhall/tests/format/fieldOrderA.dhall similarity index 100% rename from tests/format/fieldOrderA.dhall rename to dhall/tests/format/fieldOrderA.dhall diff --git a/tests/format/fieldOrderB.dhall b/dhall/tests/format/fieldOrderB.dhall similarity index 100% rename from tests/format/fieldOrderB.dhall rename to dhall/tests/format/fieldOrderB.dhall diff --git a/tests/format/ifThenElseA.dhall b/dhall/tests/format/ifThenElseA.dhall similarity index 100% rename from tests/format/ifThenElseA.dhall rename to dhall/tests/format/ifThenElseA.dhall diff --git a/tests/format/ifThenElseB.dhall b/dhall/tests/format/ifThenElseB.dhall similarity index 100% rename from tests/format/ifThenElseB.dhall rename to dhall/tests/format/ifThenElseB.dhall diff --git a/tests/format/importAccessA.dhall b/dhall/tests/format/importAccessA.dhall similarity index 100% rename from tests/format/importAccessA.dhall rename to dhall/tests/format/importAccessA.dhall diff --git a/tests/format/importAccessB.dhall b/dhall/tests/format/importAccessB.dhall similarity index 100% rename from tests/format/importAccessB.dhall rename to dhall/tests/format/importAccessB.dhall diff --git a/tests/format/importLines2A.dhall b/dhall/tests/format/importLines2A.dhall similarity index 100% rename from tests/format/importLines2A.dhall rename to dhall/tests/format/importLines2A.dhall diff --git a/tests/format/importLines2B.dhall b/dhall/tests/format/importLines2B.dhall similarity index 100% rename from tests/format/importLines2B.dhall rename to dhall/tests/format/importLines2B.dhall diff --git a/tests/format/importLinesA.dhall b/dhall/tests/format/importLinesA.dhall similarity index 100% rename from tests/format/importLinesA.dhall rename to dhall/tests/format/importLinesA.dhall diff --git a/tests/format/importLinesB.dhall b/dhall/tests/format/importLinesB.dhall similarity index 100% rename from tests/format/importLinesB.dhall rename to dhall/tests/format/importLinesB.dhall diff --git a/tests/format/importSuffixA.dhall b/dhall/tests/format/importSuffixA.dhall similarity index 100% rename from tests/format/importSuffixA.dhall rename to dhall/tests/format/importSuffixA.dhall diff --git a/tests/format/importSuffixB.dhall b/dhall/tests/format/importSuffixB.dhall similarity index 100% rename from tests/format/importSuffixB.dhall rename to dhall/tests/format/importSuffixB.dhall diff --git a/tests/format/largeExponentA.dhall b/dhall/tests/format/largeExponentA.dhall similarity index 100% rename from tests/format/largeExponentA.dhall rename to dhall/tests/format/largeExponentA.dhall diff --git a/tests/format/largeExponentB.dhall b/dhall/tests/format/largeExponentB.dhall similarity index 100% rename from tests/format/largeExponentB.dhall rename to dhall/tests/format/largeExponentB.dhall diff --git a/tests/format/multilineA.dhall b/dhall/tests/format/multilineA.dhall similarity index 100% rename from tests/format/multilineA.dhall rename to dhall/tests/format/multilineA.dhall diff --git a/tests/format/multilineB.dhall b/dhall/tests/format/multilineB.dhall similarity index 100% rename from tests/format/multilineB.dhall rename to dhall/tests/format/multilineB.dhall diff --git a/tests/format/sha256PrintingA.dhall b/dhall/tests/format/sha256PrintingA.dhall similarity index 100% rename from tests/format/sha256PrintingA.dhall rename to dhall/tests/format/sha256PrintingA.dhall diff --git a/tests/format/sha256PrintingB.dhall b/dhall/tests/format/sha256PrintingB.dhall similarity index 100% rename from tests/format/sha256PrintingB.dhall rename to dhall/tests/format/sha256PrintingB.dhall diff --git a/tests/import/alternativeEnv.dhall b/dhall/tests/import/alternativeEnv.dhall similarity index 100% rename from tests/import/alternativeEnv.dhall rename to dhall/tests/import/alternativeEnv.dhall diff --git a/tests/import/alternativeEnvMissing.dhall b/dhall/tests/import/alternativeEnvMissing.dhall similarity index 100% rename from tests/import/alternativeEnvMissing.dhall rename to dhall/tests/import/alternativeEnvMissing.dhall diff --git a/tests/import/alternativeEnvNatural.dhall b/dhall/tests/import/alternativeEnvNatural.dhall similarity index 100% rename from tests/import/alternativeEnvNatural.dhall rename to dhall/tests/import/alternativeEnvNatural.dhall diff --git a/tests/import/alternativeEnvSimple.dhall b/dhall/tests/import/alternativeEnvSimple.dhall similarity index 100% rename from tests/import/alternativeEnvSimple.dhall rename to dhall/tests/import/alternativeEnvSimple.dhall diff --git a/tests/import/alternativeNatural.dhall b/dhall/tests/import/alternativeNatural.dhall similarity index 100% rename from tests/import/alternativeNatural.dhall rename to dhall/tests/import/alternativeNatural.dhall diff --git a/tests/import/data/foo/bar/a.dhall b/dhall/tests/import/data/foo/bar/a.dhall similarity index 100% rename from tests/import/data/foo/bar/a.dhall rename to dhall/tests/import/data/foo/bar/a.dhall diff --git a/tests/import/fieldOrderA.dhall b/dhall/tests/import/fieldOrderA.dhall similarity index 100% rename from tests/import/fieldOrderA.dhall rename to dhall/tests/import/fieldOrderA.dhall diff --git a/tests/import/fieldOrderB.dhall b/dhall/tests/import/fieldOrderB.dhall similarity index 100% rename from tests/import/fieldOrderB.dhall rename to dhall/tests/import/fieldOrderB.dhall diff --git a/tests/import/fieldOrderC.dhall b/dhall/tests/import/fieldOrderC.dhall similarity index 100% rename from tests/import/fieldOrderC.dhall rename to dhall/tests/import/fieldOrderC.dhall diff --git a/tests/import/issue553A.dhall b/dhall/tests/import/issue553A.dhall similarity index 100% rename from tests/import/issue553A.dhall rename to dhall/tests/import/issue553A.dhall diff --git a/tests/import/issue553B.dhall b/dhall/tests/import/issue553B.dhall similarity index 100% rename from tests/import/issue553B.dhall rename to dhall/tests/import/issue553B.dhall diff --git a/tests/import/missing.dhall b/dhall/tests/import/missing.dhall similarity index 100% rename from tests/import/missing.dhall rename to dhall/tests/import/missing.dhall diff --git a/tests/import/relative.dhall b/dhall/tests/import/relative.dhall similarity index 100% rename from tests/import/relative.dhall rename to dhall/tests/import/relative.dhall diff --git a/tests/normalization/doubleShowA.dhall b/dhall/tests/normalization/doubleShowA.dhall similarity index 100% rename from tests/normalization/doubleShowA.dhall rename to dhall/tests/normalization/doubleShowA.dhall diff --git a/tests/normalization/doubleShowB.dhall b/dhall/tests/normalization/doubleShowB.dhall similarity index 100% rename from tests/normalization/doubleShowB.dhall rename to dhall/tests/normalization/doubleShowB.dhall diff --git a/tests/normalization/examples/Bool/and/0A.dhall b/dhall/tests/normalization/examples/Bool/and/0A.dhall similarity index 100% rename from tests/normalization/examples/Bool/and/0A.dhall rename to dhall/tests/normalization/examples/Bool/and/0A.dhall diff --git a/tests/normalization/examples/Bool/and/0B.dhall b/dhall/tests/normalization/examples/Bool/and/0B.dhall similarity index 100% rename from tests/normalization/examples/Bool/and/0B.dhall rename to dhall/tests/normalization/examples/Bool/and/0B.dhall diff --git a/tests/normalization/examples/Bool/and/1A.dhall b/dhall/tests/normalization/examples/Bool/and/1A.dhall similarity index 100% rename from tests/normalization/examples/Bool/and/1A.dhall rename to dhall/tests/normalization/examples/Bool/and/1A.dhall diff --git a/tests/normalization/examples/Bool/and/1B.dhall b/dhall/tests/normalization/examples/Bool/and/1B.dhall similarity index 100% rename from tests/normalization/examples/Bool/and/1B.dhall rename to dhall/tests/normalization/examples/Bool/and/1B.dhall diff --git a/tests/normalization/examples/Bool/build/0A.dhall b/dhall/tests/normalization/examples/Bool/build/0A.dhall similarity index 100% rename from tests/normalization/examples/Bool/build/0A.dhall rename to dhall/tests/normalization/examples/Bool/build/0A.dhall diff --git a/tests/normalization/examples/Bool/build/0B.dhall b/dhall/tests/normalization/examples/Bool/build/0B.dhall similarity index 100% rename from tests/normalization/examples/Bool/build/0B.dhall rename to dhall/tests/normalization/examples/Bool/build/0B.dhall diff --git a/tests/normalization/examples/Bool/build/1A.dhall b/dhall/tests/normalization/examples/Bool/build/1A.dhall similarity index 100% rename from tests/normalization/examples/Bool/build/1A.dhall rename to dhall/tests/normalization/examples/Bool/build/1A.dhall diff --git a/tests/normalization/examples/Bool/build/1B.dhall b/dhall/tests/normalization/examples/Bool/build/1B.dhall similarity index 100% rename from tests/normalization/examples/Bool/build/1B.dhall rename to dhall/tests/normalization/examples/Bool/build/1B.dhall diff --git a/tests/normalization/examples/Bool/even/0A.dhall b/dhall/tests/normalization/examples/Bool/even/0A.dhall similarity index 100% rename from tests/normalization/examples/Bool/even/0A.dhall rename to dhall/tests/normalization/examples/Bool/even/0A.dhall diff --git a/tests/normalization/examples/Bool/even/0B.dhall b/dhall/tests/normalization/examples/Bool/even/0B.dhall similarity index 100% rename from tests/normalization/examples/Bool/even/0B.dhall rename to dhall/tests/normalization/examples/Bool/even/0B.dhall diff --git a/tests/normalization/examples/Bool/even/1A.dhall b/dhall/tests/normalization/examples/Bool/even/1A.dhall similarity index 100% rename from tests/normalization/examples/Bool/even/1A.dhall rename to dhall/tests/normalization/examples/Bool/even/1A.dhall diff --git a/tests/normalization/examples/Bool/even/1B.dhall b/dhall/tests/normalization/examples/Bool/even/1B.dhall similarity index 100% rename from tests/normalization/examples/Bool/even/1B.dhall rename to dhall/tests/normalization/examples/Bool/even/1B.dhall diff --git a/tests/normalization/examples/Bool/even/2A.dhall b/dhall/tests/normalization/examples/Bool/even/2A.dhall similarity index 100% rename from tests/normalization/examples/Bool/even/2A.dhall rename to dhall/tests/normalization/examples/Bool/even/2A.dhall diff --git a/tests/normalization/examples/Bool/even/2B.dhall b/dhall/tests/normalization/examples/Bool/even/2B.dhall similarity index 100% rename from tests/normalization/examples/Bool/even/2B.dhall rename to dhall/tests/normalization/examples/Bool/even/2B.dhall diff --git a/tests/normalization/examples/Bool/even/3A.dhall b/dhall/tests/normalization/examples/Bool/even/3A.dhall similarity index 100% rename from tests/normalization/examples/Bool/even/3A.dhall rename to dhall/tests/normalization/examples/Bool/even/3A.dhall diff --git a/tests/normalization/examples/Bool/even/3B.dhall b/dhall/tests/normalization/examples/Bool/even/3B.dhall similarity index 100% rename from tests/normalization/examples/Bool/even/3B.dhall rename to dhall/tests/normalization/examples/Bool/even/3B.dhall diff --git a/tests/normalization/examples/Bool/fold/0A.dhall b/dhall/tests/normalization/examples/Bool/fold/0A.dhall similarity index 100% rename from tests/normalization/examples/Bool/fold/0A.dhall rename to dhall/tests/normalization/examples/Bool/fold/0A.dhall diff --git a/tests/normalization/examples/Bool/fold/0B.dhall b/dhall/tests/normalization/examples/Bool/fold/0B.dhall similarity index 100% rename from tests/normalization/examples/Bool/fold/0B.dhall rename to dhall/tests/normalization/examples/Bool/fold/0B.dhall diff --git a/tests/normalization/examples/Bool/fold/1A.dhall b/dhall/tests/normalization/examples/Bool/fold/1A.dhall similarity index 100% rename from tests/normalization/examples/Bool/fold/1A.dhall rename to dhall/tests/normalization/examples/Bool/fold/1A.dhall diff --git a/tests/normalization/examples/Bool/fold/1B.dhall b/dhall/tests/normalization/examples/Bool/fold/1B.dhall similarity index 100% rename from tests/normalization/examples/Bool/fold/1B.dhall rename to dhall/tests/normalization/examples/Bool/fold/1B.dhall diff --git a/tests/normalization/examples/Bool/not/0A.dhall b/dhall/tests/normalization/examples/Bool/not/0A.dhall similarity index 100% rename from tests/normalization/examples/Bool/not/0A.dhall rename to dhall/tests/normalization/examples/Bool/not/0A.dhall diff --git a/tests/normalization/examples/Bool/not/0B.dhall b/dhall/tests/normalization/examples/Bool/not/0B.dhall similarity index 100% rename from tests/normalization/examples/Bool/not/0B.dhall rename to dhall/tests/normalization/examples/Bool/not/0B.dhall diff --git a/tests/normalization/examples/Bool/not/1A.dhall b/dhall/tests/normalization/examples/Bool/not/1A.dhall similarity index 100% rename from tests/normalization/examples/Bool/not/1A.dhall rename to dhall/tests/normalization/examples/Bool/not/1A.dhall diff --git a/tests/normalization/examples/Bool/not/1B.dhall b/dhall/tests/normalization/examples/Bool/not/1B.dhall similarity index 100% rename from tests/normalization/examples/Bool/not/1B.dhall rename to dhall/tests/normalization/examples/Bool/not/1B.dhall diff --git a/tests/normalization/examples/Bool/odd/0A.dhall b/dhall/tests/normalization/examples/Bool/odd/0A.dhall similarity index 100% rename from tests/normalization/examples/Bool/odd/0A.dhall rename to dhall/tests/normalization/examples/Bool/odd/0A.dhall diff --git a/tests/normalization/examples/Bool/odd/0B.dhall b/dhall/tests/normalization/examples/Bool/odd/0B.dhall similarity index 100% rename from tests/normalization/examples/Bool/odd/0B.dhall rename to dhall/tests/normalization/examples/Bool/odd/0B.dhall diff --git a/tests/normalization/examples/Bool/odd/1A.dhall b/dhall/tests/normalization/examples/Bool/odd/1A.dhall similarity index 100% rename from tests/normalization/examples/Bool/odd/1A.dhall rename to dhall/tests/normalization/examples/Bool/odd/1A.dhall diff --git a/tests/normalization/examples/Bool/odd/1B.dhall b/dhall/tests/normalization/examples/Bool/odd/1B.dhall similarity index 100% rename from tests/normalization/examples/Bool/odd/1B.dhall rename to dhall/tests/normalization/examples/Bool/odd/1B.dhall diff --git a/tests/normalization/examples/Bool/odd/2A.dhall b/dhall/tests/normalization/examples/Bool/odd/2A.dhall similarity index 100% rename from tests/normalization/examples/Bool/odd/2A.dhall rename to dhall/tests/normalization/examples/Bool/odd/2A.dhall diff --git a/tests/normalization/examples/Bool/odd/2B.dhall b/dhall/tests/normalization/examples/Bool/odd/2B.dhall similarity index 100% rename from tests/normalization/examples/Bool/odd/2B.dhall rename to dhall/tests/normalization/examples/Bool/odd/2B.dhall diff --git a/tests/normalization/examples/Bool/odd/3A.dhall b/dhall/tests/normalization/examples/Bool/odd/3A.dhall similarity index 100% rename from tests/normalization/examples/Bool/odd/3A.dhall rename to dhall/tests/normalization/examples/Bool/odd/3A.dhall diff --git a/tests/normalization/examples/Bool/odd/3B.dhall b/dhall/tests/normalization/examples/Bool/odd/3B.dhall similarity index 100% rename from tests/normalization/examples/Bool/odd/3B.dhall rename to dhall/tests/normalization/examples/Bool/odd/3B.dhall diff --git a/tests/normalization/examples/Bool/or/0A.dhall b/dhall/tests/normalization/examples/Bool/or/0A.dhall similarity index 100% rename from tests/normalization/examples/Bool/or/0A.dhall rename to dhall/tests/normalization/examples/Bool/or/0A.dhall diff --git a/tests/normalization/examples/Bool/or/0B.dhall b/dhall/tests/normalization/examples/Bool/or/0B.dhall similarity index 100% rename from tests/normalization/examples/Bool/or/0B.dhall rename to dhall/tests/normalization/examples/Bool/or/0B.dhall diff --git a/tests/normalization/examples/Bool/or/1A.dhall b/dhall/tests/normalization/examples/Bool/or/1A.dhall similarity index 100% rename from tests/normalization/examples/Bool/or/1A.dhall rename to dhall/tests/normalization/examples/Bool/or/1A.dhall diff --git a/tests/normalization/examples/Bool/or/1B.dhall b/dhall/tests/normalization/examples/Bool/or/1B.dhall similarity index 100% rename from tests/normalization/examples/Bool/or/1B.dhall rename to dhall/tests/normalization/examples/Bool/or/1B.dhall diff --git a/tests/normalization/examples/Bool/show/0A.dhall b/dhall/tests/normalization/examples/Bool/show/0A.dhall similarity index 100% rename from tests/normalization/examples/Bool/show/0A.dhall rename to dhall/tests/normalization/examples/Bool/show/0A.dhall diff --git a/tests/normalization/examples/Bool/show/0B.dhall b/dhall/tests/normalization/examples/Bool/show/0B.dhall similarity index 100% rename from tests/normalization/examples/Bool/show/0B.dhall rename to dhall/tests/normalization/examples/Bool/show/0B.dhall diff --git a/tests/normalization/examples/Bool/show/1A.dhall b/dhall/tests/normalization/examples/Bool/show/1A.dhall similarity index 100% rename from tests/normalization/examples/Bool/show/1A.dhall rename to dhall/tests/normalization/examples/Bool/show/1A.dhall diff --git a/tests/normalization/examples/Bool/show/1B.dhall b/dhall/tests/normalization/examples/Bool/show/1B.dhall similarity index 100% rename from tests/normalization/examples/Bool/show/1B.dhall rename to dhall/tests/normalization/examples/Bool/show/1B.dhall diff --git a/tests/normalization/examples/Double/show/0A.dhall b/dhall/tests/normalization/examples/Double/show/0A.dhall similarity index 100% rename from tests/normalization/examples/Double/show/0A.dhall rename to dhall/tests/normalization/examples/Double/show/0A.dhall diff --git a/tests/normalization/examples/Double/show/0B.dhall b/dhall/tests/normalization/examples/Double/show/0B.dhall similarity index 100% rename from tests/normalization/examples/Double/show/0B.dhall rename to dhall/tests/normalization/examples/Double/show/0B.dhall diff --git a/tests/normalization/examples/Double/show/1A.dhall b/dhall/tests/normalization/examples/Double/show/1A.dhall similarity index 100% rename from tests/normalization/examples/Double/show/1A.dhall rename to dhall/tests/normalization/examples/Double/show/1A.dhall diff --git a/tests/normalization/examples/Double/show/1B.dhall b/dhall/tests/normalization/examples/Double/show/1B.dhall similarity index 100% rename from tests/normalization/examples/Double/show/1B.dhall rename to dhall/tests/normalization/examples/Double/show/1B.dhall diff --git a/tests/normalization/examples/Integer/show/0A.dhall b/dhall/tests/normalization/examples/Integer/show/0A.dhall similarity index 100% rename from tests/normalization/examples/Integer/show/0A.dhall rename to dhall/tests/normalization/examples/Integer/show/0A.dhall diff --git a/tests/normalization/examples/Integer/show/0B.dhall b/dhall/tests/normalization/examples/Integer/show/0B.dhall similarity index 100% rename from tests/normalization/examples/Integer/show/0B.dhall rename to dhall/tests/normalization/examples/Integer/show/0B.dhall diff --git a/tests/normalization/examples/Integer/show/1A.dhall b/dhall/tests/normalization/examples/Integer/show/1A.dhall similarity index 100% rename from tests/normalization/examples/Integer/show/1A.dhall rename to dhall/tests/normalization/examples/Integer/show/1A.dhall diff --git a/tests/normalization/examples/Integer/show/1B.dhall b/dhall/tests/normalization/examples/Integer/show/1B.dhall similarity index 100% rename from tests/normalization/examples/Integer/show/1B.dhall rename to dhall/tests/normalization/examples/Integer/show/1B.dhall diff --git a/tests/normalization/examples/Integer/toDouble/0A.dhall b/dhall/tests/normalization/examples/Integer/toDouble/0A.dhall similarity index 100% rename from tests/normalization/examples/Integer/toDouble/0A.dhall rename to dhall/tests/normalization/examples/Integer/toDouble/0A.dhall diff --git a/tests/normalization/examples/Integer/toDouble/0B.dhall b/dhall/tests/normalization/examples/Integer/toDouble/0B.dhall similarity index 100% rename from tests/normalization/examples/Integer/toDouble/0B.dhall rename to dhall/tests/normalization/examples/Integer/toDouble/0B.dhall diff --git a/tests/normalization/examples/Integer/toDouble/1A.dhall b/dhall/tests/normalization/examples/Integer/toDouble/1A.dhall similarity index 100% rename from tests/normalization/examples/Integer/toDouble/1A.dhall rename to dhall/tests/normalization/examples/Integer/toDouble/1A.dhall diff --git a/tests/normalization/examples/Integer/toDouble/1B.dhall b/dhall/tests/normalization/examples/Integer/toDouble/1B.dhall similarity index 100% rename from tests/normalization/examples/Integer/toDouble/1B.dhall rename to dhall/tests/normalization/examples/Integer/toDouble/1B.dhall diff --git a/tests/normalization/examples/List/all/0A.dhall b/dhall/tests/normalization/examples/List/all/0A.dhall similarity index 100% rename from tests/normalization/examples/List/all/0A.dhall rename to dhall/tests/normalization/examples/List/all/0A.dhall diff --git a/tests/normalization/examples/List/all/0B.dhall b/dhall/tests/normalization/examples/List/all/0B.dhall similarity index 100% rename from tests/normalization/examples/List/all/0B.dhall rename to dhall/tests/normalization/examples/List/all/0B.dhall diff --git a/tests/normalization/examples/List/all/1A.dhall b/dhall/tests/normalization/examples/List/all/1A.dhall similarity index 100% rename from tests/normalization/examples/List/all/1A.dhall rename to dhall/tests/normalization/examples/List/all/1A.dhall diff --git a/tests/normalization/examples/List/all/1B.dhall b/dhall/tests/normalization/examples/List/all/1B.dhall similarity index 100% rename from tests/normalization/examples/List/all/1B.dhall rename to dhall/tests/normalization/examples/List/all/1B.dhall diff --git a/tests/normalization/examples/List/any/0A.dhall b/dhall/tests/normalization/examples/List/any/0A.dhall similarity index 100% rename from tests/normalization/examples/List/any/0A.dhall rename to dhall/tests/normalization/examples/List/any/0A.dhall diff --git a/tests/normalization/examples/List/any/0B.dhall b/dhall/tests/normalization/examples/List/any/0B.dhall similarity index 100% rename from tests/normalization/examples/List/any/0B.dhall rename to dhall/tests/normalization/examples/List/any/0B.dhall diff --git a/tests/normalization/examples/List/any/1A.dhall b/dhall/tests/normalization/examples/List/any/1A.dhall similarity index 100% rename from tests/normalization/examples/List/any/1A.dhall rename to dhall/tests/normalization/examples/List/any/1A.dhall diff --git a/tests/normalization/examples/List/any/1B.dhall b/dhall/tests/normalization/examples/List/any/1B.dhall similarity index 100% rename from tests/normalization/examples/List/any/1B.dhall rename to dhall/tests/normalization/examples/List/any/1B.dhall diff --git a/tests/normalization/examples/List/build/0A.dhall b/dhall/tests/normalization/examples/List/build/0A.dhall similarity index 100% rename from tests/normalization/examples/List/build/0A.dhall rename to dhall/tests/normalization/examples/List/build/0A.dhall diff --git a/tests/normalization/examples/List/build/0B.dhall b/dhall/tests/normalization/examples/List/build/0B.dhall similarity index 100% rename from tests/normalization/examples/List/build/0B.dhall rename to dhall/tests/normalization/examples/List/build/0B.dhall diff --git a/tests/normalization/examples/List/build/1A.dhall b/dhall/tests/normalization/examples/List/build/1A.dhall similarity index 100% rename from tests/normalization/examples/List/build/1A.dhall rename to dhall/tests/normalization/examples/List/build/1A.dhall diff --git a/tests/normalization/examples/List/build/1B.dhall b/dhall/tests/normalization/examples/List/build/1B.dhall similarity index 100% rename from tests/normalization/examples/List/build/1B.dhall rename to dhall/tests/normalization/examples/List/build/1B.dhall diff --git a/tests/normalization/examples/List/concat/0A.dhall b/dhall/tests/normalization/examples/List/concat/0A.dhall similarity index 100% rename from tests/normalization/examples/List/concat/0A.dhall rename to dhall/tests/normalization/examples/List/concat/0A.dhall diff --git a/tests/normalization/examples/List/concat/0B.dhall b/dhall/tests/normalization/examples/List/concat/0B.dhall similarity index 100% rename from tests/normalization/examples/List/concat/0B.dhall rename to dhall/tests/normalization/examples/List/concat/0B.dhall diff --git a/tests/normalization/examples/List/concat/1A.dhall b/dhall/tests/normalization/examples/List/concat/1A.dhall similarity index 100% rename from tests/normalization/examples/List/concat/1A.dhall rename to dhall/tests/normalization/examples/List/concat/1A.dhall diff --git a/tests/normalization/examples/List/concat/1B.dhall b/dhall/tests/normalization/examples/List/concat/1B.dhall similarity index 100% rename from tests/normalization/examples/List/concat/1B.dhall rename to dhall/tests/normalization/examples/List/concat/1B.dhall diff --git a/tests/normalization/examples/List/concatMap/0A.dhall b/dhall/tests/normalization/examples/List/concatMap/0A.dhall similarity index 100% rename from tests/normalization/examples/List/concatMap/0A.dhall rename to dhall/tests/normalization/examples/List/concatMap/0A.dhall diff --git a/tests/normalization/examples/List/concatMap/0B.dhall b/dhall/tests/normalization/examples/List/concatMap/0B.dhall similarity index 100% rename from tests/normalization/examples/List/concatMap/0B.dhall rename to dhall/tests/normalization/examples/List/concatMap/0B.dhall diff --git a/tests/normalization/examples/List/concatMap/1A.dhall b/dhall/tests/normalization/examples/List/concatMap/1A.dhall similarity index 100% rename from tests/normalization/examples/List/concatMap/1A.dhall rename to dhall/tests/normalization/examples/List/concatMap/1A.dhall diff --git a/tests/normalization/examples/List/concatMap/1B.dhall b/dhall/tests/normalization/examples/List/concatMap/1B.dhall similarity index 100% rename from tests/normalization/examples/List/concatMap/1B.dhall rename to dhall/tests/normalization/examples/List/concatMap/1B.dhall diff --git a/tests/normalization/examples/List/filter/0A.dhall b/dhall/tests/normalization/examples/List/filter/0A.dhall similarity index 100% rename from tests/normalization/examples/List/filter/0A.dhall rename to dhall/tests/normalization/examples/List/filter/0A.dhall diff --git a/tests/normalization/examples/List/filter/0B.dhall b/dhall/tests/normalization/examples/List/filter/0B.dhall similarity index 100% rename from tests/normalization/examples/List/filter/0B.dhall rename to dhall/tests/normalization/examples/List/filter/0B.dhall diff --git a/tests/normalization/examples/List/filter/1A.dhall b/dhall/tests/normalization/examples/List/filter/1A.dhall similarity index 100% rename from tests/normalization/examples/List/filter/1A.dhall rename to dhall/tests/normalization/examples/List/filter/1A.dhall diff --git a/tests/normalization/examples/List/filter/1B.dhall b/dhall/tests/normalization/examples/List/filter/1B.dhall similarity index 100% rename from tests/normalization/examples/List/filter/1B.dhall rename to dhall/tests/normalization/examples/List/filter/1B.dhall diff --git a/tests/normalization/examples/List/fold/0A.dhall b/dhall/tests/normalization/examples/List/fold/0A.dhall similarity index 100% rename from tests/normalization/examples/List/fold/0A.dhall rename to dhall/tests/normalization/examples/List/fold/0A.dhall diff --git a/tests/normalization/examples/List/fold/0B.dhall b/dhall/tests/normalization/examples/List/fold/0B.dhall similarity index 100% rename from tests/normalization/examples/List/fold/0B.dhall rename to dhall/tests/normalization/examples/List/fold/0B.dhall diff --git a/tests/normalization/examples/List/fold/1A.dhall b/dhall/tests/normalization/examples/List/fold/1A.dhall similarity index 100% rename from tests/normalization/examples/List/fold/1A.dhall rename to dhall/tests/normalization/examples/List/fold/1A.dhall diff --git a/tests/normalization/examples/List/fold/1B.dhall b/dhall/tests/normalization/examples/List/fold/1B.dhall similarity index 100% rename from tests/normalization/examples/List/fold/1B.dhall rename to dhall/tests/normalization/examples/List/fold/1B.dhall diff --git a/tests/normalization/examples/List/fold/2A.dhall b/dhall/tests/normalization/examples/List/fold/2A.dhall similarity index 100% rename from tests/normalization/examples/List/fold/2A.dhall rename to dhall/tests/normalization/examples/List/fold/2A.dhall diff --git a/tests/normalization/examples/List/fold/2B.dhall b/dhall/tests/normalization/examples/List/fold/2B.dhall similarity index 100% rename from tests/normalization/examples/List/fold/2B.dhall rename to dhall/tests/normalization/examples/List/fold/2B.dhall diff --git a/tests/normalization/examples/List/generate/0A.dhall b/dhall/tests/normalization/examples/List/generate/0A.dhall similarity index 100% rename from tests/normalization/examples/List/generate/0A.dhall rename to dhall/tests/normalization/examples/List/generate/0A.dhall diff --git a/tests/normalization/examples/List/generate/0B.dhall b/dhall/tests/normalization/examples/List/generate/0B.dhall similarity index 100% rename from tests/normalization/examples/List/generate/0B.dhall rename to dhall/tests/normalization/examples/List/generate/0B.dhall diff --git a/tests/normalization/examples/List/generate/1A.dhall b/dhall/tests/normalization/examples/List/generate/1A.dhall similarity index 100% rename from tests/normalization/examples/List/generate/1A.dhall rename to dhall/tests/normalization/examples/List/generate/1A.dhall diff --git a/tests/normalization/examples/List/generate/1B.dhall b/dhall/tests/normalization/examples/List/generate/1B.dhall similarity index 100% rename from tests/normalization/examples/List/generate/1B.dhall rename to dhall/tests/normalization/examples/List/generate/1B.dhall diff --git a/tests/normalization/examples/List/head/0A.dhall b/dhall/tests/normalization/examples/List/head/0A.dhall similarity index 100% rename from tests/normalization/examples/List/head/0A.dhall rename to dhall/tests/normalization/examples/List/head/0A.dhall diff --git a/tests/normalization/examples/List/head/0B.dhall b/dhall/tests/normalization/examples/List/head/0B.dhall similarity index 100% rename from tests/normalization/examples/List/head/0B.dhall rename to dhall/tests/normalization/examples/List/head/0B.dhall diff --git a/tests/normalization/examples/List/head/1A.dhall b/dhall/tests/normalization/examples/List/head/1A.dhall similarity index 100% rename from tests/normalization/examples/List/head/1A.dhall rename to dhall/tests/normalization/examples/List/head/1A.dhall diff --git a/tests/normalization/examples/List/head/1B.dhall b/dhall/tests/normalization/examples/List/head/1B.dhall similarity index 100% rename from tests/normalization/examples/List/head/1B.dhall rename to dhall/tests/normalization/examples/List/head/1B.dhall diff --git a/tests/normalization/examples/List/indexed/0A.dhall b/dhall/tests/normalization/examples/List/indexed/0A.dhall similarity index 100% rename from tests/normalization/examples/List/indexed/0A.dhall rename to dhall/tests/normalization/examples/List/indexed/0A.dhall diff --git a/tests/normalization/examples/List/indexed/0B.dhall b/dhall/tests/normalization/examples/List/indexed/0B.dhall similarity index 100% rename from tests/normalization/examples/List/indexed/0B.dhall rename to dhall/tests/normalization/examples/List/indexed/0B.dhall diff --git a/tests/normalization/examples/List/indexed/1A.dhall b/dhall/tests/normalization/examples/List/indexed/1A.dhall similarity index 100% rename from tests/normalization/examples/List/indexed/1A.dhall rename to dhall/tests/normalization/examples/List/indexed/1A.dhall diff --git a/tests/normalization/examples/List/indexed/1B.dhall b/dhall/tests/normalization/examples/List/indexed/1B.dhall similarity index 100% rename from tests/normalization/examples/List/indexed/1B.dhall rename to dhall/tests/normalization/examples/List/indexed/1B.dhall diff --git a/tests/normalization/examples/List/iterate/0A.dhall b/dhall/tests/normalization/examples/List/iterate/0A.dhall similarity index 100% rename from tests/normalization/examples/List/iterate/0A.dhall rename to dhall/tests/normalization/examples/List/iterate/0A.dhall diff --git a/tests/normalization/examples/List/iterate/0B.dhall b/dhall/tests/normalization/examples/List/iterate/0B.dhall similarity index 100% rename from tests/normalization/examples/List/iterate/0B.dhall rename to dhall/tests/normalization/examples/List/iterate/0B.dhall diff --git a/tests/normalization/examples/List/iterate/1A.dhall b/dhall/tests/normalization/examples/List/iterate/1A.dhall similarity index 100% rename from tests/normalization/examples/List/iterate/1A.dhall rename to dhall/tests/normalization/examples/List/iterate/1A.dhall diff --git a/tests/normalization/examples/List/iterate/1B.dhall b/dhall/tests/normalization/examples/List/iterate/1B.dhall similarity index 100% rename from tests/normalization/examples/List/iterate/1B.dhall rename to dhall/tests/normalization/examples/List/iterate/1B.dhall diff --git a/tests/normalization/examples/List/last/0A.dhall b/dhall/tests/normalization/examples/List/last/0A.dhall similarity index 100% rename from tests/normalization/examples/List/last/0A.dhall rename to dhall/tests/normalization/examples/List/last/0A.dhall diff --git a/tests/normalization/examples/List/last/0B.dhall b/dhall/tests/normalization/examples/List/last/0B.dhall similarity index 100% rename from tests/normalization/examples/List/last/0B.dhall rename to dhall/tests/normalization/examples/List/last/0B.dhall diff --git a/tests/normalization/examples/List/last/1A.dhall b/dhall/tests/normalization/examples/List/last/1A.dhall similarity index 100% rename from tests/normalization/examples/List/last/1A.dhall rename to dhall/tests/normalization/examples/List/last/1A.dhall diff --git a/tests/normalization/examples/List/last/1B.dhall b/dhall/tests/normalization/examples/List/last/1B.dhall similarity index 100% rename from tests/normalization/examples/List/last/1B.dhall rename to dhall/tests/normalization/examples/List/last/1B.dhall diff --git a/tests/normalization/examples/List/length/0A.dhall b/dhall/tests/normalization/examples/List/length/0A.dhall similarity index 100% rename from tests/normalization/examples/List/length/0A.dhall rename to dhall/tests/normalization/examples/List/length/0A.dhall diff --git a/tests/normalization/examples/List/length/0B.dhall b/dhall/tests/normalization/examples/List/length/0B.dhall similarity index 100% rename from tests/normalization/examples/List/length/0B.dhall rename to dhall/tests/normalization/examples/List/length/0B.dhall diff --git a/tests/normalization/examples/List/length/1A.dhall b/dhall/tests/normalization/examples/List/length/1A.dhall similarity index 100% rename from tests/normalization/examples/List/length/1A.dhall rename to dhall/tests/normalization/examples/List/length/1A.dhall diff --git a/tests/normalization/examples/List/length/1B.dhall b/dhall/tests/normalization/examples/List/length/1B.dhall similarity index 100% rename from tests/normalization/examples/List/length/1B.dhall rename to dhall/tests/normalization/examples/List/length/1B.dhall diff --git a/tests/normalization/examples/List/map/0A.dhall b/dhall/tests/normalization/examples/List/map/0A.dhall similarity index 100% rename from tests/normalization/examples/List/map/0A.dhall rename to dhall/tests/normalization/examples/List/map/0A.dhall diff --git a/tests/normalization/examples/List/map/0B.dhall b/dhall/tests/normalization/examples/List/map/0B.dhall similarity index 100% rename from tests/normalization/examples/List/map/0B.dhall rename to dhall/tests/normalization/examples/List/map/0B.dhall diff --git a/tests/normalization/examples/List/map/1A.dhall b/dhall/tests/normalization/examples/List/map/1A.dhall similarity index 100% rename from tests/normalization/examples/List/map/1A.dhall rename to dhall/tests/normalization/examples/List/map/1A.dhall diff --git a/tests/normalization/examples/List/map/1B.dhall b/dhall/tests/normalization/examples/List/map/1B.dhall similarity index 100% rename from tests/normalization/examples/List/map/1B.dhall rename to dhall/tests/normalization/examples/List/map/1B.dhall diff --git a/tests/normalization/examples/List/null/0A.dhall b/dhall/tests/normalization/examples/List/null/0A.dhall similarity index 100% rename from tests/normalization/examples/List/null/0A.dhall rename to dhall/tests/normalization/examples/List/null/0A.dhall diff --git a/tests/normalization/examples/List/null/0B.dhall b/dhall/tests/normalization/examples/List/null/0B.dhall similarity index 100% rename from tests/normalization/examples/List/null/0B.dhall rename to dhall/tests/normalization/examples/List/null/0B.dhall diff --git a/tests/normalization/examples/List/null/1A.dhall b/dhall/tests/normalization/examples/List/null/1A.dhall similarity index 100% rename from tests/normalization/examples/List/null/1A.dhall rename to dhall/tests/normalization/examples/List/null/1A.dhall diff --git a/tests/normalization/examples/List/null/1B.dhall b/dhall/tests/normalization/examples/List/null/1B.dhall similarity index 100% rename from tests/normalization/examples/List/null/1B.dhall rename to dhall/tests/normalization/examples/List/null/1B.dhall diff --git a/tests/normalization/examples/List/replicate/0A.dhall b/dhall/tests/normalization/examples/List/replicate/0A.dhall similarity index 100% rename from tests/normalization/examples/List/replicate/0A.dhall rename to dhall/tests/normalization/examples/List/replicate/0A.dhall diff --git a/tests/normalization/examples/List/replicate/0B.dhall b/dhall/tests/normalization/examples/List/replicate/0B.dhall similarity index 100% rename from tests/normalization/examples/List/replicate/0B.dhall rename to dhall/tests/normalization/examples/List/replicate/0B.dhall diff --git a/tests/normalization/examples/List/replicate/1A.dhall b/dhall/tests/normalization/examples/List/replicate/1A.dhall similarity index 100% rename from tests/normalization/examples/List/replicate/1A.dhall rename to dhall/tests/normalization/examples/List/replicate/1A.dhall diff --git a/tests/normalization/examples/List/replicate/1B.dhall b/dhall/tests/normalization/examples/List/replicate/1B.dhall similarity index 100% rename from tests/normalization/examples/List/replicate/1B.dhall rename to dhall/tests/normalization/examples/List/replicate/1B.dhall diff --git a/tests/normalization/examples/List/reverse/0A.dhall b/dhall/tests/normalization/examples/List/reverse/0A.dhall similarity index 100% rename from tests/normalization/examples/List/reverse/0A.dhall rename to dhall/tests/normalization/examples/List/reverse/0A.dhall diff --git a/tests/normalization/examples/List/reverse/0B.dhall b/dhall/tests/normalization/examples/List/reverse/0B.dhall similarity index 100% rename from tests/normalization/examples/List/reverse/0B.dhall rename to dhall/tests/normalization/examples/List/reverse/0B.dhall diff --git a/tests/normalization/examples/List/reverse/1A.dhall b/dhall/tests/normalization/examples/List/reverse/1A.dhall similarity index 100% rename from tests/normalization/examples/List/reverse/1A.dhall rename to dhall/tests/normalization/examples/List/reverse/1A.dhall diff --git a/tests/normalization/examples/List/reverse/1B.dhall b/dhall/tests/normalization/examples/List/reverse/1B.dhall similarity index 100% rename from tests/normalization/examples/List/reverse/1B.dhall rename to dhall/tests/normalization/examples/List/reverse/1B.dhall diff --git a/tests/normalization/examples/List/shifted/0A.dhall b/dhall/tests/normalization/examples/List/shifted/0A.dhall similarity index 100% rename from tests/normalization/examples/List/shifted/0A.dhall rename to dhall/tests/normalization/examples/List/shifted/0A.dhall diff --git a/tests/normalization/examples/List/shifted/0B.dhall b/dhall/tests/normalization/examples/List/shifted/0B.dhall similarity index 100% rename from tests/normalization/examples/List/shifted/0B.dhall rename to dhall/tests/normalization/examples/List/shifted/0B.dhall diff --git a/tests/normalization/examples/List/shifted/1A.dhall b/dhall/tests/normalization/examples/List/shifted/1A.dhall similarity index 100% rename from tests/normalization/examples/List/shifted/1A.dhall rename to dhall/tests/normalization/examples/List/shifted/1A.dhall diff --git a/tests/normalization/examples/List/shifted/1B.dhall b/dhall/tests/normalization/examples/List/shifted/1B.dhall similarity index 100% rename from tests/normalization/examples/List/shifted/1B.dhall rename to dhall/tests/normalization/examples/List/shifted/1B.dhall diff --git a/tests/normalization/examples/List/unzip/0A.dhall b/dhall/tests/normalization/examples/List/unzip/0A.dhall similarity index 100% rename from tests/normalization/examples/List/unzip/0A.dhall rename to dhall/tests/normalization/examples/List/unzip/0A.dhall diff --git a/tests/normalization/examples/List/unzip/0B.dhall b/dhall/tests/normalization/examples/List/unzip/0B.dhall similarity index 100% rename from tests/normalization/examples/List/unzip/0B.dhall rename to dhall/tests/normalization/examples/List/unzip/0B.dhall diff --git a/tests/normalization/examples/List/unzip/1A.dhall b/dhall/tests/normalization/examples/List/unzip/1A.dhall similarity index 100% rename from tests/normalization/examples/List/unzip/1A.dhall rename to dhall/tests/normalization/examples/List/unzip/1A.dhall diff --git a/tests/normalization/examples/List/unzip/1B.dhall b/dhall/tests/normalization/examples/List/unzip/1B.dhall similarity index 100% rename from tests/normalization/examples/List/unzip/1B.dhall rename to dhall/tests/normalization/examples/List/unzip/1B.dhall diff --git a/tests/normalization/examples/Natural/build/0A.dhall b/dhall/tests/normalization/examples/Natural/build/0A.dhall similarity index 100% rename from tests/normalization/examples/Natural/build/0A.dhall rename to dhall/tests/normalization/examples/Natural/build/0A.dhall diff --git a/tests/normalization/examples/Natural/build/0B.dhall b/dhall/tests/normalization/examples/Natural/build/0B.dhall similarity index 100% rename from tests/normalization/examples/Natural/build/0B.dhall rename to dhall/tests/normalization/examples/Natural/build/0B.dhall diff --git a/tests/normalization/examples/Natural/build/1A.dhall b/dhall/tests/normalization/examples/Natural/build/1A.dhall similarity index 100% rename from tests/normalization/examples/Natural/build/1A.dhall rename to dhall/tests/normalization/examples/Natural/build/1A.dhall diff --git a/tests/normalization/examples/Natural/build/1B.dhall b/dhall/tests/normalization/examples/Natural/build/1B.dhall similarity index 100% rename from tests/normalization/examples/Natural/build/1B.dhall rename to dhall/tests/normalization/examples/Natural/build/1B.dhall diff --git a/tests/normalization/examples/Natural/enumerate/0A.dhall b/dhall/tests/normalization/examples/Natural/enumerate/0A.dhall similarity index 100% rename from tests/normalization/examples/Natural/enumerate/0A.dhall rename to dhall/tests/normalization/examples/Natural/enumerate/0A.dhall diff --git a/tests/normalization/examples/Natural/enumerate/0B.dhall b/dhall/tests/normalization/examples/Natural/enumerate/0B.dhall similarity index 100% rename from tests/normalization/examples/Natural/enumerate/0B.dhall rename to dhall/tests/normalization/examples/Natural/enumerate/0B.dhall diff --git a/tests/normalization/examples/Natural/enumerate/1A.dhall b/dhall/tests/normalization/examples/Natural/enumerate/1A.dhall similarity index 100% rename from tests/normalization/examples/Natural/enumerate/1A.dhall rename to dhall/tests/normalization/examples/Natural/enumerate/1A.dhall diff --git a/tests/normalization/examples/Natural/enumerate/1B.dhall b/dhall/tests/normalization/examples/Natural/enumerate/1B.dhall similarity index 100% rename from tests/normalization/examples/Natural/enumerate/1B.dhall rename to dhall/tests/normalization/examples/Natural/enumerate/1B.dhall diff --git a/tests/normalization/examples/Natural/even/0A.dhall b/dhall/tests/normalization/examples/Natural/even/0A.dhall similarity index 100% rename from tests/normalization/examples/Natural/even/0A.dhall rename to dhall/tests/normalization/examples/Natural/even/0A.dhall diff --git a/tests/normalization/examples/Natural/even/0B.dhall b/dhall/tests/normalization/examples/Natural/even/0B.dhall similarity index 100% rename from tests/normalization/examples/Natural/even/0B.dhall rename to dhall/tests/normalization/examples/Natural/even/0B.dhall diff --git a/tests/normalization/examples/Natural/even/1A.dhall b/dhall/tests/normalization/examples/Natural/even/1A.dhall similarity index 100% rename from tests/normalization/examples/Natural/even/1A.dhall rename to dhall/tests/normalization/examples/Natural/even/1A.dhall diff --git a/tests/normalization/examples/Natural/even/1B.dhall b/dhall/tests/normalization/examples/Natural/even/1B.dhall similarity index 100% rename from tests/normalization/examples/Natural/even/1B.dhall rename to dhall/tests/normalization/examples/Natural/even/1B.dhall diff --git a/tests/normalization/examples/Natural/fold/0A.dhall b/dhall/tests/normalization/examples/Natural/fold/0A.dhall similarity index 100% rename from tests/normalization/examples/Natural/fold/0A.dhall rename to dhall/tests/normalization/examples/Natural/fold/0A.dhall diff --git a/tests/normalization/examples/Natural/fold/0B.dhall b/dhall/tests/normalization/examples/Natural/fold/0B.dhall similarity index 100% rename from tests/normalization/examples/Natural/fold/0B.dhall rename to dhall/tests/normalization/examples/Natural/fold/0B.dhall diff --git a/tests/normalization/examples/Natural/fold/1A.dhall b/dhall/tests/normalization/examples/Natural/fold/1A.dhall similarity index 100% rename from tests/normalization/examples/Natural/fold/1A.dhall rename to dhall/tests/normalization/examples/Natural/fold/1A.dhall diff --git a/tests/normalization/examples/Natural/fold/1B.dhall b/dhall/tests/normalization/examples/Natural/fold/1B.dhall similarity index 100% rename from tests/normalization/examples/Natural/fold/1B.dhall rename to dhall/tests/normalization/examples/Natural/fold/1B.dhall diff --git a/tests/normalization/examples/Natural/fold/2A.dhall b/dhall/tests/normalization/examples/Natural/fold/2A.dhall similarity index 100% rename from tests/normalization/examples/Natural/fold/2A.dhall rename to dhall/tests/normalization/examples/Natural/fold/2A.dhall diff --git a/tests/normalization/examples/Natural/fold/2B.dhall b/dhall/tests/normalization/examples/Natural/fold/2B.dhall similarity index 100% rename from tests/normalization/examples/Natural/fold/2B.dhall rename to dhall/tests/normalization/examples/Natural/fold/2B.dhall diff --git a/tests/normalization/examples/Natural/isZero/0A.dhall b/dhall/tests/normalization/examples/Natural/isZero/0A.dhall similarity index 100% rename from tests/normalization/examples/Natural/isZero/0A.dhall rename to dhall/tests/normalization/examples/Natural/isZero/0A.dhall diff --git a/tests/normalization/examples/Natural/isZero/0B.dhall b/dhall/tests/normalization/examples/Natural/isZero/0B.dhall similarity index 100% rename from tests/normalization/examples/Natural/isZero/0B.dhall rename to dhall/tests/normalization/examples/Natural/isZero/0B.dhall diff --git a/tests/normalization/examples/Natural/isZero/1A.dhall b/dhall/tests/normalization/examples/Natural/isZero/1A.dhall similarity index 100% rename from tests/normalization/examples/Natural/isZero/1A.dhall rename to dhall/tests/normalization/examples/Natural/isZero/1A.dhall diff --git a/tests/normalization/examples/Natural/isZero/1B.dhall b/dhall/tests/normalization/examples/Natural/isZero/1B.dhall similarity index 100% rename from tests/normalization/examples/Natural/isZero/1B.dhall rename to dhall/tests/normalization/examples/Natural/isZero/1B.dhall diff --git a/tests/normalization/examples/Natural/odd/0A.dhall b/dhall/tests/normalization/examples/Natural/odd/0A.dhall similarity index 100% rename from tests/normalization/examples/Natural/odd/0A.dhall rename to dhall/tests/normalization/examples/Natural/odd/0A.dhall diff --git a/tests/normalization/examples/Natural/odd/0B.dhall b/dhall/tests/normalization/examples/Natural/odd/0B.dhall similarity index 100% rename from tests/normalization/examples/Natural/odd/0B.dhall rename to dhall/tests/normalization/examples/Natural/odd/0B.dhall diff --git a/tests/normalization/examples/Natural/odd/1A.dhall b/dhall/tests/normalization/examples/Natural/odd/1A.dhall similarity index 100% rename from tests/normalization/examples/Natural/odd/1A.dhall rename to dhall/tests/normalization/examples/Natural/odd/1A.dhall diff --git a/tests/normalization/examples/Natural/odd/1B.dhall b/dhall/tests/normalization/examples/Natural/odd/1B.dhall similarity index 100% rename from tests/normalization/examples/Natural/odd/1B.dhall rename to dhall/tests/normalization/examples/Natural/odd/1B.dhall diff --git a/tests/normalization/examples/Natural/product/0A.dhall b/dhall/tests/normalization/examples/Natural/product/0A.dhall similarity index 100% rename from tests/normalization/examples/Natural/product/0A.dhall rename to dhall/tests/normalization/examples/Natural/product/0A.dhall diff --git a/tests/normalization/examples/Natural/product/0B.dhall b/dhall/tests/normalization/examples/Natural/product/0B.dhall similarity index 100% rename from tests/normalization/examples/Natural/product/0B.dhall rename to dhall/tests/normalization/examples/Natural/product/0B.dhall diff --git a/tests/normalization/examples/Natural/product/1A.dhall b/dhall/tests/normalization/examples/Natural/product/1A.dhall similarity index 100% rename from tests/normalization/examples/Natural/product/1A.dhall rename to dhall/tests/normalization/examples/Natural/product/1A.dhall diff --git a/tests/normalization/examples/Natural/product/1B.dhall b/dhall/tests/normalization/examples/Natural/product/1B.dhall similarity index 100% rename from tests/normalization/examples/Natural/product/1B.dhall rename to dhall/tests/normalization/examples/Natural/product/1B.dhall diff --git a/tests/normalization/examples/Natural/show/0A.dhall b/dhall/tests/normalization/examples/Natural/show/0A.dhall similarity index 100% rename from tests/normalization/examples/Natural/show/0A.dhall rename to dhall/tests/normalization/examples/Natural/show/0A.dhall diff --git a/tests/normalization/examples/Natural/show/0B.dhall b/dhall/tests/normalization/examples/Natural/show/0B.dhall similarity index 100% rename from tests/normalization/examples/Natural/show/0B.dhall rename to dhall/tests/normalization/examples/Natural/show/0B.dhall diff --git a/tests/normalization/examples/Natural/show/1A.dhall b/dhall/tests/normalization/examples/Natural/show/1A.dhall similarity index 100% rename from tests/normalization/examples/Natural/show/1A.dhall rename to dhall/tests/normalization/examples/Natural/show/1A.dhall diff --git a/tests/normalization/examples/Natural/show/1B.dhall b/dhall/tests/normalization/examples/Natural/show/1B.dhall similarity index 100% rename from tests/normalization/examples/Natural/show/1B.dhall rename to dhall/tests/normalization/examples/Natural/show/1B.dhall diff --git a/tests/normalization/examples/Natural/sum/0A.dhall b/dhall/tests/normalization/examples/Natural/sum/0A.dhall similarity index 100% rename from tests/normalization/examples/Natural/sum/0A.dhall rename to dhall/tests/normalization/examples/Natural/sum/0A.dhall diff --git a/tests/normalization/examples/Natural/sum/0B.dhall b/dhall/tests/normalization/examples/Natural/sum/0B.dhall similarity index 100% rename from tests/normalization/examples/Natural/sum/0B.dhall rename to dhall/tests/normalization/examples/Natural/sum/0B.dhall diff --git a/tests/normalization/examples/Natural/sum/1A.dhall b/dhall/tests/normalization/examples/Natural/sum/1A.dhall similarity index 100% rename from tests/normalization/examples/Natural/sum/1A.dhall rename to dhall/tests/normalization/examples/Natural/sum/1A.dhall diff --git a/tests/normalization/examples/Natural/sum/1B.dhall b/dhall/tests/normalization/examples/Natural/sum/1B.dhall similarity index 100% rename from tests/normalization/examples/Natural/sum/1B.dhall rename to dhall/tests/normalization/examples/Natural/sum/1B.dhall diff --git a/tests/normalization/examples/Natural/toDouble/0A.dhall b/dhall/tests/normalization/examples/Natural/toDouble/0A.dhall similarity index 100% rename from tests/normalization/examples/Natural/toDouble/0A.dhall rename to dhall/tests/normalization/examples/Natural/toDouble/0A.dhall diff --git a/tests/normalization/examples/Natural/toDouble/0B.dhall b/dhall/tests/normalization/examples/Natural/toDouble/0B.dhall similarity index 100% rename from tests/normalization/examples/Natural/toDouble/0B.dhall rename to dhall/tests/normalization/examples/Natural/toDouble/0B.dhall diff --git a/tests/normalization/examples/Natural/toDouble/1A.dhall b/dhall/tests/normalization/examples/Natural/toDouble/1A.dhall similarity index 100% rename from tests/normalization/examples/Natural/toDouble/1A.dhall rename to dhall/tests/normalization/examples/Natural/toDouble/1A.dhall diff --git a/tests/normalization/examples/Natural/toDouble/1B.dhall b/dhall/tests/normalization/examples/Natural/toDouble/1B.dhall similarity index 100% rename from tests/normalization/examples/Natural/toDouble/1B.dhall rename to dhall/tests/normalization/examples/Natural/toDouble/1B.dhall diff --git a/tests/normalization/examples/Natural/toInteger/0A.dhall b/dhall/tests/normalization/examples/Natural/toInteger/0A.dhall similarity index 100% rename from tests/normalization/examples/Natural/toInteger/0A.dhall rename to dhall/tests/normalization/examples/Natural/toInteger/0A.dhall diff --git a/tests/normalization/examples/Natural/toInteger/0B.dhall b/dhall/tests/normalization/examples/Natural/toInteger/0B.dhall similarity index 100% rename from tests/normalization/examples/Natural/toInteger/0B.dhall rename to dhall/tests/normalization/examples/Natural/toInteger/0B.dhall diff --git a/tests/normalization/examples/Natural/toInteger/1A.dhall b/dhall/tests/normalization/examples/Natural/toInteger/1A.dhall similarity index 100% rename from tests/normalization/examples/Natural/toInteger/1A.dhall rename to dhall/tests/normalization/examples/Natural/toInteger/1A.dhall diff --git a/tests/normalization/examples/Natural/toInteger/1B.dhall b/dhall/tests/normalization/examples/Natural/toInteger/1B.dhall similarity index 100% rename from tests/normalization/examples/Natural/toInteger/1B.dhall rename to dhall/tests/normalization/examples/Natural/toInteger/1B.dhall diff --git a/tests/normalization/examples/Optional/all/0A.dhall b/dhall/tests/normalization/examples/Optional/all/0A.dhall similarity index 100% rename from tests/normalization/examples/Optional/all/0A.dhall rename to dhall/tests/normalization/examples/Optional/all/0A.dhall diff --git a/tests/normalization/examples/Optional/all/0B.dhall b/dhall/tests/normalization/examples/Optional/all/0B.dhall similarity index 100% rename from tests/normalization/examples/Optional/all/0B.dhall rename to dhall/tests/normalization/examples/Optional/all/0B.dhall diff --git a/tests/normalization/examples/Optional/all/1A.dhall b/dhall/tests/normalization/examples/Optional/all/1A.dhall similarity index 100% rename from tests/normalization/examples/Optional/all/1A.dhall rename to dhall/tests/normalization/examples/Optional/all/1A.dhall diff --git a/tests/normalization/examples/Optional/all/1B.dhall b/dhall/tests/normalization/examples/Optional/all/1B.dhall similarity index 100% rename from tests/normalization/examples/Optional/all/1B.dhall rename to dhall/tests/normalization/examples/Optional/all/1B.dhall diff --git a/tests/normalization/examples/Optional/any/0A.dhall b/dhall/tests/normalization/examples/Optional/any/0A.dhall similarity index 100% rename from tests/normalization/examples/Optional/any/0A.dhall rename to dhall/tests/normalization/examples/Optional/any/0A.dhall diff --git a/tests/normalization/examples/Optional/any/0B.dhall b/dhall/tests/normalization/examples/Optional/any/0B.dhall similarity index 100% rename from tests/normalization/examples/Optional/any/0B.dhall rename to dhall/tests/normalization/examples/Optional/any/0B.dhall diff --git a/tests/normalization/examples/Optional/any/1A.dhall b/dhall/tests/normalization/examples/Optional/any/1A.dhall similarity index 100% rename from tests/normalization/examples/Optional/any/1A.dhall rename to dhall/tests/normalization/examples/Optional/any/1A.dhall diff --git a/tests/normalization/examples/Optional/any/1B.dhall b/dhall/tests/normalization/examples/Optional/any/1B.dhall similarity index 100% rename from tests/normalization/examples/Optional/any/1B.dhall rename to dhall/tests/normalization/examples/Optional/any/1B.dhall diff --git a/tests/normalization/examples/Optional/build/0A.dhall b/dhall/tests/normalization/examples/Optional/build/0A.dhall similarity index 100% rename from tests/normalization/examples/Optional/build/0A.dhall rename to dhall/tests/normalization/examples/Optional/build/0A.dhall diff --git a/tests/normalization/examples/Optional/build/0B.dhall b/dhall/tests/normalization/examples/Optional/build/0B.dhall similarity index 100% rename from tests/normalization/examples/Optional/build/0B.dhall rename to dhall/tests/normalization/examples/Optional/build/0B.dhall diff --git a/tests/normalization/examples/Optional/build/1A.dhall b/dhall/tests/normalization/examples/Optional/build/1A.dhall similarity index 100% rename from tests/normalization/examples/Optional/build/1A.dhall rename to dhall/tests/normalization/examples/Optional/build/1A.dhall diff --git a/tests/normalization/examples/Optional/build/1B.dhall b/dhall/tests/normalization/examples/Optional/build/1B.dhall similarity index 100% rename from tests/normalization/examples/Optional/build/1B.dhall rename to dhall/tests/normalization/examples/Optional/build/1B.dhall diff --git a/tests/normalization/examples/Optional/concat/0A.dhall b/dhall/tests/normalization/examples/Optional/concat/0A.dhall similarity index 100% rename from tests/normalization/examples/Optional/concat/0A.dhall rename to dhall/tests/normalization/examples/Optional/concat/0A.dhall diff --git a/tests/normalization/examples/Optional/concat/0B.dhall b/dhall/tests/normalization/examples/Optional/concat/0B.dhall similarity index 100% rename from tests/normalization/examples/Optional/concat/0B.dhall rename to dhall/tests/normalization/examples/Optional/concat/0B.dhall diff --git a/tests/normalization/examples/Optional/concat/1A.dhall b/dhall/tests/normalization/examples/Optional/concat/1A.dhall similarity index 100% rename from tests/normalization/examples/Optional/concat/1A.dhall rename to dhall/tests/normalization/examples/Optional/concat/1A.dhall diff --git a/tests/normalization/examples/Optional/concat/1B.dhall b/dhall/tests/normalization/examples/Optional/concat/1B.dhall similarity index 100% rename from tests/normalization/examples/Optional/concat/1B.dhall rename to dhall/tests/normalization/examples/Optional/concat/1B.dhall diff --git a/tests/normalization/examples/Optional/concat/2A.dhall b/dhall/tests/normalization/examples/Optional/concat/2A.dhall similarity index 100% rename from tests/normalization/examples/Optional/concat/2A.dhall rename to dhall/tests/normalization/examples/Optional/concat/2A.dhall diff --git a/tests/normalization/examples/Optional/concat/2B.dhall b/dhall/tests/normalization/examples/Optional/concat/2B.dhall similarity index 100% rename from tests/normalization/examples/Optional/concat/2B.dhall rename to dhall/tests/normalization/examples/Optional/concat/2B.dhall diff --git a/tests/normalization/examples/Optional/filter/0A.dhall b/dhall/tests/normalization/examples/Optional/filter/0A.dhall similarity index 100% rename from tests/normalization/examples/Optional/filter/0A.dhall rename to dhall/tests/normalization/examples/Optional/filter/0A.dhall diff --git a/tests/normalization/examples/Optional/filter/0B.dhall b/dhall/tests/normalization/examples/Optional/filter/0B.dhall similarity index 100% rename from tests/normalization/examples/Optional/filter/0B.dhall rename to dhall/tests/normalization/examples/Optional/filter/0B.dhall diff --git a/tests/normalization/examples/Optional/filter/1A.dhall b/dhall/tests/normalization/examples/Optional/filter/1A.dhall similarity index 100% rename from tests/normalization/examples/Optional/filter/1A.dhall rename to dhall/tests/normalization/examples/Optional/filter/1A.dhall diff --git a/tests/normalization/examples/Optional/filter/1B.dhall b/dhall/tests/normalization/examples/Optional/filter/1B.dhall similarity index 100% rename from tests/normalization/examples/Optional/filter/1B.dhall rename to dhall/tests/normalization/examples/Optional/filter/1B.dhall diff --git a/tests/normalization/examples/Optional/fold/0A.dhall b/dhall/tests/normalization/examples/Optional/fold/0A.dhall similarity index 100% rename from tests/normalization/examples/Optional/fold/0A.dhall rename to dhall/tests/normalization/examples/Optional/fold/0A.dhall diff --git a/tests/normalization/examples/Optional/fold/0B.dhall b/dhall/tests/normalization/examples/Optional/fold/0B.dhall similarity index 100% rename from tests/normalization/examples/Optional/fold/0B.dhall rename to dhall/tests/normalization/examples/Optional/fold/0B.dhall diff --git a/tests/normalization/examples/Optional/fold/1A.dhall b/dhall/tests/normalization/examples/Optional/fold/1A.dhall similarity index 100% rename from tests/normalization/examples/Optional/fold/1A.dhall rename to dhall/tests/normalization/examples/Optional/fold/1A.dhall diff --git a/tests/normalization/examples/Optional/fold/1B.dhall b/dhall/tests/normalization/examples/Optional/fold/1B.dhall similarity index 100% rename from tests/normalization/examples/Optional/fold/1B.dhall rename to dhall/tests/normalization/examples/Optional/fold/1B.dhall diff --git a/tests/normalization/examples/Optional/head/0A.dhall b/dhall/tests/normalization/examples/Optional/head/0A.dhall similarity index 100% rename from tests/normalization/examples/Optional/head/0A.dhall rename to dhall/tests/normalization/examples/Optional/head/0A.dhall diff --git a/tests/normalization/examples/Optional/head/0B.dhall b/dhall/tests/normalization/examples/Optional/head/0B.dhall similarity index 100% rename from tests/normalization/examples/Optional/head/0B.dhall rename to dhall/tests/normalization/examples/Optional/head/0B.dhall diff --git a/tests/normalization/examples/Optional/head/1A.dhall b/dhall/tests/normalization/examples/Optional/head/1A.dhall similarity index 100% rename from tests/normalization/examples/Optional/head/1A.dhall rename to dhall/tests/normalization/examples/Optional/head/1A.dhall diff --git a/tests/normalization/examples/Optional/head/1B.dhall b/dhall/tests/normalization/examples/Optional/head/1B.dhall similarity index 100% rename from tests/normalization/examples/Optional/head/1B.dhall rename to dhall/tests/normalization/examples/Optional/head/1B.dhall diff --git a/tests/normalization/examples/Optional/head/2A.dhall b/dhall/tests/normalization/examples/Optional/head/2A.dhall similarity index 100% rename from tests/normalization/examples/Optional/head/2A.dhall rename to dhall/tests/normalization/examples/Optional/head/2A.dhall diff --git a/tests/normalization/examples/Optional/head/2B.dhall b/dhall/tests/normalization/examples/Optional/head/2B.dhall similarity index 100% rename from tests/normalization/examples/Optional/head/2B.dhall rename to dhall/tests/normalization/examples/Optional/head/2B.dhall diff --git a/tests/normalization/examples/Optional/last/0A.dhall b/dhall/tests/normalization/examples/Optional/last/0A.dhall similarity index 100% rename from tests/normalization/examples/Optional/last/0A.dhall rename to dhall/tests/normalization/examples/Optional/last/0A.dhall diff --git a/tests/normalization/examples/Optional/last/0B.dhall b/dhall/tests/normalization/examples/Optional/last/0B.dhall similarity index 100% rename from tests/normalization/examples/Optional/last/0B.dhall rename to dhall/tests/normalization/examples/Optional/last/0B.dhall diff --git a/tests/normalization/examples/Optional/last/1A.dhall b/dhall/tests/normalization/examples/Optional/last/1A.dhall similarity index 100% rename from tests/normalization/examples/Optional/last/1A.dhall rename to dhall/tests/normalization/examples/Optional/last/1A.dhall diff --git a/tests/normalization/examples/Optional/last/1B.dhall b/dhall/tests/normalization/examples/Optional/last/1B.dhall similarity index 100% rename from tests/normalization/examples/Optional/last/1B.dhall rename to dhall/tests/normalization/examples/Optional/last/1B.dhall diff --git a/tests/normalization/examples/Optional/last/2A.dhall b/dhall/tests/normalization/examples/Optional/last/2A.dhall similarity index 100% rename from tests/normalization/examples/Optional/last/2A.dhall rename to dhall/tests/normalization/examples/Optional/last/2A.dhall diff --git a/tests/normalization/examples/Optional/last/2B.dhall b/dhall/tests/normalization/examples/Optional/last/2B.dhall similarity index 100% rename from tests/normalization/examples/Optional/last/2B.dhall rename to dhall/tests/normalization/examples/Optional/last/2B.dhall diff --git a/tests/normalization/examples/Optional/length/0A.dhall b/dhall/tests/normalization/examples/Optional/length/0A.dhall similarity index 100% rename from tests/normalization/examples/Optional/length/0A.dhall rename to dhall/tests/normalization/examples/Optional/length/0A.dhall diff --git a/tests/normalization/examples/Optional/length/0B.dhall b/dhall/tests/normalization/examples/Optional/length/0B.dhall similarity index 100% rename from tests/normalization/examples/Optional/length/0B.dhall rename to dhall/tests/normalization/examples/Optional/length/0B.dhall diff --git a/tests/normalization/examples/Optional/length/1A.dhall b/dhall/tests/normalization/examples/Optional/length/1A.dhall similarity index 100% rename from tests/normalization/examples/Optional/length/1A.dhall rename to dhall/tests/normalization/examples/Optional/length/1A.dhall diff --git a/tests/normalization/examples/Optional/length/1B.dhall b/dhall/tests/normalization/examples/Optional/length/1B.dhall similarity index 100% rename from tests/normalization/examples/Optional/length/1B.dhall rename to dhall/tests/normalization/examples/Optional/length/1B.dhall diff --git a/tests/normalization/examples/Optional/map/0A.dhall b/dhall/tests/normalization/examples/Optional/map/0A.dhall similarity index 100% rename from tests/normalization/examples/Optional/map/0A.dhall rename to dhall/tests/normalization/examples/Optional/map/0A.dhall diff --git a/tests/normalization/examples/Optional/map/0B.dhall b/dhall/tests/normalization/examples/Optional/map/0B.dhall similarity index 100% rename from tests/normalization/examples/Optional/map/0B.dhall rename to dhall/tests/normalization/examples/Optional/map/0B.dhall diff --git a/tests/normalization/examples/Optional/map/1A.dhall b/dhall/tests/normalization/examples/Optional/map/1A.dhall similarity index 100% rename from tests/normalization/examples/Optional/map/1A.dhall rename to dhall/tests/normalization/examples/Optional/map/1A.dhall diff --git a/tests/normalization/examples/Optional/map/1B.dhall b/dhall/tests/normalization/examples/Optional/map/1B.dhall similarity index 100% rename from tests/normalization/examples/Optional/map/1B.dhall rename to dhall/tests/normalization/examples/Optional/map/1B.dhall diff --git a/tests/normalization/examples/Optional/null/0A.dhall b/dhall/tests/normalization/examples/Optional/null/0A.dhall similarity index 100% rename from tests/normalization/examples/Optional/null/0A.dhall rename to dhall/tests/normalization/examples/Optional/null/0A.dhall diff --git a/tests/normalization/examples/Optional/null/0B.dhall b/dhall/tests/normalization/examples/Optional/null/0B.dhall similarity index 100% rename from tests/normalization/examples/Optional/null/0B.dhall rename to dhall/tests/normalization/examples/Optional/null/0B.dhall diff --git a/tests/normalization/examples/Optional/null/1A.dhall b/dhall/tests/normalization/examples/Optional/null/1A.dhall similarity index 100% rename from tests/normalization/examples/Optional/null/1A.dhall rename to dhall/tests/normalization/examples/Optional/null/1A.dhall diff --git a/tests/normalization/examples/Optional/null/1B.dhall b/dhall/tests/normalization/examples/Optional/null/1B.dhall similarity index 100% rename from tests/normalization/examples/Optional/null/1B.dhall rename to dhall/tests/normalization/examples/Optional/null/1B.dhall diff --git a/tests/normalization/examples/Optional/toList/0A.dhall b/dhall/tests/normalization/examples/Optional/toList/0A.dhall similarity index 100% rename from tests/normalization/examples/Optional/toList/0A.dhall rename to dhall/tests/normalization/examples/Optional/toList/0A.dhall diff --git a/tests/normalization/examples/Optional/toList/0B.dhall b/dhall/tests/normalization/examples/Optional/toList/0B.dhall similarity index 100% rename from tests/normalization/examples/Optional/toList/0B.dhall rename to dhall/tests/normalization/examples/Optional/toList/0B.dhall diff --git a/tests/normalization/examples/Optional/toList/1A.dhall b/dhall/tests/normalization/examples/Optional/toList/1A.dhall similarity index 100% rename from tests/normalization/examples/Optional/toList/1A.dhall rename to dhall/tests/normalization/examples/Optional/toList/1A.dhall diff --git a/tests/normalization/examples/Optional/toList/1B.dhall b/dhall/tests/normalization/examples/Optional/toList/1B.dhall similarity index 100% rename from tests/normalization/examples/Optional/toList/1B.dhall rename to dhall/tests/normalization/examples/Optional/toList/1B.dhall diff --git a/tests/normalization/examples/Optional/unzip/0A.dhall b/dhall/tests/normalization/examples/Optional/unzip/0A.dhall similarity index 100% rename from tests/normalization/examples/Optional/unzip/0A.dhall rename to dhall/tests/normalization/examples/Optional/unzip/0A.dhall diff --git a/tests/normalization/examples/Optional/unzip/0B.dhall b/dhall/tests/normalization/examples/Optional/unzip/0B.dhall similarity index 100% rename from tests/normalization/examples/Optional/unzip/0B.dhall rename to dhall/tests/normalization/examples/Optional/unzip/0B.dhall diff --git a/tests/normalization/examples/Optional/unzip/1A.dhall b/dhall/tests/normalization/examples/Optional/unzip/1A.dhall similarity index 100% rename from tests/normalization/examples/Optional/unzip/1A.dhall rename to dhall/tests/normalization/examples/Optional/unzip/1A.dhall diff --git a/tests/normalization/examples/Optional/unzip/1B.dhall b/dhall/tests/normalization/examples/Optional/unzip/1B.dhall similarity index 100% rename from tests/normalization/examples/Optional/unzip/1B.dhall rename to dhall/tests/normalization/examples/Optional/unzip/1B.dhall diff --git a/tests/normalization/examples/Text/concat/0A.dhall b/dhall/tests/normalization/examples/Text/concat/0A.dhall similarity index 100% rename from tests/normalization/examples/Text/concat/0A.dhall rename to dhall/tests/normalization/examples/Text/concat/0A.dhall diff --git a/tests/normalization/examples/Text/concat/0B.dhall b/dhall/tests/normalization/examples/Text/concat/0B.dhall similarity index 100% rename from tests/normalization/examples/Text/concat/0B.dhall rename to dhall/tests/normalization/examples/Text/concat/0B.dhall diff --git a/tests/normalization/examples/Text/concat/1A.dhall b/dhall/tests/normalization/examples/Text/concat/1A.dhall similarity index 100% rename from tests/normalization/examples/Text/concat/1A.dhall rename to dhall/tests/normalization/examples/Text/concat/1A.dhall diff --git a/tests/normalization/examples/Text/concat/1B.dhall b/dhall/tests/normalization/examples/Text/concat/1B.dhall similarity index 100% rename from tests/normalization/examples/Text/concat/1B.dhall rename to dhall/tests/normalization/examples/Text/concat/1B.dhall diff --git a/tests/normalization/examples/Text/concatMap/0A.dhall b/dhall/tests/normalization/examples/Text/concatMap/0A.dhall similarity index 100% rename from tests/normalization/examples/Text/concatMap/0A.dhall rename to dhall/tests/normalization/examples/Text/concatMap/0A.dhall diff --git a/tests/normalization/examples/Text/concatMap/0B.dhall b/dhall/tests/normalization/examples/Text/concatMap/0B.dhall similarity index 100% rename from tests/normalization/examples/Text/concatMap/0B.dhall rename to dhall/tests/normalization/examples/Text/concatMap/0B.dhall diff --git a/tests/normalization/examples/Text/concatMap/1A.dhall b/dhall/tests/normalization/examples/Text/concatMap/1A.dhall similarity index 100% rename from tests/normalization/examples/Text/concatMap/1A.dhall rename to dhall/tests/normalization/examples/Text/concatMap/1A.dhall diff --git a/tests/normalization/examples/Text/concatMap/1B.dhall b/dhall/tests/normalization/examples/Text/concatMap/1B.dhall similarity index 100% rename from tests/normalization/examples/Text/concatMap/1B.dhall rename to dhall/tests/normalization/examples/Text/concatMap/1B.dhall diff --git a/tests/normalization/examples/Text/concatMapSep/0A.dhall b/dhall/tests/normalization/examples/Text/concatMapSep/0A.dhall similarity index 100% rename from tests/normalization/examples/Text/concatMapSep/0A.dhall rename to dhall/tests/normalization/examples/Text/concatMapSep/0A.dhall diff --git a/tests/normalization/examples/Text/concatMapSep/0B.dhall b/dhall/tests/normalization/examples/Text/concatMapSep/0B.dhall similarity index 100% rename from tests/normalization/examples/Text/concatMapSep/0B.dhall rename to dhall/tests/normalization/examples/Text/concatMapSep/0B.dhall diff --git a/tests/normalization/examples/Text/concatMapSep/1A.dhall b/dhall/tests/normalization/examples/Text/concatMapSep/1A.dhall similarity index 100% rename from tests/normalization/examples/Text/concatMapSep/1A.dhall rename to dhall/tests/normalization/examples/Text/concatMapSep/1A.dhall diff --git a/tests/normalization/examples/Text/concatMapSep/1B.dhall b/dhall/tests/normalization/examples/Text/concatMapSep/1B.dhall similarity index 100% rename from tests/normalization/examples/Text/concatMapSep/1B.dhall rename to dhall/tests/normalization/examples/Text/concatMapSep/1B.dhall diff --git a/tests/normalization/examples/Text/concatSep/0A.dhall b/dhall/tests/normalization/examples/Text/concatSep/0A.dhall similarity index 100% rename from tests/normalization/examples/Text/concatSep/0A.dhall rename to dhall/tests/normalization/examples/Text/concatSep/0A.dhall diff --git a/tests/normalization/examples/Text/concatSep/0B.dhall b/dhall/tests/normalization/examples/Text/concatSep/0B.dhall similarity index 100% rename from tests/normalization/examples/Text/concatSep/0B.dhall rename to dhall/tests/normalization/examples/Text/concatSep/0B.dhall diff --git a/tests/normalization/examples/Text/concatSep/1A.dhall b/dhall/tests/normalization/examples/Text/concatSep/1A.dhall similarity index 100% rename from tests/normalization/examples/Text/concatSep/1A.dhall rename to dhall/tests/normalization/examples/Text/concatSep/1A.dhall diff --git a/tests/normalization/examples/Text/concatSep/1B.dhall b/dhall/tests/normalization/examples/Text/concatSep/1B.dhall similarity index 100% rename from tests/normalization/examples/Text/concatSep/1B.dhall rename to dhall/tests/normalization/examples/Text/concatSep/1B.dhall diff --git a/tests/normalization/integerShowA.dhall b/dhall/tests/normalization/integerShowA.dhall similarity index 100% rename from tests/normalization/integerShowA.dhall rename to dhall/tests/normalization/integerShowA.dhall diff --git a/tests/normalization/integerShowB.dhall b/dhall/tests/normalization/integerShowB.dhall similarity index 100% rename from tests/normalization/integerShowB.dhall rename to dhall/tests/normalization/integerShowB.dhall diff --git a/tests/normalization/listBuildA.dhall b/dhall/tests/normalization/listBuildA.dhall similarity index 100% rename from tests/normalization/listBuildA.dhall rename to dhall/tests/normalization/listBuildA.dhall diff --git a/tests/normalization/listBuildB.dhall b/dhall/tests/normalization/listBuildB.dhall similarity index 100% rename from tests/normalization/listBuildB.dhall rename to dhall/tests/normalization/listBuildB.dhall diff --git a/tests/normalization/multiLineA.dhall b/dhall/tests/normalization/multiLineA.dhall similarity index 100% rename from tests/normalization/multiLineA.dhall rename to dhall/tests/normalization/multiLineA.dhall diff --git a/tests/normalization/multiLineB.dhall b/dhall/tests/normalization/multiLineB.dhall similarity index 100% rename from tests/normalization/multiLineB.dhall rename to dhall/tests/normalization/multiLineB.dhall diff --git a/tests/normalization/naturalBuildA.dhall b/dhall/tests/normalization/naturalBuildA.dhall similarity index 100% rename from tests/normalization/naturalBuildA.dhall rename to dhall/tests/normalization/naturalBuildA.dhall diff --git a/tests/normalization/naturalBuildB.dhall b/dhall/tests/normalization/naturalBuildB.dhall similarity index 100% rename from tests/normalization/naturalBuildB.dhall rename to dhall/tests/normalization/naturalBuildB.dhall diff --git a/tests/normalization/naturalPlusA.dhall b/dhall/tests/normalization/naturalPlusA.dhall similarity index 100% rename from tests/normalization/naturalPlusA.dhall rename to dhall/tests/normalization/naturalPlusA.dhall diff --git a/tests/normalization/naturalPlusB.dhall b/dhall/tests/normalization/naturalPlusB.dhall similarity index 100% rename from tests/normalization/naturalPlusB.dhall rename to dhall/tests/normalization/naturalPlusB.dhall diff --git a/tests/normalization/naturalShowA.dhall b/dhall/tests/normalization/naturalShowA.dhall similarity index 100% rename from tests/normalization/naturalShowA.dhall rename to dhall/tests/normalization/naturalShowA.dhall diff --git a/tests/normalization/naturalShowB.dhall b/dhall/tests/normalization/naturalShowB.dhall similarity index 100% rename from tests/normalization/naturalShowB.dhall rename to dhall/tests/normalization/naturalShowB.dhall diff --git a/tests/normalization/naturalToIntegerA.dhall b/dhall/tests/normalization/naturalToIntegerA.dhall similarity index 100% rename from tests/normalization/naturalToIntegerA.dhall rename to dhall/tests/normalization/naturalToIntegerA.dhall diff --git a/tests/normalization/naturalToIntegerB.dhall b/dhall/tests/normalization/naturalToIntegerB.dhall similarity index 100% rename from tests/normalization/naturalToIntegerB.dhall rename to dhall/tests/normalization/naturalToIntegerB.dhall diff --git a/tests/normalization/optionalBuildA.dhall b/dhall/tests/normalization/optionalBuildA.dhall similarity index 100% rename from tests/normalization/optionalBuildA.dhall rename to dhall/tests/normalization/optionalBuildA.dhall diff --git a/tests/normalization/optionalBuildB.dhall b/dhall/tests/normalization/optionalBuildB.dhall similarity index 100% rename from tests/normalization/optionalBuildB.dhall rename to dhall/tests/normalization/optionalBuildB.dhall diff --git a/tests/normalization/optionalBuildFoldA.dhall b/dhall/tests/normalization/optionalBuildFoldA.dhall similarity index 100% rename from tests/normalization/optionalBuildFoldA.dhall rename to dhall/tests/normalization/optionalBuildFoldA.dhall diff --git a/tests/normalization/optionalBuildFoldB.dhall b/dhall/tests/normalization/optionalBuildFoldB.dhall similarity index 100% rename from tests/normalization/optionalBuildFoldB.dhall rename to dhall/tests/normalization/optionalBuildFoldB.dhall diff --git a/tests/normalization/optionalFoldA.dhall b/dhall/tests/normalization/optionalFoldA.dhall similarity index 100% rename from tests/normalization/optionalFoldA.dhall rename to dhall/tests/normalization/optionalFoldA.dhall diff --git a/tests/normalization/optionalFoldB.dhall b/dhall/tests/normalization/optionalFoldB.dhall similarity index 100% rename from tests/normalization/optionalFoldB.dhall rename to dhall/tests/normalization/optionalFoldB.dhall diff --git a/tests/normalization/remoteSystemsA.dhall b/dhall/tests/normalization/remoteSystemsA.dhall similarity index 100% rename from tests/normalization/remoteSystemsA.dhall rename to dhall/tests/normalization/remoteSystemsA.dhall diff --git a/tests/normalization/remoteSystemsB.dhall b/dhall/tests/normalization/remoteSystemsB.dhall similarity index 100% rename from tests/normalization/remoteSystemsB.dhall rename to dhall/tests/normalization/remoteSystemsB.dhall diff --git a/tests/normalization/simplifications/andA.dhall b/dhall/tests/normalization/simplifications/andA.dhall similarity index 100% rename from tests/normalization/simplifications/andA.dhall rename to dhall/tests/normalization/simplifications/andA.dhall diff --git a/tests/normalization/simplifications/andB.dhall b/dhall/tests/normalization/simplifications/andB.dhall similarity index 100% rename from tests/normalization/simplifications/andB.dhall rename to dhall/tests/normalization/simplifications/andB.dhall diff --git a/tests/normalization/simplifications/eqA.dhall b/dhall/tests/normalization/simplifications/eqA.dhall similarity index 100% rename from tests/normalization/simplifications/eqA.dhall rename to dhall/tests/normalization/simplifications/eqA.dhall diff --git a/tests/normalization/simplifications/eqB.dhall b/dhall/tests/normalization/simplifications/eqB.dhall similarity index 100% rename from tests/normalization/simplifications/eqB.dhall rename to dhall/tests/normalization/simplifications/eqB.dhall diff --git a/tests/normalization/simplifications/ifThenElseA.dhall b/dhall/tests/normalization/simplifications/ifThenElseA.dhall similarity index 100% rename from tests/normalization/simplifications/ifThenElseA.dhall rename to dhall/tests/normalization/simplifications/ifThenElseA.dhall diff --git a/tests/normalization/simplifications/ifThenElseB.dhall b/dhall/tests/normalization/simplifications/ifThenElseB.dhall similarity index 100% rename from tests/normalization/simplifications/ifThenElseB.dhall rename to dhall/tests/normalization/simplifications/ifThenElseB.dhall diff --git a/tests/normalization/simplifications/neA.dhall b/dhall/tests/normalization/simplifications/neA.dhall similarity index 100% rename from tests/normalization/simplifications/neA.dhall rename to dhall/tests/normalization/simplifications/neA.dhall diff --git a/tests/normalization/simplifications/neB.dhall b/dhall/tests/normalization/simplifications/neB.dhall similarity index 100% rename from tests/normalization/simplifications/neB.dhall rename to dhall/tests/normalization/simplifications/neB.dhall diff --git a/tests/normalization/simplifications/orA.dhall b/dhall/tests/normalization/simplifications/orA.dhall similarity index 100% rename from tests/normalization/simplifications/orA.dhall rename to dhall/tests/normalization/simplifications/orA.dhall diff --git a/tests/normalization/simplifications/orB.dhall b/dhall/tests/normalization/simplifications/orB.dhall similarity index 100% rename from tests/normalization/simplifications/orB.dhall rename to dhall/tests/normalization/simplifications/orB.dhall diff --git a/tests/normalization/sortOperatorA.dhall b/dhall/tests/normalization/sortOperatorA.dhall similarity index 100% rename from tests/normalization/sortOperatorA.dhall rename to dhall/tests/normalization/sortOperatorA.dhall diff --git a/tests/normalization/sortOperatorB.dhall b/dhall/tests/normalization/sortOperatorB.dhall similarity index 100% rename from tests/normalization/sortOperatorB.dhall rename to dhall/tests/normalization/sortOperatorB.dhall diff --git a/tests/normalization/tutorial/access/0A.dhall b/dhall/tests/normalization/tutorial/access/0A.dhall similarity index 100% rename from tests/normalization/tutorial/access/0A.dhall rename to dhall/tests/normalization/tutorial/access/0A.dhall diff --git a/tests/normalization/tutorial/access/0B.dhall b/dhall/tests/normalization/tutorial/access/0B.dhall similarity index 100% rename from tests/normalization/tutorial/access/0B.dhall rename to dhall/tests/normalization/tutorial/access/0B.dhall diff --git a/tests/normalization/tutorial/access/1A.dhall b/dhall/tests/normalization/tutorial/access/1A.dhall similarity index 100% rename from tests/normalization/tutorial/access/1A.dhall rename to dhall/tests/normalization/tutorial/access/1A.dhall diff --git a/tests/normalization/tutorial/access/1B.dhall b/dhall/tests/normalization/tutorial/access/1B.dhall similarity index 100% rename from tests/normalization/tutorial/access/1B.dhall rename to dhall/tests/normalization/tutorial/access/1B.dhall diff --git a/tests/normalization/tutorial/combineTypes/0A.dhall b/dhall/tests/normalization/tutorial/combineTypes/0A.dhall similarity index 100% rename from tests/normalization/tutorial/combineTypes/0A.dhall rename to dhall/tests/normalization/tutorial/combineTypes/0A.dhall diff --git a/tests/normalization/tutorial/combineTypes/0B.dhall b/dhall/tests/normalization/tutorial/combineTypes/0B.dhall similarity index 100% rename from tests/normalization/tutorial/combineTypes/0B.dhall rename to dhall/tests/normalization/tutorial/combineTypes/0B.dhall diff --git a/tests/normalization/tutorial/projection/0A.dhall b/dhall/tests/normalization/tutorial/projection/0A.dhall similarity index 100% rename from tests/normalization/tutorial/projection/0A.dhall rename to dhall/tests/normalization/tutorial/projection/0A.dhall diff --git a/tests/normalization/tutorial/projection/0B.dhall b/dhall/tests/normalization/tutorial/projection/0B.dhall similarity index 100% rename from tests/normalization/tutorial/projection/0B.dhall rename to dhall/tests/normalization/tutorial/projection/0B.dhall diff --git a/tests/parser/annotations.dhall b/dhall/tests/parser/annotations.dhall similarity index 100% rename from tests/parser/annotations.dhall rename to dhall/tests/parser/annotations.dhall diff --git a/tests/parser/blockComment.dhall b/dhall/tests/parser/blockComment.dhall similarity index 100% rename from tests/parser/blockComment.dhall rename to dhall/tests/parser/blockComment.dhall diff --git a/tests/parser/builtins.dhall b/dhall/tests/parser/builtins.dhall similarity index 100% rename from tests/parser/builtins.dhall rename to dhall/tests/parser/builtins.dhall diff --git a/tests/parser/collectionImportType.dhall b/dhall/tests/parser/collectionImportType.dhall similarity index 100% rename from tests/parser/collectionImportType.dhall rename to dhall/tests/parser/collectionImportType.dhall diff --git a/tests/parser/constructors.dhall b/dhall/tests/parser/constructors.dhall similarity index 100% rename from tests/parser/constructors.dhall rename to dhall/tests/parser/constructors.dhall diff --git a/tests/parser/double.dhall b/dhall/tests/parser/double.dhall similarity index 100% rename from tests/parser/double.dhall rename to dhall/tests/parser/double.dhall diff --git a/tests/parser/doubleQuotedString.dhall b/dhall/tests/parser/doubleQuotedString.dhall similarity index 100% rename from tests/parser/doubleQuotedString.dhall rename to dhall/tests/parser/doubleQuotedString.dhall diff --git a/tests/parser/environmentVariables.dhall b/dhall/tests/parser/environmentVariables.dhall similarity index 100% rename from tests/parser/environmentVariables.dhall rename to dhall/tests/parser/environmentVariables.dhall diff --git a/tests/parser/escapedDoubleQuotedString.dhall b/dhall/tests/parser/escapedDoubleQuotedString.dhall similarity index 100% rename from tests/parser/escapedDoubleQuotedString.dhall rename to dhall/tests/parser/escapedDoubleQuotedString.dhall diff --git a/tests/parser/escapedSingleQuotedString.dhall b/dhall/tests/parser/escapedSingleQuotedString.dhall similarity index 100% rename from tests/parser/escapedSingleQuotedString.dhall rename to dhall/tests/parser/escapedSingleQuotedString.dhall diff --git a/tests/parser/failure/duplicateFields.dhall b/dhall/tests/parser/failure/duplicateFields.dhall similarity index 100% rename from tests/parser/failure/duplicateFields.dhall rename to dhall/tests/parser/failure/duplicateFields.dhall diff --git a/tests/parser/failure/importAccess.dhall b/dhall/tests/parser/failure/importAccess.dhall similarity index 100% rename from tests/parser/failure/importAccess.dhall rename to dhall/tests/parser/failure/importAccess.dhall diff --git a/tests/parser/fields.dhall b/dhall/tests/parser/fields.dhall similarity index 100% rename from tests/parser/fields.dhall rename to dhall/tests/parser/fields.dhall diff --git a/tests/parser/forall.dhall b/dhall/tests/parser/forall.dhall similarity index 100% rename from tests/parser/forall.dhall rename to dhall/tests/parser/forall.dhall diff --git a/tests/parser/functionType.dhall b/dhall/tests/parser/functionType.dhall similarity index 100% rename from tests/parser/functionType.dhall rename to dhall/tests/parser/functionType.dhall diff --git a/tests/parser/identifier.dhall b/dhall/tests/parser/identifier.dhall similarity index 100% rename from tests/parser/identifier.dhall rename to dhall/tests/parser/identifier.dhall diff --git a/tests/parser/ifThenElse.dhall b/dhall/tests/parser/ifThenElse.dhall similarity index 100% rename from tests/parser/ifThenElse.dhall rename to dhall/tests/parser/ifThenElse.dhall diff --git a/tests/parser/importAlt.dhall b/dhall/tests/parser/importAlt.dhall similarity index 100% rename from tests/parser/importAlt.dhall rename to dhall/tests/parser/importAlt.dhall diff --git a/tests/parser/interpolatedDoubleQuotedString.dhall b/dhall/tests/parser/interpolatedDoubleQuotedString.dhall similarity index 100% rename from tests/parser/interpolatedDoubleQuotedString.dhall rename to dhall/tests/parser/interpolatedDoubleQuotedString.dhall diff --git a/tests/parser/interpolatedSingleQuotedString.dhall b/dhall/tests/parser/interpolatedSingleQuotedString.dhall similarity index 100% rename from tests/parser/interpolatedSingleQuotedString.dhall rename to dhall/tests/parser/interpolatedSingleQuotedString.dhall diff --git a/tests/parser/label.dhall b/dhall/tests/parser/label.dhall similarity index 100% rename from tests/parser/label.dhall rename to dhall/tests/parser/label.dhall diff --git a/tests/parser/lambda.dhall b/dhall/tests/parser/lambda.dhall similarity index 100% rename from tests/parser/lambda.dhall rename to dhall/tests/parser/lambda.dhall diff --git a/tests/parser/largeExpression.dhall b/dhall/tests/parser/largeExpression.dhall similarity index 100% rename from tests/parser/largeExpression.dhall rename to dhall/tests/parser/largeExpression.dhall diff --git a/tests/parser/let.dhall b/dhall/tests/parser/let.dhall similarity index 100% rename from tests/parser/let.dhall rename to dhall/tests/parser/let.dhall diff --git a/tests/parser/lineComment.dhall b/dhall/tests/parser/lineComment.dhall similarity index 100% rename from tests/parser/lineComment.dhall rename to dhall/tests/parser/lineComment.dhall diff --git a/tests/parser/list.dhall b/dhall/tests/parser/list.dhall similarity index 100% rename from tests/parser/list.dhall rename to dhall/tests/parser/list.dhall diff --git a/tests/parser/merge.dhall b/dhall/tests/parser/merge.dhall similarity index 100% rename from tests/parser/merge.dhall rename to dhall/tests/parser/merge.dhall diff --git a/tests/parser/natural.dhall b/dhall/tests/parser/natural.dhall similarity index 100% rename from tests/parser/natural.dhall rename to dhall/tests/parser/natural.dhall diff --git a/tests/parser/nestedBlockComment.dhall b/dhall/tests/parser/nestedBlockComment.dhall similarity index 100% rename from tests/parser/nestedBlockComment.dhall rename to dhall/tests/parser/nestedBlockComment.dhall diff --git a/tests/parser/operators.dhall b/dhall/tests/parser/operators.dhall similarity index 100% rename from tests/parser/operators.dhall rename to dhall/tests/parser/operators.dhall diff --git a/tests/parser/parenthesizeUsing.dhall b/dhall/tests/parser/parenthesizeUsing.dhall similarity index 100% rename from tests/parser/parenthesizeUsing.dhall rename to dhall/tests/parser/parenthesizeUsing.dhall diff --git a/tests/parser/pathTermination.dhall b/dhall/tests/parser/pathTermination.dhall similarity index 100% rename from tests/parser/pathTermination.dhall rename to dhall/tests/parser/pathTermination.dhall diff --git a/tests/parser/paths.dhall b/dhall/tests/parser/paths.dhall similarity index 100% rename from tests/parser/paths.dhall rename to dhall/tests/parser/paths.dhall diff --git a/tests/parser/quotedLabel.dhall b/dhall/tests/parser/quotedLabel.dhall similarity index 100% rename from tests/parser/quotedLabel.dhall rename to dhall/tests/parser/quotedLabel.dhall diff --git a/tests/parser/record.dhall b/dhall/tests/parser/record.dhall similarity index 100% rename from tests/parser/record.dhall rename to dhall/tests/parser/record.dhall diff --git a/tests/parser/reservedPrefix.dhall b/dhall/tests/parser/reservedPrefix.dhall similarity index 100% rename from tests/parser/reservedPrefix.dhall rename to dhall/tests/parser/reservedPrefix.dhall diff --git a/tests/parser/singleQuotedString.dhall b/dhall/tests/parser/singleQuotedString.dhall similarity index 100% rename from tests/parser/singleQuotedString.dhall rename to dhall/tests/parser/singleQuotedString.dhall diff --git a/tests/parser/sort.dhall b/dhall/tests/parser/sort.dhall similarity index 100% rename from tests/parser/sort.dhall rename to dhall/tests/parser/sort.dhall diff --git a/tests/parser/template.dhall b/dhall/tests/parser/template.dhall similarity index 100% rename from tests/parser/template.dhall rename to dhall/tests/parser/template.dhall diff --git a/tests/parser/unicodeComment.dhall b/dhall/tests/parser/unicodeComment.dhall similarity index 100% rename from tests/parser/unicodeComment.dhall rename to dhall/tests/parser/unicodeComment.dhall diff --git a/tests/parser/unicodeDoubleQuotedString.dhall b/dhall/tests/parser/unicodeDoubleQuotedString.dhall similarity index 100% rename from tests/parser/unicodeDoubleQuotedString.dhall rename to dhall/tests/parser/unicodeDoubleQuotedString.dhall diff --git a/tests/parser/union.dhall b/dhall/tests/parser/union.dhall similarity index 100% rename from tests/parser/union.dhall rename to dhall/tests/parser/union.dhall diff --git a/tests/parser/urls.dhall b/dhall/tests/parser/urls.dhall similarity index 100% rename from tests/parser/urls.dhall rename to dhall/tests/parser/urls.dhall diff --git a/tests/parser/whitespace.dhall b/dhall/tests/parser/whitespace.dhall similarity index 100% rename from tests/parser/whitespace.dhall rename to dhall/tests/parser/whitespace.dhall diff --git a/tests/parser/whitespaceBuffet.dhall b/dhall/tests/parser/whitespaceBuffet.dhall similarity index 100% rename from tests/parser/whitespaceBuffet.dhall rename to dhall/tests/parser/whitespaceBuffet.dhall diff --git a/tests/regression/issue151a.dhall b/dhall/tests/regression/issue151a.dhall similarity index 100% rename from tests/regression/issue151a.dhall rename to dhall/tests/regression/issue151a.dhall diff --git a/tests/regression/issue151b.dhall b/dhall/tests/regression/issue151b.dhall similarity index 100% rename from tests/regression/issue151b.dhall rename to dhall/tests/regression/issue151b.dhall diff --git a/tests/regression/issue164.dhall b/dhall/tests/regression/issue164.dhall similarity index 100% rename from tests/regression/issue164.dhall rename to dhall/tests/regression/issue164.dhall diff --git a/tests/regression/issue201.dhall b/dhall/tests/regression/issue201.dhall similarity index 100% rename from tests/regression/issue201.dhall rename to dhall/tests/regression/issue201.dhall diff --git a/tests/regression/issue209.dhall b/dhall/tests/regression/issue209.dhall similarity index 100% rename from tests/regression/issue209.dhall rename to dhall/tests/regression/issue209.dhall diff --git a/tests/regression/issue216a.dhall b/dhall/tests/regression/issue216a.dhall similarity index 100% rename from tests/regression/issue216a.dhall rename to dhall/tests/regression/issue216a.dhall diff --git a/tests/regression/issue216b.dhall b/dhall/tests/regression/issue216b.dhall similarity index 100% rename from tests/regression/issue216b.dhall rename to dhall/tests/regression/issue216b.dhall diff --git a/tests/tutorial/process.dhall b/dhall/tests/tutorial/process.dhall similarity index 100% rename from tests/tutorial/process.dhall rename to dhall/tests/tutorial/process.dhall diff --git a/tests/tutorial/unions0A.dhall b/dhall/tests/tutorial/unions0A.dhall similarity index 100% rename from tests/tutorial/unions0A.dhall rename to dhall/tests/tutorial/unions0A.dhall diff --git a/tests/tutorial/unions0B.dhall b/dhall/tests/tutorial/unions0B.dhall similarity index 100% rename from tests/tutorial/unions0B.dhall rename to dhall/tests/tutorial/unions0B.dhall diff --git a/tests/tutorial/unions1A.dhall b/dhall/tests/tutorial/unions1A.dhall similarity index 100% rename from tests/tutorial/unions1A.dhall rename to dhall/tests/tutorial/unions1A.dhall diff --git a/tests/tutorial/unions1B.dhall b/dhall/tests/tutorial/unions1B.dhall similarity index 100% rename from tests/tutorial/unions1B.dhall rename to dhall/tests/tutorial/unions1B.dhall diff --git a/tests/tutorial/unions2A.dhall b/dhall/tests/tutorial/unions2A.dhall similarity index 100% rename from tests/tutorial/unions2A.dhall rename to dhall/tests/tutorial/unions2A.dhall diff --git a/tests/tutorial/unions2B.dhall b/dhall/tests/tutorial/unions2B.dhall similarity index 100% rename from tests/tutorial/unions2B.dhall rename to dhall/tests/tutorial/unions2B.dhall diff --git a/tests/tutorial/unions3A.dhall b/dhall/tests/tutorial/unions3A.dhall similarity index 100% rename from tests/tutorial/unions3A.dhall rename to dhall/tests/tutorial/unions3A.dhall diff --git a/tests/tutorial/unions3B.dhall b/dhall/tests/tutorial/unions3B.dhall similarity index 100% rename from tests/tutorial/unions3B.dhall rename to dhall/tests/tutorial/unions3B.dhall diff --git a/tests/tutorial/unions4A.dhall b/dhall/tests/tutorial/unions4A.dhall similarity index 100% rename from tests/tutorial/unions4A.dhall rename to dhall/tests/tutorial/unions4A.dhall diff --git a/tests/tutorial/unions4B.dhall b/dhall/tests/tutorial/unions4B.dhall similarity index 100% rename from tests/tutorial/unions4B.dhall rename to dhall/tests/tutorial/unions4B.dhall diff --git a/tests/typecheck/access/0A.dhall b/dhall/tests/typecheck/access/0A.dhall similarity index 100% rename from tests/typecheck/access/0A.dhall rename to dhall/tests/typecheck/access/0A.dhall diff --git a/tests/typecheck/access/0B.dhall b/dhall/tests/typecheck/access/0B.dhall similarity index 100% rename from tests/typecheck/access/0B.dhall rename to dhall/tests/typecheck/access/0B.dhall diff --git a/tests/typecheck/access/1A.dhall b/dhall/tests/typecheck/access/1A.dhall similarity index 100% rename from tests/typecheck/access/1A.dhall rename to dhall/tests/typecheck/access/1A.dhall diff --git a/tests/typecheck/access/1B.dhall b/dhall/tests/typecheck/access/1B.dhall similarity index 100% rename from tests/typecheck/access/1B.dhall rename to dhall/tests/typecheck/access/1B.dhall diff --git a/tests/typecheck/alternativesAreTypesA.dhall b/dhall/tests/typecheck/alternativesAreTypesA.dhall similarity index 100% rename from tests/typecheck/alternativesAreTypesA.dhall rename to dhall/tests/typecheck/alternativesAreTypesA.dhall diff --git a/tests/typecheck/alternativesAreTypesB.dhall b/dhall/tests/typecheck/alternativesAreTypesB.dhall similarity index 100% rename from tests/typecheck/alternativesAreTypesB.dhall rename to dhall/tests/typecheck/alternativesAreTypesB.dhall diff --git a/tests/typecheck/anonymousFunctionsInTypesA.dhall b/dhall/tests/typecheck/anonymousFunctionsInTypesA.dhall similarity index 100% rename from tests/typecheck/anonymousFunctionsInTypesA.dhall rename to dhall/tests/typecheck/anonymousFunctionsInTypesA.dhall diff --git a/tests/typecheck/anonymousFunctionsInTypesB.dhall b/dhall/tests/typecheck/anonymousFunctionsInTypesB.dhall similarity index 100% rename from tests/typecheck/anonymousFunctionsInTypesB.dhall rename to dhall/tests/typecheck/anonymousFunctionsInTypesB.dhall diff --git a/tests/typecheck/examples/Monoid/00A.dhall b/dhall/tests/typecheck/examples/Monoid/00A.dhall similarity index 100% rename from tests/typecheck/examples/Monoid/00A.dhall rename to dhall/tests/typecheck/examples/Monoid/00A.dhall diff --git a/tests/typecheck/examples/Monoid/00B.dhall b/dhall/tests/typecheck/examples/Monoid/00B.dhall similarity index 100% rename from tests/typecheck/examples/Monoid/00B.dhall rename to dhall/tests/typecheck/examples/Monoid/00B.dhall diff --git a/tests/typecheck/examples/Monoid/01A.dhall b/dhall/tests/typecheck/examples/Monoid/01A.dhall similarity index 100% rename from tests/typecheck/examples/Monoid/01A.dhall rename to dhall/tests/typecheck/examples/Monoid/01A.dhall diff --git a/tests/typecheck/examples/Monoid/01B.dhall b/dhall/tests/typecheck/examples/Monoid/01B.dhall similarity index 100% rename from tests/typecheck/examples/Monoid/01B.dhall rename to dhall/tests/typecheck/examples/Monoid/01B.dhall diff --git a/tests/typecheck/examples/Monoid/02A.dhall b/dhall/tests/typecheck/examples/Monoid/02A.dhall similarity index 100% rename from tests/typecheck/examples/Monoid/02A.dhall rename to dhall/tests/typecheck/examples/Monoid/02A.dhall diff --git a/tests/typecheck/examples/Monoid/02B.dhall b/dhall/tests/typecheck/examples/Monoid/02B.dhall similarity index 100% rename from tests/typecheck/examples/Monoid/02B.dhall rename to dhall/tests/typecheck/examples/Monoid/02B.dhall diff --git a/tests/typecheck/examples/Monoid/03A.dhall b/dhall/tests/typecheck/examples/Monoid/03A.dhall similarity index 100% rename from tests/typecheck/examples/Monoid/03A.dhall rename to dhall/tests/typecheck/examples/Monoid/03A.dhall diff --git a/tests/typecheck/examples/Monoid/03B.dhall b/dhall/tests/typecheck/examples/Monoid/03B.dhall similarity index 100% rename from tests/typecheck/examples/Monoid/03B.dhall rename to dhall/tests/typecheck/examples/Monoid/03B.dhall diff --git a/tests/typecheck/examples/Monoid/04A.dhall b/dhall/tests/typecheck/examples/Monoid/04A.dhall similarity index 100% rename from tests/typecheck/examples/Monoid/04A.dhall rename to dhall/tests/typecheck/examples/Monoid/04A.dhall diff --git a/tests/typecheck/examples/Monoid/04B.dhall b/dhall/tests/typecheck/examples/Monoid/04B.dhall similarity index 100% rename from tests/typecheck/examples/Monoid/04B.dhall rename to dhall/tests/typecheck/examples/Monoid/04B.dhall diff --git a/tests/typecheck/examples/Monoid/05A.dhall b/dhall/tests/typecheck/examples/Monoid/05A.dhall similarity index 100% rename from tests/typecheck/examples/Monoid/05A.dhall rename to dhall/tests/typecheck/examples/Monoid/05A.dhall diff --git a/tests/typecheck/examples/Monoid/05B.dhall b/dhall/tests/typecheck/examples/Monoid/05B.dhall similarity index 100% rename from tests/typecheck/examples/Monoid/05B.dhall rename to dhall/tests/typecheck/examples/Monoid/05B.dhall diff --git a/tests/typecheck/examples/Monoid/06A.dhall b/dhall/tests/typecheck/examples/Monoid/06A.dhall similarity index 100% rename from tests/typecheck/examples/Monoid/06A.dhall rename to dhall/tests/typecheck/examples/Monoid/06A.dhall diff --git a/tests/typecheck/examples/Monoid/06B.dhall b/dhall/tests/typecheck/examples/Monoid/06B.dhall similarity index 100% rename from tests/typecheck/examples/Monoid/06B.dhall rename to dhall/tests/typecheck/examples/Monoid/06B.dhall diff --git a/tests/typecheck/examples/Monoid/07A.dhall b/dhall/tests/typecheck/examples/Monoid/07A.dhall similarity index 100% rename from tests/typecheck/examples/Monoid/07A.dhall rename to dhall/tests/typecheck/examples/Monoid/07A.dhall diff --git a/tests/typecheck/examples/Monoid/07B.dhall b/dhall/tests/typecheck/examples/Monoid/07B.dhall similarity index 100% rename from tests/typecheck/examples/Monoid/07B.dhall rename to dhall/tests/typecheck/examples/Monoid/07B.dhall diff --git a/tests/typecheck/examples/Monoid/08A.dhall b/dhall/tests/typecheck/examples/Monoid/08A.dhall similarity index 100% rename from tests/typecheck/examples/Monoid/08A.dhall rename to dhall/tests/typecheck/examples/Monoid/08A.dhall diff --git a/tests/typecheck/examples/Monoid/08B.dhall b/dhall/tests/typecheck/examples/Monoid/08B.dhall similarity index 100% rename from tests/typecheck/examples/Monoid/08B.dhall rename to dhall/tests/typecheck/examples/Monoid/08B.dhall diff --git a/tests/typecheck/examples/Monoid/09A.dhall b/dhall/tests/typecheck/examples/Monoid/09A.dhall similarity index 100% rename from tests/typecheck/examples/Monoid/09A.dhall rename to dhall/tests/typecheck/examples/Monoid/09A.dhall diff --git a/tests/typecheck/examples/Monoid/09B.dhall b/dhall/tests/typecheck/examples/Monoid/09B.dhall similarity index 100% rename from tests/typecheck/examples/Monoid/09B.dhall rename to dhall/tests/typecheck/examples/Monoid/09B.dhall diff --git a/tests/typecheck/examples/Monoid/10A.dhall b/dhall/tests/typecheck/examples/Monoid/10A.dhall similarity index 100% rename from tests/typecheck/examples/Monoid/10A.dhall rename to dhall/tests/typecheck/examples/Monoid/10A.dhall diff --git a/tests/typecheck/examples/Monoid/10B.dhall b/dhall/tests/typecheck/examples/Monoid/10B.dhall similarity index 100% rename from tests/typecheck/examples/Monoid/10B.dhall rename to dhall/tests/typecheck/examples/Monoid/10B.dhall diff --git a/tests/typecheck/failure/combineMixedRecords.dhall b/dhall/tests/typecheck/failure/combineMixedRecords.dhall similarity index 100% rename from tests/typecheck/failure/combineMixedRecords.dhall rename to dhall/tests/typecheck/failure/combineMixedRecords.dhall diff --git a/tests/typecheck/failure/preferMixedRecords.dhall b/dhall/tests/typecheck/failure/preferMixedRecords.dhall similarity index 100% rename from tests/typecheck/failure/preferMixedRecords.dhall rename to dhall/tests/typecheck/failure/preferMixedRecords.dhall diff --git a/tests/typecheck/fieldsAreTypesA.dhall b/dhall/tests/typecheck/fieldsAreTypesA.dhall similarity index 100% rename from tests/typecheck/fieldsAreTypesA.dhall rename to dhall/tests/typecheck/fieldsAreTypesA.dhall diff --git a/tests/typecheck/fieldsAreTypesB.dhall b/dhall/tests/typecheck/fieldsAreTypesB.dhall similarity index 100% rename from tests/typecheck/fieldsAreTypesB.dhall rename to dhall/tests/typecheck/fieldsAreTypesB.dhall diff --git a/tests/typecheck/kindParameterA.dhall b/dhall/tests/typecheck/kindParameterA.dhall similarity index 100% rename from tests/typecheck/kindParameterA.dhall rename to dhall/tests/typecheck/kindParameterA.dhall diff --git a/tests/typecheck/kindParameterB.dhall b/dhall/tests/typecheck/kindParameterB.dhall similarity index 100% rename from tests/typecheck/kindParameterB.dhall rename to dhall/tests/typecheck/kindParameterB.dhall diff --git a/tests/typecheck/mergeEquivalenceA.dhall b/dhall/tests/typecheck/mergeEquivalenceA.dhall similarity index 100% rename from tests/typecheck/mergeEquivalenceA.dhall rename to dhall/tests/typecheck/mergeEquivalenceA.dhall diff --git a/tests/typecheck/mergeEquivalenceB.dhall b/dhall/tests/typecheck/mergeEquivalenceB.dhall similarity index 100% rename from tests/typecheck/mergeEquivalenceB.dhall rename to dhall/tests/typecheck/mergeEquivalenceB.dhall diff --git a/nix/megaparsec.nix b/nix/megaparsec.nix index ec94fc2a0..f584b56f9 100644 --- a/nix/megaparsec.nix +++ b/nix/megaparsec.nix @@ -5,8 +5,8 @@ }: mkDerivation { pname = "megaparsec"; - version = "7.0.0"; - sha256 = "bfd6870d468d680e5ca8845afb8c871d8e40231ae95a977407c371c251cc3380"; + version = "7.0.2"; + sha256 = "e888f6a1ef6c9908c9893f2cd4105d12d7778cf88f885b416915fcd89526c5db"; libraryHaskellDepends = [ base bytestring case-insensitive containers deepseq mtl parser-combinators scientific text transformers diff --git a/nix/neat-interpolation.nix b/nix/neat-interpolation.nix new file mode 100644 index 000000000..047f20fd4 --- /dev/null +++ b/nix/neat-interpolation.nix @@ -0,0 +1,15 @@ +{ mkDerivation, base, base-prelude, HTF, megaparsec, stdenv +, template-haskell, text +}: +mkDerivation { + pname = "neat-interpolation"; + version = "0.3.2.4"; + sha256 = "de7370d938ffd8c7b52d732f4f088387ed8216cf9767d818e99b7ec827931752"; + libraryHaskellDepends = [ + base base-prelude megaparsec template-haskell text + ]; + testHaskellDepends = [ base-prelude HTF ]; + homepage = "https://github.com/nikita-volkov/neat-interpolation"; + description = "A quasiquoter for neat and simple multiline text interpolation"; + license = stdenv.lib.licenses.mit; +} diff --git a/shared.nix b/nix/shared.nix similarity index 76% rename from shared.nix rename to nix/shared.nix index 59bdcc125..02fb22f97 100644 --- a/shared.nix +++ b/nix/shared.nix @@ -1,7 +1,7 @@ { compiler ? "ghc843", coverage ? false }: let - fetchNixpkgs = import ./nix/fetchNixpkgs.nix; + fetchNixpkgs = import ./fetchNixpkgs.nix; overlayShared = pkgsNew: pkgsOld: { dhall-sdist = @@ -17,21 +17,23 @@ let || base == ".git" ); - src = builtins.filterSource predicate ./.; + src = builtins.filterSource predicate ../dhall; in - pkgsNew.callPackage (import ./nix/dhall-sdist.nix src) { }; + pkgsNew.callPackage (import ./dhall-sdist.nix src) { }; haskell = pkgsOld.haskell // { packages = pkgsOld.haskell.packages // { "${compiler}" = pkgsOld.haskell.packages."${compiler}".override (old: { overrides = let - doCoverage = drv: + applyCoverage = drv: if coverage then pkgsNew.haskell.lib.overrideCabal - (pkgsNew.haskell.lib.doCoverage drv) + (pkgsNew.haskell.lib.doCoverage + (pkgsNew.haskell.lib.doCheck drv) + ) (old: { postInstall = (old.postInstall or "") + '' ${pkgsNew.coreutils}/bin/mkdir --parents $out/nix-support @@ -40,7 +42,8 @@ let ''; } ) - else drv; + else + pkgsNew.haskell.lib.dontCheck drv; failOnAllWarnings = drv: # GHC 7.10.3 incorrectly detects non-exhaustive pattern @@ -52,7 +55,7 @@ let extension = haskellPackagesNew: haskellPackagesOld: { dhall = - doCoverage + applyCoverage (failOnAllWarnings (haskellPackagesNew.callCabal2nix "dhall" @@ -61,6 +64,30 @@ let ) ); + dhall-bash = + failOnAllWarnings + (haskellPackagesNew.callCabal2nix + "dhall-bash" + ../dhall-bash + { } + ); + + dhall-json = + failOnAllWarnings + (haskellPackagesNew.callCabal2nix + "dhall-json" + ../dhall-json + { } + ); + + dhall-text = + failOnAllWarnings + (haskellPackagesNew.callCabal2nix + "dhall-text" + ../dhall-text + { } + ); + # https://github.com/well-typed/cborg/issues/172 serialise = pkgsNew.haskell.lib.dontCheck @@ -75,7 +102,7 @@ let pkgsNew.lib.fold pkgsNew.lib.composeExtensions (old.overrides or (_: _: {})) - [ (pkgsNew.haskell.lib.packagesFromDirectory { directory = ./nix; }) + [ (pkgsNew.haskell.lib.packagesFromDirectory { directory = ./.; }) extension ]; @@ -164,7 +191,7 @@ let # a dependency cycle. wcwidth = pkgsNew.haskell.lib.appendPatch - haskellPackagesOld.wcwidth ./nix/wcwidth.patch; + haskellPackagesOld.wcwidth ./wcwidth.patch; }; in @@ -250,7 +277,17 @@ let pkgsNew.Cabal_patched_Cabal_subdir { }; - dhall = pkgsNew.haskell.lib.statify haskellPackagesOld.dhall; + dhall-static = + pkgsNew.haskell.lib.statify haskellPackagesOld.dhall; + + dhall-bash-static = + pkgsNew.haskell.lib.statify haskellPackagesOld.dhall-bash; + + dhall-json-static = + pkgsNew.haskell.lib.statify haskellPackagesOld.dhall-json; + + dhall-text-static = + pkgsNew.haskell.lib.statify haskellPackagesOld.dhall-text; }; in @@ -281,27 +318,41 @@ let # Derivation that trivially depends on the current directory so that Hydra's # pull request builder always posts a GitHub status on each revision - pwd = pkgs.runCommand "pwd" { here = ./.; } "touch $out"; + pwd = pkgs.runCommand "pwd" { here = ../.; } "touch $out"; + + makeTarball = name: + pkgsStaticLinux.releaseTools.binaryTarball rec { + src = pkgsStaticLinux.pkgsMusl.haskell.packages."${compiler}"."${name}-static"; + + installPhase = '' + releaseName=${name} + ${pkgsStaticLinux.coreutils}/bin/install --target-directory "$TMPDIR/inst/bin" -D $src/bin/* + ''; + }; in rec { inherit pwd; - tarball = - pkgsStaticLinux.releaseTools.binaryTarball rec { - src = pkgsStaticLinux.pkgsMusl.haskell.packages."${compiler}".dhall; + tarball-dhall = makeTarball "dhall"; - installPhase = '' - releaseName=${src.name} - ${pkgsStaticLinux.coreutils}/bin/install -D "$src/bin/dhall" "$TMPDIR/inst/bin/dhall" - ''; - }; + tarball-dhall-bash = makeTarball "dhall-bash"; - inherit (pkgs.haskell.packages."${compiler}") dhall; + tarball-dhall-json = makeTarball "dhall-json"; + + tarball-dhall-text = makeTarball "dhall-text"; + + inherit (pkgs.haskell.packages."${compiler}") dhall dhall-bash dhall-json dhall-text; inherit (pkgs.releaseTools) aggregate; - shell = (pkgs.haskell.lib.doBenchmark pkgs.haskell.packages."${compiler}".dhall).env; + shell-dhall = (pkgs.haskell.lib.doBenchmark pkgs.haskell.packages."${compiler}".dhall).env; + + shell-dhall-bash = (pkgs.haskell.lib.doBenchmark pkgs.haskell.packages."${compiler}".dhall-bash).env; + + shell-dhall-json = (pkgs.haskell.lib.doBenchmark pkgs.haskell.packages."${compiler}".dhall-json).env; + + shell-dhall-text = (pkgs.haskell.lib.doBenchmark pkgs.haskell.packages."${compiler}".dhall-text).env; test-dhall = pkgs.mkShell diff --git a/nix/test-dhall.nix b/nix/test-dhall.nix index 4c8721e15..9b883d715 100644 --- a/nix/test-dhall.nix +++ b/nix/test-dhall.nix @@ -1 +1 @@ -(import ../shared.nix {}).test-dhall +(import ./shared.nix {}).test-dhall diff --git a/nix/yaml.nix b/nix/yaml.nix new file mode 100644 index 000000000..bb8c616d7 --- /dev/null +++ b/nix/yaml.nix @@ -0,0 +1,28 @@ +{ mkDerivation, aeson, attoparsec, base, base-compat, bytestring +, conduit, containers, directory, filepath, hspec, HUnit, mockery +, mtl, raw-strings-qq, resourcet, scientific, stdenv +, template-haskell, temporary, text, transformers +, unordered-containers, vector +}: +mkDerivation { + pname = "yaml"; + version = "0.10.2.0"; + sha256 = "4338d8140f4de63252d40838dd8a7802565f2116ce0170b97a09a2f0dd60747a"; + configureFlags = [ "-f-system-libyaml" ]; + isLibrary = true; + isExecutable = true; + libraryHaskellDepends = [ + aeson attoparsec base bytestring conduit containers directory + filepath mtl resourcet scientific template-haskell text + transformers unordered-containers vector + ]; + testHaskellDepends = [ + aeson attoparsec base base-compat bytestring conduit containers + directory filepath hspec HUnit mockery mtl raw-strings-qq resourcet + scientific template-haskell temporary text transformers + unordered-containers vector + ]; + homepage = "https://github.com/snoyberg/yaml#readme"; + description = "Support for parsing and rendering YAML documents"; + license = stdenv.lib.licenses.bsd3; +} diff --git a/release.nix b/release.nix index 73d4ef917..72bddf2a6 100644 --- a/release.nix +++ b/release.nix @@ -1,9 +1,12 @@ let shared_7_10_3 = - import ./shared.nix { compiler = "ghc7103"; coverage = true; }; + import ./nix/shared.nix { compiler = "ghc7103"; }; shared_8_4_3 = - import ./shared.nix { compiler = "ghc843"; coverage = true; }; + import ./nix/shared.nix { compiler = "ghc843"; }; + + coverage_8_4_3 = + import ./nix/shared.nix { compiler = "ghc843"; coverage = true; }; in { dhall = shared_8_4_3.aggregate @@ -12,12 +15,18 @@ in constituents = [ shared_7_10_3.dhall shared_8_4_3.dhall - shared_8_4_3.tarball + shared_8_4_3.dhall-bash + shared_8_4_3.dhall-json + shared_8_4_3.dhall-text + shared_8_4_3.tarball-dhall + shared_8_4_3.tarball-dhall-bash + shared_8_4_3.tarball-dhall-json + shared_8_4_3.tarball-dhall-text shared_8_4_3.pwd ]; }; - "coverage" = shared_8_4_3.dhall; + "coverage-dhall" = coverage_8_4_3.dhall; - inherit (shared_8_4_3) tarball; + inherit (shared_8_4_3) tarball-dhall tarball-dhall-bash tarball-dhall-json tarball-dhall-text; } diff --git a/shell.nix b/shell.nix deleted file mode 100644 index 107ec0670..000000000 --- a/shell.nix +++ /dev/null @@ -1 +0,0 @@ -(import ./shared.nix {}).shell