2018-04-08 00:08:48 +02:00
|
|
|
-- This file has been generated from package.yaml by hpack version 0.27.0.
|
|
|
|
--
|
|
|
|
-- see: https://github.com/sol/hpack
|
|
|
|
--
|
2018-05-03 06:38:13 +02:00
|
|
|
-- hash: b50a1c4cf11872cb711f0ed200482f16620ea7754fe7bf8cf8892413d0231746
|
2014-07-01 05:37:20 +02:00
|
|
|
|
2018-04-08 00:08:48 +02:00
|
|
|
name: hnix
|
|
|
|
version: 0.5.0
|
|
|
|
synopsis: Haskell implementation of the Nix language
|
|
|
|
description: Haskell implementation of the Nix language.
|
|
|
|
category: System, Data, Nix
|
|
|
|
homepage: https://github.com/jwiegley/hnix#readme
|
|
|
|
bug-reports: https://github.com/jwiegley/hnix/issues
|
|
|
|
author: John Wiegley
|
|
|
|
maintainer: johnw@newartisans.com
|
|
|
|
license: BSD3
|
|
|
|
license-file: LICENSE
|
|
|
|
build-type: Simple
|
|
|
|
cabal-version: >= 1.10
|
2014-07-01 05:37:20 +02:00
|
|
|
|
2018-04-08 00:08:48 +02:00
|
|
|
extra-source-files:
|
|
|
|
README.md
|
2015-07-23 04:03:30 +02:00
|
|
|
|
2018-04-08 00:08:48 +02:00
|
|
|
source-repository head
|
|
|
|
type: git
|
|
|
|
location: https://github.com/jwiegley/hnix
|
|
|
|
|
2018-04-22 20:09:56 +02:00
|
|
|
flag optimize
|
|
|
|
description: Enable all optimization flags
|
|
|
|
manual: True
|
|
|
|
default: False
|
|
|
|
|
2018-05-01 03:47:21 +02:00
|
|
|
flag profiling
|
|
|
|
description: Enable profiling
|
|
|
|
manual: True
|
|
|
|
default: False
|
|
|
|
|
2018-04-19 01:28:21 +02:00
|
|
|
flag tracing
|
|
|
|
description: Enable full debug tracing
|
|
|
|
manual: True
|
|
|
|
default: False
|
|
|
|
|
2018-04-08 00:08:48 +02:00
|
|
|
library
|
|
|
|
exposed-modules:
|
|
|
|
Nix
|
|
|
|
Nix.Atoms
|
|
|
|
Nix.Builtins
|
2018-04-12 05:19:59 +02:00
|
|
|
Nix.Cache
|
2018-04-11 06:01:48 +02:00
|
|
|
Nix.Context
|
2018-04-14 03:09:12 +02:00
|
|
|
Nix.Convert
|
2018-04-11 06:01:48 +02:00
|
|
|
Nix.Effects
|
2018-04-08 00:08:48 +02:00
|
|
|
Nix.Eval
|
2018-04-09 09:52:10 +02:00
|
|
|
Nix.Exec
|
2018-04-08 00:08:48 +02:00
|
|
|
Nix.Expr
|
|
|
|
Nix.Expr.Shorthands
|
|
|
|
Nix.Expr.Types
|
|
|
|
Nix.Expr.Types.Annotated
|
2018-04-24 11:14:27 +02:00
|
|
|
Nix.Frames
|
2018-04-08 00:08:48 +02:00
|
|
|
Nix.Lint
|
2018-04-08 00:25:39 +02:00
|
|
|
Nix.Normal
|
2018-04-12 05:53:38 +02:00
|
|
|
Nix.Options
|
2018-04-08 00:08:48 +02:00
|
|
|
Nix.Parser
|
|
|
|
Nix.Parser.Library
|
|
|
|
Nix.Parser.Operators
|
|
|
|
Nix.Pretty
|
2018-04-20 11:57:23 +02:00
|
|
|
Nix.Reduce
|
2018-04-24 11:14:27 +02:00
|
|
|
Nix.Render
|
2018-04-24 20:12:20 +02:00
|
|
|
Nix.Render.Frame
|
2018-04-08 00:08:48 +02:00
|
|
|
Nix.Scope
|
2018-04-21 02:05:21 +02:00
|
|
|
Nix.Strings
|
2018-04-08 00:08:48 +02:00
|
|
|
Nix.TH
|
|
|
|
Nix.Thunk
|
2018-04-12 19:53:50 +02:00
|
|
|
Nix.Type.Assumption
|
|
|
|
Nix.Type.Env
|
|
|
|
Nix.Type.Infer
|
|
|
|
Nix.Type.Type
|
2018-04-08 00:08:48 +02:00
|
|
|
Nix.Utils
|
|
|
|
Nix.Value
|
|
|
|
Nix.XML
|
|
|
|
other-modules:
|
|
|
|
Paths_hnix
|
|
|
|
hs-source-dirs:
|
|
|
|
src
|
2018-04-29 03:21:24 +02:00
|
|
|
ghc-options: -Wall
|
2018-04-08 00:08:48 +02:00
|
|
|
build-depends:
|
|
|
|
aeson
|
2014-07-01 06:12:18 +02:00
|
|
|
, ansi-wl-pprint
|
2018-04-08 00:08:48 +02:00
|
|
|
, array >=0.4 && <0.6
|
|
|
|
, base >=4.9 && <5
|
2018-04-02 03:20:53 +02:00
|
|
|
, base16-bytestring
|
2018-04-11 03:57:17 +02:00
|
|
|
, binary
|
2018-04-08 00:08:48 +02:00
|
|
|
, bytestring
|
2018-04-11 23:35:17 +02:00
|
|
|
, compact
|
2014-07-01 06:12:18 +02:00
|
|
|
, containers
|
2018-04-02 03:20:53 +02:00
|
|
|
, cryptohash
|
2014-09-27 20:11:17 +02:00
|
|
|
, data-fix
|
2016-01-23 22:20:33 +01:00
|
|
|
, deepseq
|
2018-04-08 00:08:48 +02:00
|
|
|
, deriving-compat >=0.3 && <0.5
|
2018-04-07 00:20:21 +02:00
|
|
|
, directory
|
2018-04-08 00:08:48 +02:00
|
|
|
, exceptions
|
2018-04-07 00:20:21 +02:00
|
|
|
, filepath
|
2018-04-17 20:33:20 +02:00
|
|
|
, hashable
|
2018-04-29 01:13:24 +02:00
|
|
|
, haskeline
|
2018-05-03 06:38:13 +02:00
|
|
|
, http-client
|
|
|
|
, http-client-tls
|
|
|
|
, http-types
|
Much more work on type inference; report multiple possible types
This is needed because of a function like this:
x: y: x + y
This is polymorphic, but over exactly four possibilities:
int -> int
int -> float
float -> int
float -> float
The "type" is really the combination of the four, since we don't yet have a
mechanism like type classes, which could have rendered this as a single type:
(Num a, Num b) => (x :: a): (y :: b): x + y
Going this route will require that we manage an implicit type classes
hierarchy, and perform unification on constraints as well as types. In the
interim, I just lifted the unification algorithm into the LogicT monad, and
use back-tracking search to find all the possible types an expression could
be.
The main problem with using LogicT, however, is that there are many types
it *couldn't* be, and in the case of a unification failure, it not yet clear
what the type should have been. For example:
"foo" + 2
Should the string have been a float or an integer or a path? Or should the
integer have been a string? So for now we report all the possibilities, since
it's not obvious which part of the expression is in error:
hnix: Type error: TypeInferenceErrors
[ UnificationFail (TCon "integer") (TCon "string")
, UnificationFail (TCon "string") (TCon "path")
, UnificationFail (TCon "string") (TCon "float")
, UnificationFail (TCon "string") (TCon "integer")
]
This is a case where enumerating types rather than trying to make them compact
using type classes might actually be an improvement, since the errors here
would have been only slightly less numerous:
string != Num a => a
string != path
integer != string
Clearly a better reporting mechanism is needed to clarify these problems. I
can imagine that in an IDE, there would be a squiggly under both sides of the
expression, each suggesting the type that was expected for that argument under
the assumption that the other argument (the one not be inspected) was the
correct one.
2018-05-02 02:35:13 +02:00
|
|
|
, logict
|
2018-04-09 19:16:25 +02:00
|
|
|
, megaparsec
|
2018-04-08 00:08:48 +02:00
|
|
|
, monadlist
|
|
|
|
, mtl
|
2018-04-12 05:53:38 +02:00
|
|
|
, optparse-applicative
|
2018-04-25 22:00:41 +02:00
|
|
|
, pretty-show
|
2018-04-08 00:08:48 +02:00
|
|
|
, process
|
|
|
|
, regex-tdfa
|
|
|
|
, regex-tdfa-text
|
2018-04-04 02:36:54 +02:00
|
|
|
, scientific
|
2018-04-08 00:08:48 +02:00
|
|
|
, semigroups >=0.18 && <0.19
|
2018-04-12 02:59:42 +02:00
|
|
|
, serialise
|
2018-04-01 01:53:35 +02:00
|
|
|
, split
|
2018-04-08 00:08:48 +02:00
|
|
|
, syb
|
2018-04-03 23:21:33 +02:00
|
|
|
, template-haskell
|
2018-04-08 00:08:48 +02:00
|
|
|
, text
|
2018-03-28 03:42:31 +02:00
|
|
|
, these
|
2018-05-03 06:32:00 +02:00
|
|
|
, time
|
2018-04-08 00:08:48 +02:00
|
|
|
, transformers
|
2018-04-02 04:16:55 +02:00
|
|
|
, unix
|
2018-04-08 00:08:48 +02:00
|
|
|
, unordered-containers >=0.2.9 && <0.3
|
2018-04-04 02:36:54 +02:00
|
|
|
, vector
|
2018-04-05 10:13:13 +02:00
|
|
|
, xml
|
2018-04-19 01:28:21 +02:00
|
|
|
if flag(tracing)
|
|
|
|
cpp-options: -DENABLE_TRACING=1
|
2018-05-01 03:47:21 +02:00
|
|
|
if impl(ghc < 8.4.0) && !flag(profiling)
|
2018-04-29 03:29:37 +02:00
|
|
|
build-depends:
|
|
|
|
ghc-datasize
|
2018-04-08 00:08:48 +02:00
|
|
|
default-language: Haskell2010
|
2018-04-07 00:20:21 +02:00
|
|
|
|
2018-04-08 00:08:48 +02:00
|
|
|
executable hnix
|
|
|
|
main-is: Main.hs
|
|
|
|
other-modules:
|
2018-04-12 19:53:50 +02:00
|
|
|
Repl
|
2018-04-08 00:08:48 +02:00
|
|
|
Paths_hnix
|
|
|
|
hs-source-dirs:
|
|
|
|
main
|
2018-04-29 03:21:24 +02:00
|
|
|
ghc-options: -Wall
|
2018-04-08 00:08:48 +02:00
|
|
|
build-depends:
|
2018-04-17 23:24:52 +02:00
|
|
|
aeson
|
|
|
|
, ansi-wl-pprint
|
2018-04-08 00:08:48 +02:00
|
|
|
, base >=4.9 && <5
|
2018-04-12 02:59:42 +02:00
|
|
|
, bytestring
|
2018-04-11 23:35:17 +02:00
|
|
|
, compact
|
2014-07-01 05:37:20 +02:00
|
|
|
, containers
|
2014-09-27 20:11:17 +02:00
|
|
|
, data-fix
|
2016-01-23 22:20:33 +01:00
|
|
|
, deepseq
|
2018-04-08 00:08:48 +02:00
|
|
|
, exceptions
|
2018-04-11 23:35:17 +02:00
|
|
|
, filepath
|
2018-04-29 01:13:24 +02:00
|
|
|
, haskeline
|
2018-04-08 00:08:48 +02:00
|
|
|
, hnix
|
|
|
|
, mtl
|
2018-03-28 06:59:27 +02:00
|
|
|
, optparse-applicative
|
2018-05-01 03:47:58 +02:00
|
|
|
, pretty-show
|
2018-04-12 19:53:50 +02:00
|
|
|
, repline
|
2018-04-12 02:59:42 +02:00
|
|
|
, serialise
|
2018-04-07 00:20:21 +02:00
|
|
|
, template-haskell
|
2018-04-08 00:08:48 +02:00
|
|
|
, text
|
2018-05-03 06:32:00 +02:00
|
|
|
, time
|
2018-03-28 23:45:10 +02:00
|
|
|
, transformers
|
2018-04-08 00:08:48 +02:00
|
|
|
, unordered-containers >=0.2.9 && <0.3
|
2018-04-19 01:28:21 +02:00
|
|
|
if flag(tracing)
|
|
|
|
cpp-options: -DENABLE_TRACING=1
|
2018-04-08 00:08:48 +02:00
|
|
|
default-language: Haskell2010
|
2014-07-01 05:37:20 +02:00
|
|
|
|
2018-04-08 00:08:48 +02:00
|
|
|
test-suite hnix-tests
|
|
|
|
type: exitcode-stdio-1.0
|
|
|
|
main-is: Main.hs
|
|
|
|
other-modules:
|
|
|
|
EvalTests
|
|
|
|
NixLanguageTests
|
|
|
|
ParserTests
|
|
|
|
PrettyTests
|
2018-04-08 00:13:58 +02:00
|
|
|
TestCommon
|
2018-04-08 00:08:48 +02:00
|
|
|
Paths_hnix
|
|
|
|
hs-source-dirs:
|
|
|
|
tests
|
2018-04-29 03:21:24 +02:00
|
|
|
ghc-options: -Wall -threaded
|
2018-04-08 00:08:48 +02:00
|
|
|
build-depends:
|
|
|
|
Glob
|
|
|
|
, ansi-wl-pprint
|
|
|
|
, base >=4.9 && <5
|
2018-04-12 05:53:38 +02:00
|
|
|
, bytestring
|
2018-04-11 23:35:17 +02:00
|
|
|
, compact
|
2014-08-03 14:17:43 +02:00
|
|
|
, containers
|
2014-09-27 20:11:17 +02:00
|
|
|
, data-fix
|
2018-04-09 19:16:25 +02:00
|
|
|
, deepseq
|
2018-04-10 21:38:14 +02:00
|
|
|
, directory
|
2018-04-08 00:08:48 +02:00
|
|
|
, exceptions
|
2018-04-07 00:20:21 +02:00
|
|
|
, filepath
|
2018-04-08 00:08:48 +02:00
|
|
|
, hnix
|
|
|
|
, interpolate
|
|
|
|
, mtl
|
2018-04-12 05:53:38 +02:00
|
|
|
, optparse-applicative
|
2018-04-07 00:20:21 +02:00
|
|
|
, process
|
2018-04-12 02:59:42 +02:00
|
|
|
, serialise
|
2018-04-07 00:20:21 +02:00
|
|
|
, split
|
2018-04-08 00:08:48 +02:00
|
|
|
, tasty
|
|
|
|
, tasty-hunit
|
|
|
|
, tasty-th
|
|
|
|
, template-haskell
|
|
|
|
, text
|
2018-05-03 06:32:00 +02:00
|
|
|
, time
|
2018-03-28 23:45:10 +02:00
|
|
|
, transformers
|
2018-04-07 21:02:33 +02:00
|
|
|
, unix
|
2018-04-08 00:08:48 +02:00
|
|
|
, unordered-containers >=0.2.9 && <0.3
|
2018-04-19 01:28:21 +02:00
|
|
|
if flag(tracing)
|
|
|
|
cpp-options: -DENABLE_TRACING=1
|
2018-04-08 00:08:48 +02:00
|
|
|
default-language: Haskell2010
|
2014-08-03 14:17:43 +02:00
|
|
|
|
2018-04-08 00:08:48 +02:00
|
|
|
benchmark hnix-benchmarks
|
|
|
|
type: exitcode-stdio-1.0
|
|
|
|
main-is: Main.hs
|
|
|
|
other-modules:
|
|
|
|
ParserBench
|
|
|
|
Paths_hnix
|
|
|
|
hs-source-dirs:
|
|
|
|
benchmarks
|
2018-04-29 03:21:24 +02:00
|
|
|
ghc-options: -Wall
|
2018-04-08 00:08:48 +02:00
|
|
|
build-depends:
|
|
|
|
ansi-wl-pprint
|
|
|
|
, base >=4.9 && <5
|
2018-04-12 05:53:38 +02:00
|
|
|
, bytestring
|
2018-04-11 23:35:17 +02:00
|
|
|
, compact
|
2014-08-27 23:54:31 +02:00
|
|
|
, containers
|
2018-04-07 00:20:21 +02:00
|
|
|
, criterion
|
2018-04-08 00:08:48 +02:00
|
|
|
, data-fix
|
2018-04-09 19:16:25 +02:00
|
|
|
, deepseq
|
2018-04-08 00:08:48 +02:00
|
|
|
, exceptions
|
2018-04-11 23:35:17 +02:00
|
|
|
, filepath
|
2018-04-08 00:08:48 +02:00
|
|
|
, hnix
|
|
|
|
, mtl
|
2018-04-12 05:53:38 +02:00
|
|
|
, optparse-applicative
|
2018-04-12 02:59:42 +02:00
|
|
|
, serialise
|
2018-04-08 00:08:48 +02:00
|
|
|
, template-haskell
|
|
|
|
, text
|
2018-05-03 06:32:00 +02:00
|
|
|
, time
|
2018-04-08 00:08:48 +02:00
|
|
|
, transformers
|
|
|
|
, unordered-containers >=0.2.9 && <0.3
|
2018-04-19 01:28:21 +02:00
|
|
|
if flag(tracing)
|
|
|
|
cpp-options: -DENABLE_TRACING=1
|
2018-04-08 00:08:48 +02:00
|
|
|
default-language: Haskell2010
|