dhall-lang / dhall-to-cabal

Compile Dhall expressions to Cabal files
MIT License
100 stars 19 forks source link

Release 1.0 #22

Closed ocharles closed 6 years ago

ocharles commented 6 years ago

I'm pretty much done with everything to get this project off the ground and released. To recap, we currently have:

This lets us write Dhall expressions that output Cabal files such as this one: dhall-to-cabal.dhall.

So, where do we go from here? What's missing?

ocharles commented 6 years ago

@Gabriel439 - would love to hear your thoughts on this.

ocharles commented 6 years ago

I wonder if to try and motivate adoption we should also provide cabal-to-dhall.

Gabriella439 commented 6 years ago

What are the custom types and is it possible to represent them within Dhall? The reason I ask is that I was curious to see what the fully normalized schema looked like, but the normal dhall tool doesn't work:

$ dhall <<< 'https://raw.githubusercontent.com/ocharles/dhall-to-cabal/master/dhall/types/Package.dhall'

Use "dhall --explain" for detailed errors

↳ https://raw.githubusercontent.com/ocharles/dhall-to-cabal/master/dhall/types/Package.dhall 
  ↳ https://raw.githubusercontent.com/ocharles/dhall-to-cabal/master/dhall/types/Guarded.dhall 
    ↳ https://raw.githubusercontent.com/ocharles/dhall-to-cabal/master/dhall/types/Config.dhall 

_ : < GHC : {} | GHCJS : {} | HBC : {} | HaskellSuite : { _1 : Text } | Helium : {} | Hugs : {} | JHC : {} | LHC : {} | NHC : {} | OtherCompiler : { _1 : Text } | UHC : {} | YHC : {} >

Error: Unbound variable

VersionRange

https://raw.githubusercontent.com/ocharles/dhall-to-cabal/master/dhall/types/Config.dhall:6:25
ocharles commented 6 years ago

What are the custom types and is it possible to represent them within Dhall?

The context is extended with the type 'VersionRange' and smart constructors in https://hackage.haskell.org/package/Cabal-2.0.1.1/docs/Distribution-Version.html#t:VersionRange. I settled on this as:

The context also has the magic v : Text -> List Natural which parses versions as Cabal does. Writing v "1.2.7" felt much nicer that repeatedly writing [+1, +2, +7], and has the benefit that the formatted will format it as an atomic unit.

The reason I ask is that I was curious to see what the fully normalized schema looked like

Huge and fairly unreadable ;)

the normal dhall tool doesn't work:

$ dhall <<< 'https://raw.githubusercontent.com/ocharles/dhall-to-cabal/master/dhall/types/Package.dhall'

Use "dhall --explain" for detailed errors

https://raw.githubusercontent.com/ocharles/dhall-to-cabal/master/dhall/types/Package.dhallhttps://raw.githubusercontent.com/ocharles/dhall-to-cabal/master/dhall/types/Guarded.dhallhttps://raw.githubusercontent.com/ocharles/dhall-to-cabal/master/dhall/types/Config.dhall

_ : < GHC : {} | GHCJS : {} | HBC : {} | HaskellSuite : { _1 : Text } | Helium : {} | Hugs : {} | JHC : {} | LHC : {} | NHC : {} | OtherCompiler : { _1 : Text } | UHC : {} | YHC : {} >

Error: Unbound variable

VersionRange

I had considered sending a feature request to the Dhall executable that would allow populating a context. Maybe it could take Dhall record of types, though I can't remember if that valid. Either way, would be nice to have dhall be able to normalize as far as possible.

Gabriella439 commented 6 years ago

I would still like to be able to see the final type, no matter how large it is :)

I think there are two possible solutions that might satisfy my use case:

ocharles commented 6 years ago

I'm torn on the first suggestion. On the one hand, it's convenient and does mean that every dhall-to-cabal expression is a normal valid Dhall file. On the other hand, it seems a shame to drop type safety and introspection abilities. One could argue that any inspection on the file should be done on the Cabal GenericPackageDescription though, and not the Dhall expression. There may cases where one would want to do some manipulation in Dhall expressions (right now there are functions that transform VersionRanges). It's not a huge stretch to imagine functions that add lower and upper bounds on libraries, or exclude known bad ranges. This isn't possible if we just use Text.

If our only reason to do so is to make it easier to use Dhall-to-Cabal expressions with other Dhall tools, I'm not sure it warrants the change.

For the second suggestion, I'll push back on that. It's not really a typical use case of the dhall-to-cabal executable, so I don't want to complicate it's interface. However, I have at least exported the top-level genericPackageDescription :: Type GenericPackageDescription and dhallToCabalContext :: Dhall.Context smbols, so it should be possible for you to get the type you want.

ocharles commented 6 years ago

Here is the type:

{ author :
    Text
, benchmarks :
    List
    { benchmark :
        List
        { body :
            { autogen-modules :
                List Text
            , build-depends :
                List { bounds : VersionRange, package : Text }
            , build-tool-depends :
                List
                { component : Text, package : Text, version : VersionRange }
            , build-tools :
                List { exe : Text, version : VersionRange }
            , buildable :
                Bool
            , c-sources :
                List Text
            , cc-options :
                List Text
            , compiler-options :
                { GHC :
                    List Text
                , GHCJS :
                    List Text
                , HBC :
                    List Text
                , Helium :
                    List Text
                , Hugs :
                    List Text
                , JHC :
                    List Text
                , LHC :
                    List Text
                , NHC :
                    List Text
                , UHC :
                    List Text
                , YHC :
                    List Text
                }
            , cpp-options :
                List Text
            , default-extensions :
                List
                < AllowAmbiguousTypes :
                    Bool
                | ApplicativeDo :
                    Bool
                | Arrows :
                    Bool
                | AutoDeriveTypeable :
                    Bool
                | BangPatterns :
                    Bool
                | BinaryLiterals :
                    Bool
                | CApiFFI :
                    Bool
                | CPP :
                    Bool
                | ConstrainedClassMethods :
                    Bool
                | ConstraintKinds :
                    Bool
                | DataKinds :
                    Bool
                | DatatypeContexts :
                    Bool
                | DefaultSignatures :
                    Bool
                | DeriveAnyClass :
                    Bool
                | DeriveDataTypeable :
                    Bool
                | DeriveFoldable :
                    Bool
                | DeriveFunctor :
                    Bool
                | DeriveGeneric :
                    Bool
                | DeriveLift :
                    Bool
                | DeriveTraversable :
                    Bool
                | DisambiguateRecordFields :
                    Bool
                | DoAndIfThenElse :
                    Bool
                | DoRec :
                    Bool
                | DuplicateRecordFields :
                    Bool
                | EmptyCase :
                    Bool
                | EmptyDataDecls :
                    Bool
                | ExistentialQuantification :
                    Bool
                | ExplicitForAll :
                    Bool
                | ExplicitNamespaces :
                    Bool
                | ExtendedDefaultRules :
                    Bool
                | ExtensibleRecords :
                    Bool
                | FlexibleContexts :
                    Bool
                | FlexibleInstances :
                    Bool
                | ForeignFunctionInterface :
                    Bool
                | FunctionalDependencies :
                    Bool
                | GADTSyntax :
                    Bool
                | GADTs :
                    Bool
                | GHCForeignImportPrim :
                    Bool
                | GeneralizedNewtypeDeriving :
                    Bool
                | Generics :
                    Bool
                | HereDocuments :
                    Bool
                | ImplicitParams :
                    Bool
                | ImplicitPrelude :
                    Bool
                | ImpredicativeTypes :
                    Bool
                | IncoherentInstances :
                    Bool
                | InstanceSigs :
                    Bool
                | InterruptibleFFI :
                    Bool
                | JavaScriptFFI :
                    Bool
                | KindSignatures :
                    Bool
                | LambdaCase :
                    Bool
                | LiberalTypeSynonyms :
                    Bool
                | MagicHash :
                    Bool
                | MonadComprehensions :
                    Bool
                | MonadFailDesugaring :
                    Bool
                | MonoLocalBinds :
                    Bool
                | MonoPatBinds :
                    Bool
                | MonomorphismRestriction :
                    Bool
                | MultiParamTypeClasses :
                    Bool
                | MultiWayIf :
                    Bool
                | NPlusKPatterns :
                    Bool
                | NamedFieldPuns :
                    Bool
                | NamedWildCards :
                    Bool
                | NegativeLiterals :
                    Bool
                | NewQualifiedOperators :
                    Bool
                | NondecreasingIndentation :
                    Bool
                | NullaryTypeClasses :
                    Bool
                | NumDecimals :
                    Bool
                | OverlappingInstances :
                    Bool
                | OverloadedLabels :
                    Bool
                | OverloadedLists :
                    Bool
                | OverloadedStrings :
                    Bool
                | PackageImports :
                    Bool
                | ParallelArrays :
                    Bool
                | ParallelListComp :
                    Bool
                | PartialTypeSignatures :
                    Bool
                | PatternGuards :
                    Bool
                | PatternSignatures :
                    Bool
                | PatternSynonyms :
                    Bool
                | PolyKinds :
                    Bool
                | PolymorphicComponents :
                    Bool
                | PostfixOperators :
                    Bool
                | QuasiQuotes :
                    Bool
                | Rank2Types :
                    Bool
                | RankNTypes :
                    Bool
                | RebindableSyntax :
                    Bool
                | RecordPuns :
                    Bool
                | RecordWildCards :
                    Bool
                | RecursiveDo :
                    Bool
                | RegularPatterns :
                    Bool
                | RelaxedPolyRec :
                    Bool
                | RestrictedTypeSynonyms :
                    Bool
                | RoleAnnotations :
                    Bool
                | Safe :
                    Bool
                | SafeImports :
                    Bool
                | ScopedTypeVariables :
                    Bool
                | StandaloneDeriving :
                    Bool
                | StaticPointers :
                    Bool
                | Strict :
                    Bool
                | StrictData :
                    Bool
                | TemplateHaskell :
                    Bool
                | TemplateHaskellQuotes :
                    Bool
                | TraditionalRecordSyntax :
                    Bool
                | TransformListComp :
                    Bool
                | Trustworthy :
                    Bool
                | TupleSections :
                    Bool
                | TypeApplications :
                    Bool
                | TypeFamilies :
                    Bool
                | TypeFamilyDependencies :
                    Bool
                | TypeInType :
                    Bool
                | TypeOperators :
                    Bool
                | TypeSynonymInstances :
                    Bool
                | UnboxedTuples :
                    Bool
                | UndecidableInstances :
                    Bool
                | UndecidableSuperClasses :
                    Bool
                | UnicodeSyntax :
                    Bool
                | UnliftedFFITypes :
                    Bool
                | Unsafe :
                    Bool
                | ViewPatterns :
                    Bool
                | XmlSyntax :
                    Bool
                >
            , default-language :
                Optional
                < Haskell2010 :
                    {}
                | Haskell98 :
                    {}
                | UnknownLanguage :
                    { _1 : Text }
                >
            , extra-framework-dirs :
                List Text
            , extra-ghci-libraries :
                List Text
            , extra-lib-dirs :
                List Text
            , extra-libraries :
                List Text
            , frameworks :
                List Text
            , hs-source-dirs :
                List Text
            , include-dirs :
                List Text
            , includes :
                List Text
            , install-includes :
                List Text
            , js-sources :
                List Text
            , ld-options :
                List Text
            , main-is :
                Text
            , mixins :
                List
                { package :
                    Text
                , renaming :
                    { provides :
                        List { rename : Text, to : Text }
                    , requires :
                        List { rename : Text, to : Text }
                    }
                }
            , other-extensions :
                List
                < AllowAmbiguousTypes :
                    Bool
                | ApplicativeDo :
                    Bool
                | Arrows :
                    Bool
                | AutoDeriveTypeable :
                    Bool
                | BangPatterns :
                    Bool
                | BinaryLiterals :
                    Bool
                | CApiFFI :
                    Bool
                | CPP :
                    Bool
                | ConstrainedClassMethods :
                    Bool
                | ConstraintKinds :
                    Bool
                | DataKinds :
                    Bool
                | DatatypeContexts :
                    Bool
                | DefaultSignatures :
                    Bool
                | DeriveAnyClass :
                    Bool
                | DeriveDataTypeable :
                    Bool
                | DeriveFoldable :
                    Bool
                | DeriveFunctor :
                    Bool
                | DeriveGeneric :
                    Bool
                | DeriveLift :
                    Bool
                | DeriveTraversable :
                    Bool
                | DisambiguateRecordFields :
                    Bool
                | DoAndIfThenElse :
                    Bool
                | DoRec :
                    Bool
                | DuplicateRecordFields :
                    Bool
                | EmptyCase :
                    Bool
                | EmptyDataDecls :
                    Bool
                | ExistentialQuantification :
                    Bool
                | ExplicitForAll :
                    Bool
                | ExplicitNamespaces :
                    Bool
                | ExtendedDefaultRules :
                    Bool
                | ExtensibleRecords :
                    Bool
                | FlexibleContexts :
                    Bool
                | FlexibleInstances :
                    Bool
                | ForeignFunctionInterface :
                    Bool
                | FunctionalDependencies :
                    Bool
                | GADTSyntax :
                    Bool
                | GADTs :
                    Bool
                | GHCForeignImportPrim :
                    Bool
                | GeneralizedNewtypeDeriving :
                    Bool
                | Generics :
                    Bool
                | HereDocuments :
                    Bool
                | ImplicitParams :
                    Bool
                | ImplicitPrelude :
                    Bool
                | ImpredicativeTypes :
                    Bool
                | IncoherentInstances :
                    Bool
                | InstanceSigs :
                    Bool
                | InterruptibleFFI :
                    Bool
                | JavaScriptFFI :
                    Bool
                | KindSignatures :
                    Bool
                | LambdaCase :
                    Bool
                | LiberalTypeSynonyms :
                    Bool
                | MagicHash :
                    Bool
                | MonadComprehensions :
                    Bool
                | MonadFailDesugaring :
                    Bool
                | MonoLocalBinds :
                    Bool
                | MonoPatBinds :
                    Bool
                | MonomorphismRestriction :
                    Bool
                | MultiParamTypeClasses :
                    Bool
                | MultiWayIf :
                    Bool
                | NPlusKPatterns :
                    Bool
                | NamedFieldPuns :
                    Bool
                | NamedWildCards :
                    Bool
                | NegativeLiterals :
                    Bool
                | NewQualifiedOperators :
                    Bool
                | NondecreasingIndentation :
                    Bool
                | NullaryTypeClasses :
                    Bool
                | NumDecimals :
                    Bool
                | OverlappingInstances :
                    Bool
                | OverloadedLabels :
                    Bool
                | OverloadedLists :
                    Bool
                | OverloadedStrings :
                    Bool
                | PackageImports :
                    Bool
                | ParallelArrays :
                    Bool
                | ParallelListComp :
                    Bool
                | PartialTypeSignatures :
                    Bool
                | PatternGuards :
                    Bool
                | PatternSignatures :
                    Bool
                | PatternSynonyms :
                    Bool
                | PolyKinds :
                    Bool
                | PolymorphicComponents :
                    Bool
                | PostfixOperators :
                    Bool
                | QuasiQuotes :
                    Bool
                | Rank2Types :
                    Bool
                | RankNTypes :
                    Bool
                | RebindableSyntax :
                    Bool
                | RecordPuns :
                    Bool
                | RecordWildCards :
                    Bool
                | RecursiveDo :
                    Bool
                | RegularPatterns :
                    Bool
                | RelaxedPolyRec :
                    Bool
                | RestrictedTypeSynonyms :
                    Bool
                | RoleAnnotations :
                    Bool
                | Safe :
                    Bool
                | SafeImports :
                    Bool
                | ScopedTypeVariables :
                    Bool
                | StandaloneDeriving :
                    Bool
                | StaticPointers :
                    Bool
                | Strict :
                    Bool
                | StrictData :
                    Bool
                | TemplateHaskell :
                    Bool
                | TemplateHaskellQuotes :
                    Bool
                | TraditionalRecordSyntax :
                    Bool
                | TransformListComp :
                    Bool
                | Trustworthy :
                    Bool
                | TupleSections :
                    Bool
                | TypeApplications :
                    Bool
                | TypeFamilies :
                    Bool
                | TypeFamilyDependencies :
                    Bool
                | TypeInType :
                    Bool
                | TypeOperators :
                    Bool
                | TypeSynonymInstances :
                    Bool
                | UnboxedTuples :
                    Bool
                | UndecidableInstances :
                    Bool
                | UndecidableSuperClasses :
                    Bool
                | UnicodeSyntax :
                    Bool
                | UnliftedFFITypes :
                    Bool
                | Unsafe :
                    Bool
                | ViewPatterns :
                    Bool
                | XmlSyntax :
                    Bool
                >
            , other-languages :
                List
                < Haskell2010 :
                    {}
                | Haskell98 :
                    {}
                | UnknownLanguage :
                    { _1 : Text }
                >
            , other-modules :
                List Text
            , pkgconfig-depends :
                List { name : Text, version : VersionRange }
            , profiling-options :
                { GHC :
                    List Text
                , GHCJS :
                    List Text
                , HBC :
                    List Text
                , Helium :
                    List Text
                , Hugs :
                    List Text
                , JHC :
                    List Text
                , LHC :
                    List Text
                , NHC :
                    List Text
                , UHC :
                    List Text
                , YHC :
                    List Text
                }
            , shared-options :
                { GHC :
                    List Text
                , GHCJS :
                    List Text
                , HBC :
                    List Text
                , Helium :
                    List Text
                , Hugs :
                    List Text
                , JHC :
                    List Text
                , LHC :
                    List Text
                , NHC :
                    List Text
                , UHC :
                    List Text
                , YHC :
                    List Text
                }
            }
        , guard :
              { arch :
                    < Alpha :
                        {}
                    | Arm :
                        {}
                    | Hppa :
                        {}
                    | I386 :
                        {}
                    | IA64 :
                        {}
                    | JavaScript :
                        {}
                    | M68k :
                        {}
                    | Mips :
                        {}
                    | OtherArch :
                        { _1 : Text }
                    | PPC :
                        {}
                    | PPC64 :
                        {}
                    | Rs6000 :
                        {}
                    | S390 :
                        {}
                    | SH :
                        {}
                    | Sparc :
                        {}
                    | Vax :
                        {}
                    | X86_64 :
                        {}
                    >
                  → Bool
              , flag :
                  Text → Bool
              , impl :
                    < GHC :
                        {}
                    | GHCJS :
                        {}
                    | HBC :
                        {}
                    | HaskellSuite :
                        { _1 : Text }
                    | Helium :
                        {}
                    | Hugs :
                        {}
                    | JHC :
                        {}
                    | LHC :
                        {}
                    | NHC :
                        {}
                    | OtherCompiler :
                        { _1 : Text }
                    | UHC :
                        {}
                    | YHC :
                        {}
                    >
                  → VersionRange
                  → Bool
              , os :
                    < AIX :
                        {}
                    | Android :
                        {}
                    | DragonFly :
                        {}
                    | FreeBSD :
                        {}
                    | Ghcjs :
                        {}
                    | HPUX :
                        {}
                    | HaLVM :
                        {}
                    | Hurd :
                        {}
                    | IOS :
                        {}
                    | IRIX :
                        {}
                    | Linux :
                        {}
                    | NetBSD :
                        {}
                    | OSX :
                        {}
                    | OpenBSD :
                        {}
                    | OtherOS :
                        { _1 : Text }
                    | Solaris :
                        {}
                    | Windows :
                        {}
                    >
                  → Bool
              }
            → Bool
        }
    , name :
        Text
    }
, bug-reports :
    Text
, build-type :
    Optional
    < Configure :
        {}
    | Custom :
        {}
    | Make :
        {}
    | Simple :
        {}
    | UnknownBuildType :
        { _1 : Text }
    >
, cabal-version :
    List Natural
, category :
    Text
, copyright :
    Text
, custom-setup :
    Optional { setup-depends : List { bounds : VersionRange, package : Text } }
, data-dir :
    Text
, data-files :
    List Text
, description :
    Text
, executables :
    List
    { executable :
        List
        { body :
            { autogen-modules :
                List Text
            , build-depends :
                List { bounds : VersionRange, package : Text }
            , build-tool-depends :
                List
                { component : Text, package : Text, version : VersionRange }
            , build-tools :
                List { exe : Text, version : VersionRange }
            , buildable :
                Bool
            , c-sources :
                List Text
            , cc-options :
                List Text
            , compiler-options :
                { GHC :
                    List Text
                , GHCJS :
                    List Text
                , HBC :
                    List Text
                , Helium :
                    List Text
                , Hugs :
                    List Text
                , JHC :
                    List Text
                , LHC :
                    List Text
                , NHC :
                    List Text
                , UHC :
                    List Text
                , YHC :
                    List Text
                }
            , cpp-options :
                List Text
            , default-extensions :
                List
                < AllowAmbiguousTypes :
                    Bool
                | ApplicativeDo :
                    Bool
                | Arrows :
                    Bool
                | AutoDeriveTypeable :
                    Bool
                | BangPatterns :
                    Bool
                | BinaryLiterals :
                    Bool
                | CApiFFI :
                    Bool
                | CPP :
                    Bool
                | ConstrainedClassMethods :
                    Bool
                | ConstraintKinds :
                    Bool
                | DataKinds :
                    Bool
                | DatatypeContexts :
                    Bool
                | DefaultSignatures :
                    Bool
                | DeriveAnyClass :
                    Bool
                | DeriveDataTypeable :
                    Bool
                | DeriveFoldable :
                    Bool
                | DeriveFunctor :
                    Bool
                | DeriveGeneric :
                    Bool
                | DeriveLift :
                    Bool
                | DeriveTraversable :
                    Bool
                | DisambiguateRecordFields :
                    Bool
                | DoAndIfThenElse :
                    Bool
                | DoRec :
                    Bool
                | DuplicateRecordFields :
                    Bool
                | EmptyCase :
                    Bool
                | EmptyDataDecls :
                    Bool
                | ExistentialQuantification :
                    Bool
                | ExplicitForAll :
                    Bool
                | ExplicitNamespaces :
                    Bool
                | ExtendedDefaultRules :
                    Bool
                | ExtensibleRecords :
                    Bool
                | FlexibleContexts :
                    Bool
                | FlexibleInstances :
                    Bool
                | ForeignFunctionInterface :
                    Bool
                | FunctionalDependencies :
                    Bool
                | GADTSyntax :
                    Bool
                | GADTs :
                    Bool
                | GHCForeignImportPrim :
                    Bool
                | GeneralizedNewtypeDeriving :
                    Bool
                | Generics :
                    Bool
                | HereDocuments :
                    Bool
                | ImplicitParams :
                    Bool
                | ImplicitPrelude :
                    Bool
                | ImpredicativeTypes :
                    Bool
                | IncoherentInstances :
                    Bool
                | InstanceSigs :
                    Bool
                | InterruptibleFFI :
                    Bool
                | JavaScriptFFI :
                    Bool
                | KindSignatures :
                    Bool
                | LambdaCase :
                    Bool
                | LiberalTypeSynonyms :
                    Bool
                | MagicHash :
                    Bool
                | MonadComprehensions :
                    Bool
                | MonadFailDesugaring :
                    Bool
                | MonoLocalBinds :
                    Bool
                | MonoPatBinds :
                    Bool
                | MonomorphismRestriction :
                    Bool
                | MultiParamTypeClasses :
                    Bool
                | MultiWayIf :
                    Bool
                | NPlusKPatterns :
                    Bool
                | NamedFieldPuns :
                    Bool
                | NamedWildCards :
                    Bool
                | NegativeLiterals :
                    Bool
                | NewQualifiedOperators :
                    Bool
                | NondecreasingIndentation :
                    Bool
                | NullaryTypeClasses :
                    Bool
                | NumDecimals :
                    Bool
                | OverlappingInstances :
                    Bool
                | OverloadedLabels :
                    Bool
                | OverloadedLists :
                    Bool
                | OverloadedStrings :
                    Bool
                | PackageImports :
                    Bool
                | ParallelArrays :
                    Bool
                | ParallelListComp :
                    Bool
                | PartialTypeSignatures :
                    Bool
                | PatternGuards :
                    Bool
                | PatternSignatures :
                    Bool
                | PatternSynonyms :
                    Bool
                | PolyKinds :
                    Bool
                | PolymorphicComponents :
                    Bool
                | PostfixOperators :
                    Bool
                | QuasiQuotes :
                    Bool
                | Rank2Types :
                    Bool
                | RankNTypes :
                    Bool
                | RebindableSyntax :
                    Bool
                | RecordPuns :
                    Bool
                | RecordWildCards :
                    Bool
                | RecursiveDo :
                    Bool
                | RegularPatterns :
                    Bool
                | RelaxedPolyRec :
                    Bool
                | RestrictedTypeSynonyms :
                    Bool
                | RoleAnnotations :
                    Bool
                | Safe :
                    Bool
                | SafeImports :
                    Bool
                | ScopedTypeVariables :
                    Bool
                | StandaloneDeriving :
                    Bool
                | StaticPointers :
                    Bool
                | Strict :
                    Bool
                | StrictData :
                    Bool
                | TemplateHaskell :
                    Bool
                | TemplateHaskellQuotes :
                    Bool
                | TraditionalRecordSyntax :
                    Bool
                | TransformListComp :
                    Bool
                | Trustworthy :
                    Bool
                | TupleSections :
                    Bool
                | TypeApplications :
                    Bool
                | TypeFamilies :
                    Bool
                | TypeFamilyDependencies :
                    Bool
                | TypeInType :
                    Bool
                | TypeOperators :
                    Bool
                | TypeSynonymInstances :
                    Bool
                | UnboxedTuples :
                    Bool
                | UndecidableInstances :
                    Bool
                | UndecidableSuperClasses :
                    Bool
                | UnicodeSyntax :
                    Bool
                | UnliftedFFITypes :
                    Bool
                | Unsafe :
                    Bool
                | ViewPatterns :
                    Bool
                | XmlSyntax :
                    Bool
                >
            , default-language :
                Optional
                < Haskell2010 :
                    {}
                | Haskell98 :
                    {}
                | UnknownLanguage :
                    { _1 : Text }
                >
            , extra-framework-dirs :
                List Text
            , extra-ghci-libraries :
                List Text
            , extra-lib-dirs :
                List Text
            , extra-libraries :
                List Text
            , frameworks :
                List Text
            , hs-source-dirs :
                List Text
            , include-dirs :
                List Text
            , includes :
                List Text
            , install-includes :
                List Text
            , js-sources :
                List Text
            , ld-options :
                List Text
            , main-is :
                Text
            , mixins :
                List
                { package :
                    Text
                , renaming :
                    { provides :
                        List { rename : Text, to : Text }
                    , requires :
                        List { rename : Text, to : Text }
                    }
                }
            , other-extensions :
                List
                < AllowAmbiguousTypes :
                    Bool
                | ApplicativeDo :
                    Bool
                | Arrows :
                    Bool
                | AutoDeriveTypeable :
                    Bool
                | BangPatterns :
                    Bool
                | BinaryLiterals :
                    Bool
                | CApiFFI :
                    Bool
                | CPP :
                    Bool
                | ConstrainedClassMethods :
                    Bool
                | ConstraintKinds :
                    Bool
                | DataKinds :
                    Bool
                | DatatypeContexts :
                    Bool
                | DefaultSignatures :
                    Bool
                | DeriveAnyClass :
                    Bool
                | DeriveDataTypeable :
                    Bool
                | DeriveFoldable :
                    Bool
                | DeriveFunctor :
                    Bool
                | DeriveGeneric :
                    Bool
                | DeriveLift :
                    Bool
                | DeriveTraversable :
                    Bool
                | DisambiguateRecordFields :
                    Bool
                | DoAndIfThenElse :
                    Bool
                | DoRec :
                    Bool
                | DuplicateRecordFields :
                    Bool
                | EmptyCase :
                    Bool
                | EmptyDataDecls :
                    Bool
                | ExistentialQuantification :
                    Bool
                | ExplicitForAll :
                    Bool
                | ExplicitNamespaces :
                    Bool
                | ExtendedDefaultRules :
                    Bool
                | ExtensibleRecords :
                    Bool
                | FlexibleContexts :
                    Bool
                | FlexibleInstances :
                    Bool
                | ForeignFunctionInterface :
                    Bool
                | FunctionalDependencies :
                    Bool
                | GADTSyntax :
                    Bool
                | GADTs :
                    Bool
                | GHCForeignImportPrim :
                    Bool
                | GeneralizedNewtypeDeriving :
                    Bool
                | Generics :
                    Bool
                | HereDocuments :
                    Bool
                | ImplicitParams :
                    Bool
                | ImplicitPrelude :
                    Bool
                | ImpredicativeTypes :
                    Bool
                | IncoherentInstances :
                    Bool
                | InstanceSigs :
                    Bool
                | InterruptibleFFI :
                    Bool
                | JavaScriptFFI :
                    Bool
                | KindSignatures :
                    Bool
                | LambdaCase :
                    Bool
                | LiberalTypeSynonyms :
                    Bool
                | MagicHash :
                    Bool
                | MonadComprehensions :
                    Bool
                | MonadFailDesugaring :
                    Bool
                | MonoLocalBinds :
                    Bool
                | MonoPatBinds :
                    Bool
                | MonomorphismRestriction :
                    Bool
                | MultiParamTypeClasses :
                    Bool
                | MultiWayIf :
                    Bool
                | NPlusKPatterns :
                    Bool
                | NamedFieldPuns :
                    Bool
                | NamedWildCards :
                    Bool
                | NegativeLiterals :
                    Bool
                | NewQualifiedOperators :
                    Bool
                | NondecreasingIndentation :
                    Bool
                | NullaryTypeClasses :
                    Bool
                | NumDecimals :
                    Bool
                | OverlappingInstances :
                    Bool
                | OverloadedLabels :
                    Bool
                | OverloadedLists :
                    Bool
                | OverloadedStrings :
                    Bool
                | PackageImports :
                    Bool
                | ParallelArrays :
                    Bool
                | ParallelListComp :
                    Bool
                | PartialTypeSignatures :
                    Bool
                | PatternGuards :
                    Bool
                | PatternSignatures :
                    Bool
                | PatternSynonyms :
                    Bool
                | PolyKinds :
                    Bool
                | PolymorphicComponents :
                    Bool
                | PostfixOperators :
                    Bool
                | QuasiQuotes :
                    Bool
                | Rank2Types :
                    Bool
                | RankNTypes :
                    Bool
                | RebindableSyntax :
                    Bool
                | RecordPuns :
                    Bool
                | RecordWildCards :
                    Bool
                | RecursiveDo :
                    Bool
                | RegularPatterns :
                    Bool
                | RelaxedPolyRec :
                    Bool
                | RestrictedTypeSynonyms :
                    Bool
                | RoleAnnotations :
                    Bool
                | Safe :
                    Bool
                | SafeImports :
                    Bool
                | ScopedTypeVariables :
                    Bool
                | StandaloneDeriving :
                    Bool
                | StaticPointers :
                    Bool
                | Strict :
                    Bool
                | StrictData :
                    Bool
                | TemplateHaskell :
                    Bool
                | TemplateHaskellQuotes :
                    Bool
                | TraditionalRecordSyntax :
                    Bool
                | TransformListComp :
                    Bool
                | Trustworthy :
                    Bool
                | TupleSections :
                    Bool
                | TypeApplications :
                    Bool
                | TypeFamilies :
                    Bool
                | TypeFamilyDependencies :
                    Bool
                | TypeInType :
                    Bool
                | TypeOperators :
                    Bool
                | TypeSynonymInstances :
                    Bool
                | UnboxedTuples :
                    Bool
                | UndecidableInstances :
                    Bool
                | UndecidableSuperClasses :
                    Bool
                | UnicodeSyntax :
                    Bool
                | UnliftedFFITypes :
                    Bool
                | Unsafe :
                    Bool
                | ViewPatterns :
                    Bool
                | XmlSyntax :
                    Bool
                >
            , other-languages :
                List
                < Haskell2010 :
                    {}
                | Haskell98 :
                    {}
                | UnknownLanguage :
                    { _1 : Text }
                >
            , other-modules :
                List Text
            , pkgconfig-depends :
                List { name : Text, version : VersionRange }
            , profiling-options :
                { GHC :
                    List Text
                , GHCJS :
                    List Text
                , HBC :
                    List Text
                , Helium :
                    List Text
                , Hugs :
                    List Text
                , JHC :
                    List Text
                , LHC :
                    List Text
                , NHC :
                    List Text
                , UHC :
                    List Text
                , YHC :
                    List Text
                }
            , scope :
                < Private : {} | Public : {} >
            , shared-options :
                { GHC :
                    List Text
                , GHCJS :
                    List Text
                , HBC :
                    List Text
                , Helium :
                    List Text
                , Hugs :
                    List Text
                , JHC :
                    List Text
                , LHC :
                    List Text
                , NHC :
                    List Text
                , UHC :
                    List Text
                , YHC :
                    List Text
                }
            }
        , guard :
              { arch :
                    < Alpha :
                        {}
                    | Arm :
                        {}
                    | Hppa :
                        {}
                    | I386 :
                        {}
                    | IA64 :
                        {}
                    | JavaScript :
                        {}
                    | M68k :
                        {}
                    | Mips :
                        {}
                    | OtherArch :
                        { _1 : Text }
                    | PPC :
                        {}
                    | PPC64 :
                        {}
                    | Rs6000 :
                        {}
                    | S390 :
                        {}
                    | SH :
                        {}
                    | Sparc :
                        {}
                    | Vax :
                        {}
                    | X86_64 :
                        {}
                    >
                  → Bool
              , flag :
                  Text → Bool
              , impl :
                    < GHC :
                        {}
                    | GHCJS :
                        {}
                    | HBC :
                        {}
                    | HaskellSuite :
                        { _1 : Text }
                    | Helium :
                        {}
                    | Hugs :
                        {}
                    | JHC :
                        {}
                    | LHC :
                        {}
                    | NHC :
                        {}
                    | OtherCompiler :
                        { _1 : Text }
                    | UHC :
                        {}
                    | YHC :
                        {}
                    >
                  → VersionRange
                  → Bool
              , os :
                    < AIX :
                        {}
                    | Android :
                        {}
                    | DragonFly :
                        {}
                    | FreeBSD :
                        {}
                    | Ghcjs :
                        {}
                    | HPUX :
                        {}
                    | HaLVM :
                        {}
                    | Hurd :
                        {}
                    | IOS :
                        {}
                    | IRIX :
                        {}
                    | Linux :
                        {}
                    | NetBSD :
                        {}
                    | OSX :
                        {}
                    | OpenBSD :
                        {}
                    | OtherOS :
                        { _1 : Text }
                    | Solaris :
                        {}
                    | Windows :
                        {}
                    >
                  → Bool
              }
            → Bool
        }
    , name :
        Text
    }
, extra-doc-files :
    List Text
, extra-source-files :
    List Text
, extra-tmp-files :
    List Text
, flags :
    List { default : Bool, description : Text, manual : Bool, name : Text }
, foreign-libraries :
    List
    { foreign-lib :
        List
        { body :
            { autogen-modules :
                List Text
            , build-depends :
                List { bounds : VersionRange, package : Text }
            , build-tool-depends :
                List
                { component : Text, package : Text, version : VersionRange }
            , build-tools :
                List { exe : Text, version : VersionRange }
            , buildable :
                Bool
            , c-sources :
                List Text
            , cc-options :
                List Text
            , compiler-options :
                { GHC :
                    List Text
                , GHCJS :
                    List Text
                , HBC :
                    List Text
                , Helium :
                    List Text
                , Hugs :
                    List Text
                , JHC :
                    List Text
                , LHC :
                    List Text
                , NHC :
                    List Text
                , UHC :
                    List Text
                , YHC :
                    List Text
                }
            , cpp-options :
                List Text
            , default-extensions :
                List
                < AllowAmbiguousTypes :
                    Bool
                | ApplicativeDo :
                    Bool
                | Arrows :
                    Bool
                | AutoDeriveTypeable :
                    Bool
                | BangPatterns :
                    Bool
                | BinaryLiterals :
                    Bool
                | CApiFFI :
                    Bool
                | CPP :
                    Bool
                | ConstrainedClassMethods :
                    Bool
                | ConstraintKinds :
                    Bool
                | DataKinds :
                    Bool
                | DatatypeContexts :
                    Bool
                | DefaultSignatures :
                    Bool
                | DeriveAnyClass :
                    Bool
                | DeriveDataTypeable :
                    Bool
                | DeriveFoldable :
                    Bool
                | DeriveFunctor :
                    Bool
                | DeriveGeneric :
                    Bool
                | DeriveLift :
                    Bool
                | DeriveTraversable :
                    Bool
                | DisambiguateRecordFields :
                    Bool
                | DoAndIfThenElse :
                    Bool
                | DoRec :
                    Bool
                | DuplicateRecordFields :
                    Bool
                | EmptyCase :
                    Bool
                | EmptyDataDecls :
                    Bool
                | ExistentialQuantification :
                    Bool
                | ExplicitForAll :
                    Bool
                | ExplicitNamespaces :
                    Bool
                | ExtendedDefaultRules :
                    Bool
                | ExtensibleRecords :
                    Bool
                | FlexibleContexts :
                    Bool
                | FlexibleInstances :
                    Bool
                | ForeignFunctionInterface :
                    Bool
                | FunctionalDependencies :
                    Bool
                | GADTSyntax :
                    Bool
                | GADTs :
                    Bool
                | GHCForeignImportPrim :
                    Bool
                | GeneralizedNewtypeDeriving :
                    Bool
                | Generics :
                    Bool
                | HereDocuments :
                    Bool
                | ImplicitParams :
                    Bool
                | ImplicitPrelude :
                    Bool
                | ImpredicativeTypes :
                    Bool
                | IncoherentInstances :
                    Bool
                | InstanceSigs :
                    Bool
                | InterruptibleFFI :
                    Bool
                | JavaScriptFFI :
                    Bool
                | KindSignatures :
                    Bool
                | LambdaCase :
                    Bool
                | LiberalTypeSynonyms :
                    Bool
                | MagicHash :
                    Bool
                | MonadComprehensions :
                    Bool
                | MonadFailDesugaring :
                    Bool
                | MonoLocalBinds :
                    Bool
                | MonoPatBinds :
                    Bool
                | MonomorphismRestriction :
                    Bool
                | MultiParamTypeClasses :
                    Bool
                | MultiWayIf :
                    Bool
                | NPlusKPatterns :
                    Bool
                | NamedFieldPuns :
                    Bool
                | NamedWildCards :
                    Bool
                | NegativeLiterals :
                    Bool
                | NewQualifiedOperators :
                    Bool
                | NondecreasingIndentation :
                    Bool
                | NullaryTypeClasses :
                    Bool
                | NumDecimals :
                    Bool
                | OverlappingInstances :
                    Bool
                | OverloadedLabels :
                    Bool
                | OverloadedLists :
                    Bool
                | OverloadedStrings :
                    Bool
                | PackageImports :
                    Bool
                | ParallelArrays :
                    Bool
                | ParallelListComp :
                    Bool
                | PartialTypeSignatures :
                    Bool
                | PatternGuards :
                    Bool
                | PatternSignatures :
                    Bool
                | PatternSynonyms :
                    Bool
                | PolyKinds :
                    Bool
                | PolymorphicComponents :
                    Bool
                | PostfixOperators :
                    Bool
                | QuasiQuotes :
                    Bool
                | Rank2Types :
                    Bool
                | RankNTypes :
                    Bool
                | RebindableSyntax :
                    Bool
                | RecordPuns :
                    Bool
                | RecordWildCards :
                    Bool
                | RecursiveDo :
                    Bool
                | RegularPatterns :
                    Bool
                | RelaxedPolyRec :
                    Bool
                | RestrictedTypeSynonyms :
                    Bool
                | RoleAnnotations :
                    Bool
                | Safe :
                    Bool
                | SafeImports :
                    Bool
                | ScopedTypeVariables :
                    Bool
                | StandaloneDeriving :
                    Bool
                | StaticPointers :
                    Bool
                | Strict :
                    Bool
                | StrictData :
                    Bool
                | TemplateHaskell :
                    Bool
                | TemplateHaskellQuotes :
                    Bool
                | TraditionalRecordSyntax :
                    Bool
                | TransformListComp :
                    Bool
                | Trustworthy :
                    Bool
                | TupleSections :
                    Bool
                | TypeApplications :
                    Bool
                | TypeFamilies :
                    Bool
                | TypeFamilyDependencies :
                    Bool
                | TypeInType :
                    Bool
                | TypeOperators :
                    Bool
                | TypeSynonymInstances :
                    Bool
                | UnboxedTuples :
                    Bool
                | UndecidableInstances :
                    Bool
                | UndecidableSuperClasses :
                    Bool
                | UnicodeSyntax :
                    Bool
                | UnliftedFFITypes :
                    Bool
                | Unsafe :
                    Bool
                | ViewPatterns :
                    Bool
                | XmlSyntax :
                    Bool
                >
            , default-language :
                Optional
                < Haskell2010 :
                    {}
                | Haskell98 :
                    {}
                | UnknownLanguage :
                    { _1 : Text }
                >
            , extra-framework-dirs :
                List Text
            , extra-ghci-libraries :
                List Text
            , extra-lib-dirs :
                List Text
            , extra-libraries :
                List Text
            , frameworks :
                List Text
            , hs-source-dirs :
                List Text
            , include-dirs :
                List Text
            , includes :
                List Text
            , install-includes :
                List Text
            , js-sources :
                List Text
            , ld-options :
                List Text
            , lib-version-info :
                Optional
                { age : Natural, current : Natural, revision : Natural }
            , lib-version-linux :
                Optional (List Natural)
            , mixins :
                List
                { package :
                    Text
                , renaming :
                    { provides :
                        List { rename : Text, to : Text }
                    , requires :
                        List { rename : Text, to : Text }
                    }
                }
            , mod-def-files :
                List Text
            , options :
                List < Standalone : {} >
            , other-extensions :
                List
                < AllowAmbiguousTypes :
                    Bool
                | ApplicativeDo :
                    Bool
                | Arrows :
                    Bool
                | AutoDeriveTypeable :
                    Bool
                | BangPatterns :
                    Bool
                | BinaryLiterals :
                    Bool
                | CApiFFI :
                    Bool
                | CPP :
                    Bool
                | ConstrainedClassMethods :
                    Bool
                | ConstraintKinds :
                    Bool
                | DataKinds :
                    Bool
                | DatatypeContexts :
                    Bool
                | DefaultSignatures :
                    Bool
                | DeriveAnyClass :
                    Bool
                | DeriveDataTypeable :
                    Bool
                | DeriveFoldable :
                    Bool
                | DeriveFunctor :
                    Bool
                | DeriveGeneric :
                    Bool
                | DeriveLift :
                    Bool
                | DeriveTraversable :
                    Bool
                | DisambiguateRecordFields :
                    Bool
                | DoAndIfThenElse :
                    Bool
                | DoRec :
                    Bool
                | DuplicateRecordFields :
                    Bool
                | EmptyCase :
                    Bool
                | EmptyDataDecls :
                    Bool
                | ExistentialQuantification :
                    Bool
                | ExplicitForAll :
                    Bool
                | ExplicitNamespaces :
                    Bool
                | ExtendedDefaultRules :
                    Bool
                | ExtensibleRecords :
                    Bool
                | FlexibleContexts :
                    Bool
                | FlexibleInstances :
                    Bool
                | ForeignFunctionInterface :
                    Bool
                | FunctionalDependencies :
                    Bool
                | GADTSyntax :
                    Bool
                | GADTs :
                    Bool
                | GHCForeignImportPrim :
                    Bool
                | GeneralizedNewtypeDeriving :
                    Bool
                | Generics :
                    Bool
                | HereDocuments :
                    Bool
                | ImplicitParams :
                    Bool
                | ImplicitPrelude :
                    Bool
                | ImpredicativeTypes :
                    Bool
                | IncoherentInstances :
                    Bool
                | InstanceSigs :
                    Bool
                | InterruptibleFFI :
                    Bool
                | JavaScriptFFI :
                    Bool
                | KindSignatures :
                    Bool
                | LambdaCase :
                    Bool
                | LiberalTypeSynonyms :
                    Bool
                | MagicHash :
                    Bool
                | MonadComprehensions :
                    Bool
                | MonadFailDesugaring :
                    Bool
                | MonoLocalBinds :
                    Bool
                | MonoPatBinds :
                    Bool
                | MonomorphismRestriction :
                    Bool
                | MultiParamTypeClasses :
                    Bool
                | MultiWayIf :
                    Bool
                | NPlusKPatterns :
                    Bool
                | NamedFieldPuns :
                    Bool
                | NamedWildCards :
                    Bool
                | NegativeLiterals :
                    Bool
                | NewQualifiedOperators :
                    Bool
                | NondecreasingIndentation :
                    Bool
                | NullaryTypeClasses :
                    Bool
                | NumDecimals :
                    Bool
                | OverlappingInstances :
                    Bool
                | OverloadedLabels :
                    Bool
                | OverloadedLists :
                    Bool
                | OverloadedStrings :
                    Bool
                | PackageImports :
                    Bool
                | ParallelArrays :
                    Bool
                | ParallelListComp :
                    Bool
                | PartialTypeSignatures :
                    Bool
                | PatternGuards :
                    Bool
                | PatternSignatures :
                    Bool
                | PatternSynonyms :
                    Bool
                | PolyKinds :
                    Bool
                | PolymorphicComponents :
                    Bool
                | PostfixOperators :
                    Bool
                | QuasiQuotes :
                    Bool
                | Rank2Types :
                    Bool
                | RankNTypes :
                    Bool
                | RebindableSyntax :
                    Bool
                | RecordPuns :
                    Bool
                | RecordWildCards :
                    Bool
                | RecursiveDo :
                    Bool
                | RegularPatterns :
                    Bool
                | RelaxedPolyRec :
                    Bool
                | RestrictedTypeSynonyms :
                    Bool
                | RoleAnnotations :
                    Bool
                | Safe :
                    Bool
                | SafeImports :
                    Bool
                | ScopedTypeVariables :
                    Bool
                | StandaloneDeriving :
                    Bool
                | StaticPointers :
                    Bool
                | Strict :
                    Bool
                | StrictData :
                    Bool
                | TemplateHaskell :
                    Bool
                | TemplateHaskellQuotes :
                    Bool
                | TraditionalRecordSyntax :
                    Bool
                | TransformListComp :
                    Bool
                | Trustworthy :
                    Bool
                | TupleSections :
                    Bool
                | TypeApplications :
                    Bool
                | TypeFamilies :
                    Bool
                | TypeFamilyDependencies :
                    Bool
                | TypeInType :
                    Bool
                | TypeOperators :
                    Bool
                | TypeSynonymInstances :
                    Bool
                | UnboxedTuples :
                    Bool
                | UndecidableInstances :
                    Bool
                | UndecidableSuperClasses :
                    Bool
                | UnicodeSyntax :
                    Bool
                | UnliftedFFITypes :
                    Bool
                | Unsafe :
                    Bool
                | ViewPatterns :
                    Bool
                | XmlSyntax :
                    Bool
                >
            , other-languages :
                List
                < Haskell2010 :
                    {}
                | Haskell98 :
                    {}
                | UnknownLanguage :
                    { _1 : Text }
                >
            , other-modules :
                List Text
            , pkgconfig-depends :
                List { name : Text, version : VersionRange }
            , profiling-options :
                { GHC :
                    List Text
                , GHCJS :
                    List Text
                , HBC :
                    List Text
                , Helium :
                    List Text
                , Hugs :
                    List Text
                , JHC :
                    List Text
                , LHC :
                    List Text
                , NHC :
                    List Text
                , UHC :
                    List Text
                , YHC :
                    List Text
                }
            , shared-options :
                { GHC :
                    List Text
                , GHCJS :
                    List Text
                , HBC :
                    List Text
                , Helium :
                    List Text
                , Hugs :
                    List Text
                , JHC :
                    List Text
                , LHC :
                    List Text
                , NHC :
                    List Text
                , UHC :
                    List Text
                , YHC :
                    List Text
                }
            , type :
                < Shared : {} | Static : {} >
            }
        , guard :
              { arch :
                    < Alpha :
                        {}
                    | Arm :
                        {}
                    | Hppa :
                        {}
                    | I386 :
                        {}
                    | IA64 :
                        {}
                    | JavaScript :
                        {}
                    | M68k :
                        {}
                    | Mips :
                        {}
                    | OtherArch :
                        { _1 : Text }
                    | PPC :
                        {}
                    | PPC64 :
                        {}
                    | Rs6000 :
                        {}
                    | S390 :
                        {}
                    | SH :
                        {}
                    | Sparc :
                        {}
                    | Vax :
                        {}
                    | X86_64 :
                        {}
                    >
                  → Bool
              , flag :
                  Text → Bool
              , impl :
                    < GHC :
                        {}
                    | GHCJS :
                        {}
                    | HBC :
                        {}
                    | HaskellSuite :
                        { _1 : Text }
                    | Helium :
                        {}
                    | Hugs :
                        {}
                    | JHC :
                        {}
                    | LHC :
                        {}
                    | NHC :
                        {}
                    | OtherCompiler :
                        { _1 : Text }
                    | UHC :
                        {}
                    | YHC :
                        {}
                    >
                  → VersionRange
                  → Bool
              , os :
                    < AIX :
                        {}
                    | Android :
                        {}
                    | DragonFly :
                        {}
                    | FreeBSD :
                        {}
                    | Ghcjs :
                        {}
                    | HPUX :
                        {}
                    | HaLVM :
                        {}
                    | Hurd :
                        {}
                    | IOS :
                        {}
                    | IRIX :
                        {}
                    | Linux :
                        {}
                    | NetBSD :
                        {}
                    | OSX :
                        {}
                    | OpenBSD :
                        {}
                    | OtherOS :
                        { _1 : Text }
                    | Solaris :
                        {}
                    | Windows :
                        {}
                    >
                  → Bool
              }
            → Bool
        }
    , name :
        Text
    }
, homepage :
    Text
, library :
    Optional
    ( List
      { body :
          { autogen-modules :
              List Text
          , build-depends :
              List { bounds : VersionRange, package : Text }
          , build-tool-depends :
              List { component : Text, package : Text, version : VersionRange }
          , build-tools :
              List { exe : Text, version : VersionRange }
          , buildable :
              Bool
          , c-sources :
              List Text
          , cc-options :
              List Text
          , compiler-options :
              { GHC :
                  List Text
              , GHCJS :
                  List Text
              , HBC :
                  List Text
              , Helium :
                  List Text
              , Hugs :
                  List Text
              , JHC :
                  List Text
              , LHC :
                  List Text
              , NHC :
                  List Text
              , UHC :
                  List Text
              , YHC :
                  List Text
              }
          , cpp-options :
              List Text
          , default-extensions :
              List
              < AllowAmbiguousTypes :
                  Bool
              | ApplicativeDo :
                  Bool
              | Arrows :
                  Bool
              | AutoDeriveTypeable :
                  Bool
              | BangPatterns :
                  Bool
              | BinaryLiterals :
                  Bool
              | CApiFFI :
                  Bool
              | CPP :
                  Bool
              | ConstrainedClassMethods :
                  Bool
              | ConstraintKinds :
                  Bool
              | DataKinds :
                  Bool
              | DatatypeContexts :
                  Bool
              | DefaultSignatures :
                  Bool
              | DeriveAnyClass :
                  Bool
              | DeriveDataTypeable :
                  Bool
              | DeriveFoldable :
                  Bool
              | DeriveFunctor :
                  Bool
              | DeriveGeneric :
                  Bool
              | DeriveLift :
                  Bool
              | DeriveTraversable :
                  Bool
              | DisambiguateRecordFields :
                  Bool
              | DoAndIfThenElse :
                  Bool
              | DoRec :
                  Bool
              | DuplicateRecordFields :
                  Bool
              | EmptyCase :
                  Bool
              | EmptyDataDecls :
                  Bool
              | ExistentialQuantification :
                  Bool
              | ExplicitForAll :
                  Bool
              | ExplicitNamespaces :
                  Bool
              | ExtendedDefaultRules :
                  Bool
              | ExtensibleRecords :
                  Bool
              | FlexibleContexts :
                  Bool
              | FlexibleInstances :
                  Bool
              | ForeignFunctionInterface :
                  Bool
              | FunctionalDependencies :
                  Bool
              | GADTSyntax :
                  Bool
              | GADTs :
                  Bool
              | GHCForeignImportPrim :
                  Bool
              | GeneralizedNewtypeDeriving :
                  Bool
              | Generics :
                  Bool
              | HereDocuments :
                  Bool
              | ImplicitParams :
                  Bool
              | ImplicitPrelude :
                  Bool
              | ImpredicativeTypes :
                  Bool
              | IncoherentInstances :
                  Bool
              | InstanceSigs :
                  Bool
              | InterruptibleFFI :
                  Bool
              | JavaScriptFFI :
                  Bool
              | KindSignatures :
                  Bool
              | LambdaCase :
                  Bool
              | LiberalTypeSynonyms :
                  Bool
              | MagicHash :
                  Bool
              | MonadComprehensions :
                  Bool
              | MonadFailDesugaring :
                  Bool
              | MonoLocalBinds :
                  Bool
              | MonoPatBinds :
                  Bool
              | MonomorphismRestriction :
                  Bool
              | MultiParamTypeClasses :
                  Bool
              | MultiWayIf :
                  Bool
              | NPlusKPatterns :
                  Bool
              | NamedFieldPuns :
                  Bool
              | NamedWildCards :
                  Bool
              | NegativeLiterals :
                  Bool
              | NewQualifiedOperators :
                  Bool
              | NondecreasingIndentation :
                  Bool
              | NullaryTypeClasses :
                  Bool
              | NumDecimals :
                  Bool
              | OverlappingInstances :
                  Bool
              | OverloadedLabels :
                  Bool
              | OverloadedLists :
                  Bool
              | OverloadedStrings :
                  Bool
              | PackageImports :
                  Bool
              | ParallelArrays :
                  Bool
              | ParallelListComp :
                  Bool
              | PartialTypeSignatures :
                  Bool
              | PatternGuards :
                  Bool
              | PatternSignatures :
                  Bool
              | PatternSynonyms :
                  Bool
              | PolyKinds :
                  Bool
              | PolymorphicComponents :
                  Bool
              | PostfixOperators :
                  Bool
              | QuasiQuotes :
                  Bool
              | Rank2Types :
                  Bool
              | RankNTypes :
                  Bool
              | RebindableSyntax :
                  Bool
              | RecordPuns :
                  Bool
              | RecordWildCards :
                  Bool
              | RecursiveDo :
                  Bool
              | RegularPatterns :
                  Bool
              | RelaxedPolyRec :
                  Bool
              | RestrictedTypeSynonyms :
                  Bool
              | RoleAnnotations :
                  Bool
              | Safe :
                  Bool
              | SafeImports :
                  Bool
              | ScopedTypeVariables :
                  Bool
              | StandaloneDeriving :
                  Bool
              | StaticPointers :
                  Bool
              | Strict :
                  Bool
              | StrictData :
                  Bool
              | TemplateHaskell :
                  Bool
              | TemplateHaskellQuotes :
                  Bool
              | TraditionalRecordSyntax :
                  Bool
              | TransformListComp :
                  Bool
              | Trustworthy :
                  Bool
              | TupleSections :
                  Bool
              | TypeApplications :
                  Bool
              | TypeFamilies :
                  Bool
              | TypeFamilyDependencies :
                  Bool
              | TypeInType :
                  Bool
              | TypeOperators :
                  Bool
              | TypeSynonymInstances :
                  Bool
              | UnboxedTuples :
                  Bool
              | UndecidableInstances :
                  Bool
              | UndecidableSuperClasses :
                  Bool
              | UnicodeSyntax :
                  Bool
              | UnliftedFFITypes :
                  Bool
              | Unsafe :
                  Bool
              | ViewPatterns :
                  Bool
              | XmlSyntax :
                  Bool
              >
          , default-language :
              Optional
              < Haskell2010 :
                  {}
              | Haskell98 :
                  {}
              | UnknownLanguage :
                  { _1 : Text }
              >
          , exposed-modules :
              List Text
          , extra-framework-dirs :
              List Text
          , extra-ghci-libraries :
              List Text
          , extra-lib-dirs :
              List Text
          , extra-libraries :
              List Text
          , frameworks :
              List Text
          , hs-source-dirs :
              List Text
          , include-dirs :
              List Text
          , includes :
              List Text
          , install-includes :
              List Text
          , js-sources :
              List Text
          , ld-options :
              List Text
          , mixins :
              List
              { package :
                  Text
              , renaming :
                  { provides :
                      List { rename : Text, to : Text }
                  , requires :
                      List { rename : Text, to : Text }
                  }
              }
          , other-extensions :
              List
              < AllowAmbiguousTypes :
                  Bool
              | ApplicativeDo :
                  Bool
              | Arrows :
                  Bool
              | AutoDeriveTypeable :
                  Bool
              | BangPatterns :
                  Bool
              | BinaryLiterals :
                  Bool
              | CApiFFI :
                  Bool
              | CPP :
                  Bool
              | ConstrainedClassMethods :
                  Bool
              | ConstraintKinds :
                  Bool
              | DataKinds :
                  Bool
              | DatatypeContexts :
                  Bool
              | DefaultSignatures :
                  Bool
              | DeriveAnyClass :
                  Bool
              | DeriveDataTypeable :
                  Bool
              | DeriveFoldable :
                  Bool
              | DeriveFunctor :
                  Bool
              | DeriveGeneric :
                  Bool
              | DeriveLift :
                  Bool
              | DeriveTraversable :
                  Bool
              | DisambiguateRecordFields :
                  Bool
              | DoAndIfThenElse :
                  Bool
              | DoRec :
                  Bool
              | DuplicateRecordFields :
                  Bool
              | EmptyCase :
                  Bool
              | EmptyDataDecls :
                  Bool
              | ExistentialQuantification :
                  Bool
              | ExplicitForAll :
                  Bool
              | ExplicitNamespaces :
                  Bool
              | ExtendedDefaultRules :
                  Bool
              | ExtensibleRecords :
                  Bool
              | FlexibleContexts :
                  Bool
              | FlexibleInstances :
                  Bool
              | ForeignFunctionInterface :
                  Bool
              | FunctionalDependencies :
                  Bool
              | GADTSyntax :
                  Bool
              | GADTs :
                  Bool
              | GHCForeignImportPrim :
                  Bool
              | GeneralizedNewtypeDeriving :
                  Bool
              | Generics :
                  Bool
              | HereDocuments :
                  Bool
              | ImplicitParams :
                  Bool
              | ImplicitPrelude :
                  Bool
              | ImpredicativeTypes :
                  Bool
              | IncoherentInstances :
                  Bool
              | InstanceSigs :
                  Bool
              | InterruptibleFFI :
                  Bool
              | JavaScriptFFI :
                  Bool
              | KindSignatures :
                  Bool
              | LambdaCase :
                  Bool
              | LiberalTypeSynonyms :
                  Bool
              | MagicHash :
                  Bool
              | MonadComprehensions :
                  Bool
              | MonadFailDesugaring :
                  Bool
              | MonoLocalBinds :
                  Bool
              | MonoPatBinds :
                  Bool
              | MonomorphismRestriction :
                  Bool
              | MultiParamTypeClasses :
                  Bool
              | MultiWayIf :
                  Bool
              | NPlusKPatterns :
                  Bool
              | NamedFieldPuns :
                  Bool
              | NamedWildCards :
                  Bool
              | NegativeLiterals :
                  Bool
              | NewQualifiedOperators :
                  Bool
              | NondecreasingIndentation :
                  Bool
              | NullaryTypeClasses :
                  Bool
              | NumDecimals :
                  Bool
              | OverlappingInstances :
                  Bool
              | OverloadedLabels :
                  Bool
              | OverloadedLists :
                  Bool
              | OverloadedStrings :
                  Bool
              | PackageImports :
                  Bool
              | ParallelArrays :
                  Bool
              | ParallelListComp :
                  Bool
              | PartialTypeSignatures :
                  Bool
              | PatternGuards :
                  Bool
              | PatternSignatures :
                  Bool
              | PatternSynonyms :
                  Bool
              | PolyKinds :
                  Bool
              | PolymorphicComponents :
                  Bool
              | PostfixOperators :
                  Bool
              | QuasiQuotes :
                  Bool
              | Rank2Types :
                  Bool
              | RankNTypes :
                  Bool
              | RebindableSyntax :
                  Bool
              | RecordPuns :
                  Bool
              | RecordWildCards :
                  Bool
              | RecursiveDo :
                  Bool
              | RegularPatterns :
                  Bool
              | RelaxedPolyRec :
                  Bool
              | RestrictedTypeSynonyms :
                  Bool
              | RoleAnnotations :
                  Bool
              | Safe :
                  Bool
              | SafeImports :
                  Bool
              | ScopedTypeVariables :
                  Bool
              | StandaloneDeriving :
                  Bool
              | StaticPointers :
                  Bool
              | Strict :
                  Bool
              | StrictData :
                  Bool
              | TemplateHaskell :
                  Bool
              | TemplateHaskellQuotes :
                  Bool
              | TraditionalRecordSyntax :
                  Bool
              | TransformListComp :
                  Bool
              | Trustworthy :
                  Bool
              | TupleSections :
                  Bool
              | TypeApplications :
                  Bool
              | TypeFamilies :
                  Bool
              | TypeFamilyDependencies :
                  Bool
              | TypeInType :
                  Bool
              | TypeOperators :
                  Bool
              | TypeSynonymInstances :
                  Bool
              | UnboxedTuples :
                  Bool
              | UndecidableInstances :
                  Bool
              | UndecidableSuperClasses :
                  Bool
              | UnicodeSyntax :
                  Bool
              | UnliftedFFITypes :
                  Bool
              | Unsafe :
                  Bool
              | ViewPatterns :
                  Bool
              | XmlSyntax :
                  Bool
              >
          , other-languages :
              List
              < Haskell2010 :
                  {}
              | Haskell98 :
                  {}
              | UnknownLanguage :
                  { _1 : Text }
              >
          , other-modules :
              List Text
          , pkgconfig-depends :
              List { name : Text, version : VersionRange }
          , profiling-options :
              { GHC :
                  List Text
              , GHCJS :
                  List Text
              , HBC :
                  List Text
              , Helium :
                  List Text
              , Hugs :
                  List Text
              , JHC :
                  List Text
              , LHC :
                  List Text
              , NHC :
                  List Text
              , UHC :
                  List Text
              , YHC :
                  List Text
              }
          , reexported-modules :
              List
              { name :
                  Text
              , original :
                  { name : Text, package : Optional Text }
              }
          , shared-options :
              { GHC :
                  List Text
              , GHCJS :
                  List Text
              , HBC :
                  List Text
              , Helium :
                  List Text
              , Hugs :
                  List Text
              , JHC :
                  List Text
              , LHC :
                  List Text
              , NHC :
                  List Text
              , UHC :
                  List Text
              , YHC :
                  List Text
              }
          , signatures :
              List Text
          }
      , guard :
            { arch :
                  < Alpha :
                      {}
                  | Arm :
                      {}
                  | Hppa :
                      {}
                  | I386 :
                      {}
                  | IA64 :
                      {}
                  | JavaScript :
                      {}
                  | M68k :
                      {}
                  | Mips :
                      {}
                  | OtherArch :
                      { _1 : Text }
                  | PPC :
                      {}
                  | PPC64 :
                      {}
                  | Rs6000 :
                      {}
                  | S390 :
                      {}
                  | SH :
                      {}
                  | Sparc :
                      {}
                  | Vax :
                      {}
                  | X86_64 :
                      {}
                  >
                → Bool
            , flag :
                Text → Bool
            , impl :
                  < GHC :
                      {}
                  | GHCJS :
                      {}
                  | HBC :
                      {}
                  | HaskellSuite :
                      { _1 : Text }
                  | Helium :
                      {}
                  | Hugs :
                      {}
                  | JHC :
                      {}
                  | LHC :
                      {}
                  | NHC :
                      {}
                  | OtherCompiler :
                      { _1 : Text }
                  | UHC :
                      {}
                  | YHC :
                      {}
                  >
                → VersionRange
                → Bool
            , os :
                  < AIX :
                      {}
                  | Android :
                      {}
                  | DragonFly :
                      {}
                  | FreeBSD :
                      {}
                  | Ghcjs :
                      {}
                  | HPUX :
                      {}
                  | HaLVM :
                      {}
                  | Hurd :
                      {}
                  | IOS :
                      {}
                  | IRIX :
                      {}
                  | Linux :
                      {}
                  | NetBSD :
                      {}
                  | OSX :
                      {}
                  | OpenBSD :
                      {}
                  | OtherOS :
                      { _1 : Text }
                  | Solaris :
                      {}
                  | Windows :
                      {}
                  >
                → Bool
            }
          → Bool
      }
    )
, license :
    < AGPL :
        Optional (List Natural)
    | AllRightsReserved :
        {}
    | Apache :
        Optional (List Natural)
    | BSD2 :
        {}
    | BSD3 :
        {}
    | BSD4 :
        {}
    | GPL :
        Optional (List Natural)
    | ISC :
        {}
    | LGPL :
        Optional (List Natural)
    | MIT :
        {}
    | MPL :
        List Natural
    | Other :
        {}
    | PublicDomain :
        {}
    | Unspecified :
        {}
    >
, license-files :
    List Text
, maintainer :
    Text
, name :
    Text
, package-url :
    Text
, source-repos :
    List
    { branch :
        Optional Text
    , kind :
        < RepoHead : {} | RepoKindUnknown : { _1 : Text } | RepoThis : {} >
    , location :
        Optional Text
    , module :
        Optional Text
    , subdir :
        Optional Text
    , tag :
        Optional Text
    , type :
        Optional
        < Bazaar :
            {}
        | CVS :
            {}
        | Darcs :
            {}
        | Git :
            {}
        | GnuArch :
            {}
        | Mercurial :
            {}
        | Monotone :
            {}
        | OtherRepoType :
            { _1 : Text }
        | SVN :
            {}
        >
    }
, stability :
    Text
, sub-libraries :
    List
    { library :
        List
        { body :
            { autogen-modules :
                List Text
            , build-depends :
                List { bounds : VersionRange, package : Text }
            , build-tool-depends :
                List
                { component : Text, package : Text, version : VersionRange }
            , build-tools :
                List { exe : Text, version : VersionRange }
            , buildable :
                Bool
            , c-sources :
                List Text
            , cc-options :
                List Text
            , compiler-options :
                { GHC :
                    List Text
                , GHCJS :
                    List Text
                , HBC :
                    List Text
                , Helium :
                    List Text
                , Hugs :
                    List Text
                , JHC :
                    List Text
                , LHC :
                    List Text
                , NHC :
                    List Text
                , UHC :
                    List Text
                , YHC :
                    List Text
                }
            , cpp-options :
                List Text
            , default-extensions :
                List
                < AllowAmbiguousTypes :
                    Bool
                | ApplicativeDo :
                    Bool
                | Arrows :
                    Bool
                | AutoDeriveTypeable :
                    Bool
                | BangPatterns :
                    Bool
                | BinaryLiterals :
                    Bool
                | CApiFFI :
                    Bool
                | CPP :
                    Bool
                | ConstrainedClassMethods :
                    Bool
                | ConstraintKinds :
                    Bool
                | DataKinds :
                    Bool
                | DatatypeContexts :
                    Bool
                | DefaultSignatures :
                    Bool
                | DeriveAnyClass :
                    Bool
                | DeriveDataTypeable :
                    Bool
                | DeriveFoldable :
                    Bool
                | DeriveFunctor :
                    Bool
                | DeriveGeneric :
                    Bool
                | DeriveLift :
                    Bool
                | DeriveTraversable :
                    Bool
                | DisambiguateRecordFields :
                    Bool
                | DoAndIfThenElse :
                    Bool
                | DoRec :
                    Bool
                | DuplicateRecordFields :
                    Bool
                | EmptyCase :
                    Bool
                | EmptyDataDecls :
                    Bool
                | ExistentialQuantification :
                    Bool
                | ExplicitForAll :
                    Bool
                | ExplicitNamespaces :
                    Bool
                | ExtendedDefaultRules :
                    Bool
                | ExtensibleRecords :
                    Bool
                | FlexibleContexts :
                    Bool
                | FlexibleInstances :
                    Bool
                | ForeignFunctionInterface :
                    Bool
                | FunctionalDependencies :
                    Bool
                | GADTSyntax :
                    Bool
                | GADTs :
                    Bool
                | GHCForeignImportPrim :
                    Bool
                | GeneralizedNewtypeDeriving :
                    Bool
                | Generics :
                    Bool
                | HereDocuments :
                    Bool
                | ImplicitParams :
                    Bool
                | ImplicitPrelude :
                    Bool
                | ImpredicativeTypes :
                    Bool
                | IncoherentInstances :
                    Bool
                | InstanceSigs :
                    Bool
                | InterruptibleFFI :
                    Bool
                | JavaScriptFFI :
                    Bool
                | KindSignatures :
                    Bool
                | LambdaCase :
                    Bool
                | LiberalTypeSynonyms :
                    Bool
                | MagicHash :
                    Bool
                | MonadComprehensions :
                    Bool
                | MonadFailDesugaring :
                    Bool
                | MonoLocalBinds :
                    Bool
                | MonoPatBinds :
                    Bool
                | MonomorphismRestriction :
                    Bool
                | MultiParamTypeClasses :
                    Bool
                | MultiWayIf :
                    Bool
                | NPlusKPatterns :
                    Bool
                | NamedFieldPuns :
                    Bool
                | NamedWildCards :
                    Bool
                | NegativeLiterals :
                    Bool
                | NewQualifiedOperators :
                    Bool
                | NondecreasingIndentation :
                    Bool
                | NullaryTypeClasses :
                    Bool
                | NumDecimals :
                    Bool
                | OverlappingInstances :
                    Bool
                | OverloadedLabels :
                    Bool
                | OverloadedLists :
                    Bool
                | OverloadedStrings :
                    Bool
                | PackageImports :
                    Bool
                | ParallelArrays :
                    Bool
                | ParallelListComp :
                    Bool
                | PartialTypeSignatures :
                    Bool
                | PatternGuards :
                    Bool
                | PatternSignatures :
                    Bool
                | PatternSynonyms :
                    Bool
                | PolyKinds :
                    Bool
                | PolymorphicComponents :
                    Bool
                | PostfixOperators :
                    Bool
                | QuasiQuotes :
                    Bool
                | Rank2Types :
                    Bool
                | RankNTypes :
                    Bool
                | RebindableSyntax :
                    Bool
                | RecordPuns :
                    Bool
                | RecordWildCards :
                    Bool
                | RecursiveDo :
                    Bool
                | RegularPatterns :
                    Bool
                | RelaxedPolyRec :
                    Bool
                | RestrictedTypeSynonyms :
                    Bool
                | RoleAnnotations :
                    Bool
                | Safe :
                    Bool
                | SafeImports :
                    Bool
                | ScopedTypeVariables :
                    Bool
                | StandaloneDeriving :
                    Bool
                | StaticPointers :
                    Bool
                | Strict :
                    Bool
                | StrictData :
                    Bool
                | TemplateHaskell :
                    Bool
                | TemplateHaskellQuotes :
                    Bool
                | TraditionalRecordSyntax :
                    Bool
                | TransformListComp :
                    Bool
                | Trustworthy :
                    Bool
                | TupleSections :
                    Bool
                | TypeApplications :
                    Bool
                | TypeFamilies :
                    Bool
                | TypeFamilyDependencies :
                    Bool
                | TypeInType :
                    Bool
                | TypeOperators :
                    Bool
                | TypeSynonymInstances :
                    Bool
                | UnboxedTuples :
                    Bool
                | UndecidableInstances :
                    Bool
                | UndecidableSuperClasses :
                    Bool
                | UnicodeSyntax :
                    Bool
                | UnliftedFFITypes :
                    Bool
                | Unsafe :
                    Bool
                | ViewPatterns :
                    Bool
                | XmlSyntax :
                    Bool
                >
            , default-language :
                Optional
                < Haskell2010 :
                    {}
                | Haskell98 :
                    {}
                | UnknownLanguage :
                    { _1 : Text }
                >
            , exposed-modules :
                List Text
            , extra-framework-dirs :
                List Text
            , extra-ghci-libraries :
                List Text
            , extra-lib-dirs :
                List Text
            , extra-libraries :
                List Text
            , frameworks :
                List Text
            , hs-source-dirs :
                List Text
            , include-dirs :
                List Text
            , includes :
                List Text
            , install-includes :
                List Text
            , js-sources :
                List Text
            , ld-options :
                List Text
            , mixins :
                List
                { package :
                    Text
                , renaming :
                    { provides :
                        List { rename : Text, to : Text }
                    , requires :
                        List { rename : Text, to : Text }
                    }
                }
            , other-extensions :
                List
                < AllowAmbiguousTypes :
                    Bool
                | ApplicativeDo :
                    Bool
                | Arrows :
                    Bool
                | AutoDeriveTypeable :
                    Bool
                | BangPatterns :
                    Bool
                | BinaryLiterals :
                    Bool
                | CApiFFI :
                    Bool
                | CPP :
                    Bool
                | ConstrainedClassMethods :
                    Bool
                | ConstraintKinds :
                    Bool
                | DataKinds :
                    Bool
                | DatatypeContexts :
                    Bool
                | DefaultSignatures :
                    Bool
                | DeriveAnyClass :
                    Bool
                | DeriveDataTypeable :
                    Bool
                | DeriveFoldable :
                    Bool
                | DeriveFunctor :
                    Bool
                | DeriveGeneric :
                    Bool
                | DeriveLift :
                    Bool
                | DeriveTraversable :
                    Bool
                | DisambiguateRecordFields :
                    Bool
                | DoAndIfThenElse :
                    Bool
                | DoRec :
                    Bool
                | DuplicateRecordFields :
                    Bool
                | EmptyCase :
                    Bool
                | EmptyDataDecls :
                    Bool
                | ExistentialQuantification :
                    Bool
                | ExplicitForAll :
                    Bool
                | ExplicitNamespaces :
                    Bool
                | ExtendedDefaultRules :
                    Bool
                | ExtensibleRecords :
                    Bool
                | FlexibleContexts :
                    Bool
                | FlexibleInstances :
                    Bool
                | ForeignFunctionInterface :
                    Bool
                | FunctionalDependencies :
                    Bool
                | GADTSyntax :
                    Bool
                | GADTs :
                    Bool
                | GHCForeignImportPrim :
                    Bool
                | GeneralizedNewtypeDeriving :
                    Bool
                | Generics :
                    Bool
                | HereDocuments :
                    Bool
                | ImplicitParams :
                    Bool
                | ImplicitPrelude :
                    Bool
                | ImpredicativeTypes :
                    Bool
                | IncoherentInstances :
                    Bool
                | InstanceSigs :
                    Bool
                | InterruptibleFFI :
                    Bool
                | JavaScriptFFI :
                    Bool
                | KindSignatures :
                    Bool
                | LambdaCase :
                    Bool
                | LiberalTypeSynonyms :
                    Bool
                | MagicHash :
                    Bool
                | MonadComprehensions :
                    Bool
                | MonadFailDesugaring :
                    Bool
                | MonoLocalBinds :
                    Bool
                | MonoPatBinds :
                    Bool
                | MonomorphismRestriction :
                    Bool
                | MultiParamTypeClasses :
                    Bool
                | MultiWayIf :
                    Bool
                | NPlusKPatterns :
                    Bool
                | NamedFieldPuns :
                    Bool
                | NamedWildCards :
                    Bool
                | NegativeLiterals :
                    Bool
                | NewQualifiedOperators :
                    Bool
                | NondecreasingIndentation :
                    Bool
                | NullaryTypeClasses :
                    Bool
                | NumDecimals :
                    Bool
                | OverlappingInstances :
                    Bool
                | OverloadedLabels :
                    Bool
                | OverloadedLists :
                    Bool
                | OverloadedStrings :
                    Bool
                | PackageImports :
                    Bool
                | ParallelArrays :
                    Bool
                | ParallelListComp :
                    Bool
                | PartialTypeSignatures :
                    Bool
                | PatternGuards :
                    Bool
                | PatternSignatures :
                    Bool
                | PatternSynonyms :
                    Bool
                | PolyKinds :
                    Bool
                | PolymorphicComponents :
                    Bool
                | PostfixOperators :
                    Bool
                | QuasiQuotes :
                    Bool
                | Rank2Types :
                    Bool
                | RankNTypes :
                    Bool
                | RebindableSyntax :
                    Bool
                | RecordPuns :
                    Bool
                | RecordWildCards :
                    Bool
                | RecursiveDo :
                    Bool
                | RegularPatterns :
                    Bool
                | RelaxedPolyRec :
                    Bool
                | RestrictedTypeSynonyms :
                    Bool
                | RoleAnnotations :
                    Bool
                | Safe :
                    Bool
                | SafeImports :
                    Bool
                | ScopedTypeVariables :
                    Bool
                | StandaloneDeriving :
                    Bool
                | StaticPointers :
                    Bool
                | Strict :
                    Bool
                | StrictData :
                    Bool
                | TemplateHaskell :
                    Bool
                | TemplateHaskellQuotes :
                    Bool
                | TraditionalRecordSyntax :
                    Bool
                | TransformListComp :
                    Bool
                | Trustworthy :
                    Bool
                | TupleSections :
                    Bool
                | TypeApplications :
                    Bool
                | TypeFamilies :
                    Bool
                | TypeFamilyDependencies :
                    Bool
                | TypeInType :
                    Bool
                | TypeOperators :
                    Bool
                | TypeSynonymInstances :
                    Bool
                | UnboxedTuples :
                    Bool
                | UndecidableInstances :
                    Bool
                | UndecidableSuperClasses :
                    Bool
                | UnicodeSyntax :
                    Bool
                | UnliftedFFITypes :
                    Bool
                | Unsafe :
                    Bool
                | ViewPatterns :
                    Bool
                | XmlSyntax :
                    Bool
                >
            , other-languages :
                List
                < Haskell2010 :
                    {}
                | Haskell98 :
                    {}
                | UnknownLanguage :
                    { _1 : Text }
                >
            , other-modules :
                List Text
            , pkgconfig-depends :
                List { name : Text, version : VersionRange }
            , profiling-options :
                { GHC :
                    List Text
                , GHCJS :
                    List Text
                , HBC :
                    List Text
                , Helium :
                    List Text
                , Hugs :
                    List Text
                , JHC :
                    List Text
                , LHC :
                    List Text
                , NHC :
                    List Text
                , UHC :
                    List Text
                , YHC :
                    List Text
                }
            , reexported-modules :
                List
                { name :
                    Text
                , original :
                    { name : Text, package : Optional Text }
                }
            , shared-options :
                { GHC :
                    List Text
                , GHCJS :
                    List Text
                , HBC :
                    List Text
                , Helium :
                    List Text
                , Hugs :
                    List Text
                , JHC :
                    List Text
                , LHC :
                    List Text
                , NHC :
                    List Text
                , UHC :
                    List Text
                , YHC :
                    List Text
                }
            , signatures :
                List Text
            }
        , guard :
              { arch :
                    < Alpha :
                        {}
                    | Arm :
                        {}
                    | Hppa :
                        {}
                    | I386 :
                        {}
                    | IA64 :
                        {}
                    | JavaScript :
                        {}
                    | M68k :
                        {}
                    | Mips :
                        {}
                    | OtherArch :
                        { _1 : Text }
                    | PPC :
                        {}
                    | PPC64 :
                        {}
                    | Rs6000 :
                        {}
                    | S390 :
                        {}
                    | SH :
                        {}
                    | Sparc :
                        {}
                    | Vax :
                        {}
                    | X86_64 :
                        {}
                    >
                  → Bool
              , flag :
                  Text → Bool
              , impl :
                    < GHC :
                        {}
                    | GHCJS :
                        {}
                    | HBC :
                        {}
                    | HaskellSuite :
                        { _1 : Text }
                    | Helium :
                        {}
                    | Hugs :
                        {}
                    | JHC :
                        {}
                    | LHC :
                        {}
                    | NHC :
                        {}
                    | OtherCompiler :
                        { _1 : Text }
                    | UHC :
                        {}
                    | YHC :
                        {}
                    >
                  → VersionRange
                  → Bool
              , os :
                    < AIX :
                        {}
                    | Android :
                        {}
                    | DragonFly :
                        {}
                    | FreeBSD :
                        {}
                    | Ghcjs :
                        {}
                    | HPUX :
                        {}
                    | HaLVM :
                        {}
                    | Hurd :
                        {}
                    | IOS :
                        {}
                    | IRIX :
                        {}
                    | Linux :
                        {}
                    | NetBSD :
                        {}
                    | OSX :
                        {}
                    | OpenBSD :
                        {}
                    | OtherOS :
                        { _1 : Text }
                    | Solaris :
                        {}
                    | Windows :
                        {}
                    >
                  → Bool
              }
            → Bool
        }
    , name :
        Text
    }
, synopsis :
    Text
, test-suites :
    List
    { name :
        Text
    , test-suite :
        List
        { body :
            { autogen-modules :
                List Text
            , build-depends :
                List { bounds : VersionRange, package : Text }
            , build-tool-depends :
                List
                { component : Text, package : Text, version : VersionRange }
            , build-tools :
                List { exe : Text, version : VersionRange }
            , buildable :
                Bool
            , c-sources :
                List Text
            , cc-options :
                List Text
            , compiler-options :
                { GHC :
                    List Text
                , GHCJS :
                    List Text
                , HBC :
                    List Text
                , Helium :
                    List Text
                , Hugs :
                    List Text
                , JHC :
                    List Text
                , LHC :
                    List Text
                , NHC :
                    List Text
                , UHC :
                    List Text
                , YHC :
                    List Text
                }
            , cpp-options :
                List Text
            , default-extensions :
                List
                < AllowAmbiguousTypes :
                    Bool
                | ApplicativeDo :
                    Bool
                | Arrows :
                    Bool
                | AutoDeriveTypeable :
                    Bool
                | BangPatterns :
                    Bool
                | BinaryLiterals :
                    Bool
                | CApiFFI :
                    Bool
                | CPP :
                    Bool
                | ConstrainedClassMethods :
                    Bool
                | ConstraintKinds :
                    Bool
                | DataKinds :
                    Bool
                | DatatypeContexts :
                    Bool
                | DefaultSignatures :
                    Bool
                | DeriveAnyClass :
                    Bool
                | DeriveDataTypeable :
                    Bool
                | DeriveFoldable :
                    Bool
                | DeriveFunctor :
                    Bool
                | DeriveGeneric :
                    Bool
                | DeriveLift :
                    Bool
                | DeriveTraversable :
                    Bool
                | DisambiguateRecordFields :
                    Bool
                | DoAndIfThenElse :
                    Bool
                | DoRec :
                    Bool
                | DuplicateRecordFields :
                    Bool
                | EmptyCase :
                    Bool
                | EmptyDataDecls :
                    Bool
                | ExistentialQuantification :
                    Bool
                | ExplicitForAll :
                    Bool
                | ExplicitNamespaces :
                    Bool
                | ExtendedDefaultRules :
                    Bool
                | ExtensibleRecords :
                    Bool
                | FlexibleContexts :
                    Bool
                | FlexibleInstances :
                    Bool
                | ForeignFunctionInterface :
                    Bool
                | FunctionalDependencies :
                    Bool
                | GADTSyntax :
                    Bool
                | GADTs :
                    Bool
                | GHCForeignImportPrim :
                    Bool
                | GeneralizedNewtypeDeriving :
                    Bool
                | Generics :
                    Bool
                | HereDocuments :
                    Bool
                | ImplicitParams :
                    Bool
                | ImplicitPrelude :
                    Bool
                | ImpredicativeTypes :
                    Bool
                | IncoherentInstances :
                    Bool
                | InstanceSigs :
                    Bool
                | InterruptibleFFI :
                    Bool
                | JavaScriptFFI :
                    Bool
                | KindSignatures :
                    Bool
                | LambdaCase :
                    Bool
                | LiberalTypeSynonyms :
                    Bool
                | MagicHash :
                    Bool
                | MonadComprehensions :
                    Bool
                | MonadFailDesugaring :
                    Bool
                | MonoLocalBinds :
                    Bool
                | MonoPatBinds :
                    Bool
                | MonomorphismRestriction :
                    Bool
                | MultiParamTypeClasses :
                    Bool
                | MultiWayIf :
                    Bool
                | NPlusKPatterns :
                    Bool
                | NamedFieldPuns :
                    Bool
                | NamedWildCards :
                    Bool
                | NegativeLiterals :
                    Bool
                | NewQualifiedOperators :
                    Bool
                | NondecreasingIndentation :
                    Bool
                | NullaryTypeClasses :
                    Bool
                | NumDecimals :
                    Bool
                | OverlappingInstances :
                    Bool
                | OverloadedLabels :
                    Bool
                | OverloadedLists :
                    Bool
                | OverloadedStrings :
                    Bool
                | PackageImports :
                    Bool
                | ParallelArrays :
                    Bool
                | ParallelListComp :
                    Bool
                | PartialTypeSignatures :
                    Bool
                | PatternGuards :
                    Bool
                | PatternSignatures :
                    Bool
                | PatternSynonyms :
                    Bool
                | PolyKinds :
                    Bool
                | PolymorphicComponents :
                    Bool
                | PostfixOperators :
                    Bool
                | QuasiQuotes :
                    Bool
                | Rank2Types :
                    Bool
                | RankNTypes :
                    Bool
                | RebindableSyntax :
                    Bool
                | RecordPuns :
                    Bool
                | RecordWildCards :
                    Bool
                | RecursiveDo :
                    Bool
                | RegularPatterns :
                    Bool
                | RelaxedPolyRec :
                    Bool
                | RestrictedTypeSynonyms :
                    Bool
                | RoleAnnotations :
                    Bool
                | Safe :
                    Bool
                | SafeImports :
                    Bool
                | ScopedTypeVariables :
                    Bool
                | StandaloneDeriving :
                    Bool
                | StaticPointers :
                    Bool
                | Strict :
                    Bool
                | StrictData :
                    Bool
                | TemplateHaskell :
                    Bool
                | TemplateHaskellQuotes :
                    Bool
                | TraditionalRecordSyntax :
                    Bool
                | TransformListComp :
                    Bool
                | Trustworthy :
                    Bool
                | TupleSections :
                    Bool
                | TypeApplications :
                    Bool
                | TypeFamilies :
                    Bool
                | TypeFamilyDependencies :
                    Bool
                | TypeInType :
                    Bool
                | TypeOperators :
                    Bool
                | TypeSynonymInstances :
                    Bool
                | UnboxedTuples :
                    Bool
                | UndecidableInstances :
                    Bool
                | UndecidableSuperClasses :
                    Bool
                | UnicodeSyntax :
                    Bool
                | UnliftedFFITypes :
                    Bool
                | Unsafe :
                    Bool
                | ViewPatterns :
                    Bool
                | XmlSyntax :
                    Bool
                >
            , default-language :
                Optional
                < Haskell2010 :
                    {}
                | Haskell98 :
                    {}
                | UnknownLanguage :
                    { _1 : Text }
                >
            , extra-framework-dirs :
                List Text
            , extra-ghci-libraries :
                List Text
            , extra-lib-dirs :
                List Text
            , extra-libraries :
                List Text
            , frameworks :
                List Text
            , hs-source-dirs :
                List Text
            , include-dirs :
                List Text
            , includes :
                List Text
            , install-includes :
                List Text
            , js-sources :
                List Text
            , ld-options :
                List Text
            , main-is :
                Text
            , mixins :
                List
                { package :
                    Text
                , renaming :
                    { provides :
                        List { rename : Text, to : Text }
                    , requires :
                        List { rename : Text, to : Text }
                    }
                }
            , other-extensions :
                List
                < AllowAmbiguousTypes :
                    Bool
                | ApplicativeDo :
                    Bool
                | Arrows :
                    Bool
                | AutoDeriveTypeable :
                    Bool
                | BangPatterns :
                    Bool
                | BinaryLiterals :
                    Bool
                | CApiFFI :
                    Bool
                | CPP :
                    Bool
                | ConstrainedClassMethods :
                    Bool
                | ConstraintKinds :
                    Bool
                | DataKinds :
                    Bool
                | DatatypeContexts :
                    Bool
                | DefaultSignatures :
                    Bool
                | DeriveAnyClass :
                    Bool
                | DeriveDataTypeable :
                    Bool
                | DeriveFoldable :
                    Bool
                | DeriveFunctor :
                    Bool
                | DeriveGeneric :
                    Bool
                | DeriveLift :
                    Bool
                | DeriveTraversable :
                    Bool
                | DisambiguateRecordFields :
                    Bool
                | DoAndIfThenElse :
                    Bool
                | DoRec :
                    Bool
                | DuplicateRecordFields :
                    Bool
                | EmptyCase :
                    Bool
                | EmptyDataDecls :
                    Bool
                | ExistentialQuantification :
                    Bool
                | ExplicitForAll :
                    Bool
                | ExplicitNamespaces :
                    Bool
                | ExtendedDefaultRules :
                    Bool
                | ExtensibleRecords :
                    Bool
                | FlexibleContexts :
                    Bool
                | FlexibleInstances :
                    Bool
                | ForeignFunctionInterface :
                    Bool
                | FunctionalDependencies :
                    Bool
                | GADTSyntax :
                    Bool
                | GADTs :
                    Bool
                | GHCForeignImportPrim :
                    Bool
                | GeneralizedNewtypeDeriving :
                    Bool
                | Generics :
                    Bool
                | HereDocuments :
                    Bool
                | ImplicitParams :
                    Bool
                | ImplicitPrelude :
                    Bool
                | ImpredicativeTypes :
                    Bool
                | IncoherentInstances :
                    Bool
                | InstanceSigs :
                    Bool
                | InterruptibleFFI :
                    Bool
                | JavaScriptFFI :
                    Bool
                | KindSignatures :
                    Bool
                | LambdaCase :
                    Bool
                | LiberalTypeSynonyms :
                    Bool
                | MagicHash :
                    Bool
                | MonadComprehensions :
                    Bool
                | MonadFailDesugaring :
                    Bool
                | MonoLocalBinds :
                    Bool
                | MonoPatBinds :
                    Bool
                | MonomorphismRestriction :
                    Bool
                | MultiParamTypeClasses :
                    Bool
                | MultiWayIf :
                    Bool
                | NPlusKPatterns :
                    Bool
                | NamedFieldPuns :
                    Bool
                | NamedWildCards :
                    Bool
                | NegativeLiterals :
                    Bool
                | NewQualifiedOperators :
                    Bool
                | NondecreasingIndentation :
                    Bool
                | NullaryTypeClasses :
                    Bool
                | NumDecimals :
                    Bool
                | OverlappingInstances :
                    Bool
                | OverloadedLabels :
                    Bool
                | OverloadedLists :
                    Bool
                | OverloadedStrings :
                    Bool
                | PackageImports :
                    Bool
                | ParallelArrays :
                    Bool
                | ParallelListComp :
                    Bool
                | PartialTypeSignatures :
                    Bool
                | PatternGuards :
                    Bool
                | PatternSignatures :
                    Bool
                | PatternSynonyms :
                    Bool
                | PolyKinds :
                    Bool
                | PolymorphicComponents :
                    Bool
                | PostfixOperators :
                    Bool
                | QuasiQuotes :
                    Bool
                | Rank2Types :
                    Bool
                | RankNTypes :
                    Bool
                | RebindableSyntax :
                    Bool
                | RecordPuns :
                    Bool
                | RecordWildCards :
                    Bool
                | RecursiveDo :
                    Bool
                | RegularPatterns :
                    Bool
                | RelaxedPolyRec :
                    Bool
                | RestrictedTypeSynonyms :
                    Bool
                | RoleAnnotations :
                    Bool
                | Safe :
                    Bool
                | SafeImports :
                    Bool
                | ScopedTypeVariables :
                    Bool
                | StandaloneDeriving :
                    Bool
                | StaticPointers :
                    Bool
                | Strict :
                    Bool
                | StrictData :
                    Bool
                | TemplateHaskell :
                    Bool
                | TemplateHaskellQuotes :
                    Bool
                | TraditionalRecordSyntax :
                    Bool
                | TransformListComp :
                    Bool
                | Trustworthy :
                    Bool
                | TupleSections :
                    Bool
                | TypeApplications :
                    Bool
                | TypeFamilies :
                    Bool
                | TypeFamilyDependencies :
                    Bool
                | TypeInType :
                    Bool
                | TypeOperators :
                    Bool
                | TypeSynonymInstances :
                    Bool
                | UnboxedTuples :
                    Bool
                | UndecidableInstances :
                    Bool
                | UndecidableSuperClasses :
                    Bool
                | UnicodeSyntax :
                    Bool
                | UnliftedFFITypes :
                    Bool
                | Unsafe :
                    Bool
                | ViewPatterns :
                    Bool
                | XmlSyntax :
                    Bool
                >
            , other-languages :
                List
                < Haskell2010 :
                    {}
                | Haskell98 :
                    {}
                | UnknownLanguage :
                    { _1 : Text }
                >
            , other-modules :
                List Text
            , pkgconfig-depends :
                List { name : Text, version : VersionRange }
            , profiling-options :
                { GHC :
                    List Text
                , GHCJS :
                    List Text
                , HBC :
                    List Text
                , Helium :
                    List Text
                , Hugs :
                    List Text
                , JHC :
                    List Text
                , LHC :
                    List Text
                , NHC :
                    List Text
                , UHC :
                    List Text
                , YHC :
                    List Text
                }
            , shared-options :
                { GHC :
                    List Text
                , GHCJS :
                    List Text
                , HBC :
                    List Text
                , Helium :
                    List Text
                , Hugs :
                    List Text
                , JHC :
                    List Text
                , LHC :
                    List Text
                , NHC :
                    List Text
                , UHC :
                    List Text
                , YHC :
                    List Text
                }
            }
        , guard :
              { arch :
                    < Alpha :
                        {}
                    | Arm :
                        {}
                    | Hppa :
                        {}
                    | I386 :
                        {}
                    | IA64 :
                        {}
                    | JavaScript :
                        {}
                    | M68k :
                        {}
                    | Mips :
                        {}
                    | OtherArch :
                        { _1 : Text }
                    | PPC :
                        {}
                    | PPC64 :
                        {}
                    | Rs6000 :
                        {}
                    | S390 :
                        {}
                    | SH :
                        {}
                    | Sparc :
                        {}
                    | Vax :
                        {}
                    | X86_64 :
                        {}
                    >
                  → Bool
              , flag :
                  Text → Bool
              , impl :
                    < GHC :
                        {}
                    | GHCJS :
                        {}
                    | HBC :
                        {}
                    | HaskellSuite :
                        { _1 : Text }
                    | Helium :
                        {}
                    | Hugs :
                        {}
                    | JHC :
                        {}
                    | LHC :
                        {}
                    | NHC :
                        {}
                    | OtherCompiler :
                        { _1 : Text }
                    | UHC :
                        {}
                    | YHC :
                        {}
                    >
                  → VersionRange
                  → Bool
              , os :
                    < AIX :
                        {}
                    | Android :
                        {}
                    | DragonFly :
                        {}
                    | FreeBSD :
                        {}
                    | Ghcjs :
                        {}
                    | HPUX :
                        {}
                    | HaLVM :
                        {}
                    | Hurd :
                        {}
                    | IOS :
                        {}
                    | IRIX :
                        {}
                    | Linux :
                        {}
                    | NetBSD :
                        {}
                    | OSX :
                        {}
                    | OpenBSD :
                        {}
                    | OtherOS :
                        { _1 : Text }
                    | Solaris :
                        {}
                    | Windows :
                        {}
                    >
                  → Bool
              }
            → Bool
        }
    }
, tested-with :
    List
    { compiler :
        < GHC :
            {}
        | GHCJS :
            {}
        | HBC :
            {}
        | HaskellSuite :
            { _1 : Text }
        | Helium :
            {}
        | Hugs :
            {}
        | JHC :
            {}
        | LHC :
            {}
        | NHC :
            {}
        | OtherCompiler :
            { _1 : Text }
        | UHC :
            {}
        | YHC :
            {}
        >
    , version :
        VersionRange
    }
, version :
    List Natural
, x-fields :
    List { _1 : Text, _2 : Text }
}
Gabriella439 commented 6 years ago

I still think there should be some way for the user to obtain the formatted schema from the command line, otherwise they will have to play guess and check with the tool

ocharles commented 6 years ago

But considering the above, I don't see how that is remotely useful. I'm interested in having granular error reporting so mistakes are localised, but just dumping out the whole type is far too big.

Gabriella439 commented 6 years ago

I think being able to access that type, even if it is large, is still very useful. Asking the users to first make a mistake or enter a bogus expression before you display any help is a poor user experience. That would be like having a command-line executable that didn't provide a --help flag and only displayed help output if you made a mistake.

ocharles commented 6 years ago

Dumping out a 4000 line type is not a good experience, nor something I would expect anyone to do. Instead, like any other project, I would expect them to learn the tool in tandem with documentation.

There should be help, but it should be in the form of

A Cabal package is a record of the following type:

{ name : Text
, author : Text
, library : Library
, -- etc
}

A Library is a record with the following type:

{
  build-depends : List Dependency
}

And so on. This is akin to info or man pages, and is what will ultimately be published as HTML documentation. This is to be combined with https://github.com/dhall-lang/dhall-haskell/issues/207, which is almost a requirement for dhall-to-cabal to usable - it's really painful right now if you make a mistake!

It could be provided as dhall-to-cabal --help Library to describe individual types.

I don't think I have the motivation to get all of that done before having a single user though, so I don't want to block 1.0 on it. I will have public documentation written for 1.0 though in the form of Read the Docs.

Gabriella439 commented 6 years ago

I don't see what is the downside of providing the type. Even when you provide something like info or man pages some users will still want the raw schema because it's the most compact and concise documentation of what to do. Or to continue the analogy, just because there is a man page doesn't mean there shouldn't be a --help flag

ocharles commented 6 years ago

Alright, I'll add --type (or something), but I don't want to take the name --help with this just yet.

Gabriella439 commented 6 years ago

Yeah, I agree that this should be separate from the --help flag

ocharles commented 6 years ago

Ok, I added --print-type which I think addresses that request.

What else should be considered for 1.0?

Gabriella439 commented 6 years ago

Some other things that I usually do for 1.0 releases:

You don't have to do these, but they're nice to have

I'm also going to try using dhall-to-cabal for dhall-haskell later tonight

ocharles commented 6 years ago

A tutorial I probably won't do, but I do plan to do a blog post and have a home page. I'm more wondering about functionality of the tool itself. I think it's baked enough to warrant a release now.

I'm also going to try using dhall-to-cabal for dhall-haskell later tonight

That'd be great - you'll find a good starting point in the golden-tests folder of this repository.

Gabriella439 commented 6 years ago

Yeah, I think this is good for a 1.0 release

Gabriella439 commented 6 years ago

So I'm going through the process right now and here are my rough notes:

ocharles commented 6 years ago

For the latter, you need dhall HEAD (I will update shell.nix, I have local changes that I never got round to commiting as I have a local dhall checkout).

The others are great points, thanks!

ocharles commented 6 years ago

Ok, I just had some fun improving --print-type. It now does some sub-expression lifting to factor out a bunch of common types. You can also give the name of any let-bound variable in the result of --print-type to just get documentation for that type. For example,

dhall-to-cabal --print-type RepoType
    let RepoType =
          < Bazaar :
              {}
          | CVS :
              {}
          | Darcs :
              {}
          | Git :
              {}
          | GnuArch :
              {}
          | Mercurial :
              {}
          | Monotone :
              {}
          | OtherRepoType :
              { _1 : Text }
          | SVN :
              {}
          >

in  RepoType

Here is the new full type:

    let BuildType =
          < Configure :
              {}
          | Custom :
              {}
          | Make :
              {}
          | Simple :
              {}
          | UnknownBuildType :
              { _1 : Text }
          >

in  let License =
          < AGPL :
              Optional (List Natural)
          | AllRightsReserved :
              {}
          | Apache :
              Optional (List Natural)
          | BSD2 :
              {}
          | BSD3 :
              {}
          | BSD4 :
              {}
          | GPL :
              Optional (List Natural)
          | ISC :
              {}
          | LGPL :
              Optional (List Natural)
          | MIT :
              {}
          | MPL :
              List Natural
          | Other :
              {}
          | PublicDomain :
              {}
          | Unspecified :
              {}
          >

in  let Language =
          < Haskell2010 :
              {}
          | Haskell98 :
              {}
          | UnknownLanguage :
              { _1 : Text }
          >

in  let Arch =
          < Alpha :
              {}
          | Arm :
              {}
          | Hppa :
              {}
          | I386 :
              {}
          | IA64 :
              {}
          | JavaScript :
              {}
          | M68k :
              {}
          | Mips :
              {}
          | OtherArch :
              { _1 : Text }
          | PPC :
              {}
          | PPC64 :
              {}
          | Rs6000 :
              {}
          | S390 :
              {}
          | SH :
              {}
          | Sparc :
              {}
          | Vax :
              {}
          | X86_64 :
              {}
          >

in  let CompilerFlavor =
          < GHC :
              {}
          | GHCJS :
              {}
          | HBC :
              {}
          | HaskellSuite :
              { _1 : Text }
          | Helium :
              {}
          | Hugs :
              {}
          | JHC :
              {}
          | LHC :
              {}
          | NHC :
              {}
          | OtherCompiler :
              { _1 : Text }
          | UHC :
              {}
          | YHC :
              {}
          >

in  let CompilerOptions =
          { GHC :
              List Text
          , GHCJS :
              List Text
          , HBC :
              List Text
          , Helium :
              List Text
          , Hugs :
              List Text
          , JHC :
              List Text
          , LHC :
              List Text
          , NHC :
              List Text
          , UHC :
              List Text
          , YHC :
              List Text
          }

in  let Extension =
          < AllowAmbiguousTypes :
              Bool
          | ApplicativeDo :
              Bool
          | Arrows :
              Bool
          | AutoDeriveTypeable :
              Bool
          | BangPatterns :
              Bool
          | BinaryLiterals :
              Bool
          | CApiFFI :
              Bool
          | CPP :
              Bool
          | ConstrainedClassMethods :
              Bool
          | ConstraintKinds :
              Bool
          | DataKinds :
              Bool
          | DatatypeContexts :
              Bool
          | DefaultSignatures :
              Bool
          | DeriveAnyClass :
              Bool
          | DeriveDataTypeable :
              Bool
          | DeriveFoldable :
              Bool
          | DeriveFunctor :
              Bool
          | DeriveGeneric :
              Bool
          | DeriveLift :
              Bool
          | DeriveTraversable :
              Bool
          | DisambiguateRecordFields :
              Bool
          | DoAndIfThenElse :
              Bool
          | DoRec :
              Bool
          | DuplicateRecordFields :
              Bool
          | EmptyCase :
              Bool
          | EmptyDataDecls :
              Bool
          | ExistentialQuantification :
              Bool
          | ExplicitForAll :
              Bool
          | ExplicitNamespaces :
              Bool
          | ExtendedDefaultRules :
              Bool
          | ExtensibleRecords :
              Bool
          | FlexibleContexts :
              Bool
          | FlexibleInstances :
              Bool
          | ForeignFunctionInterface :
              Bool
          | FunctionalDependencies :
              Bool
          | GADTSyntax :
              Bool
          | GADTs :
              Bool
          | GHCForeignImportPrim :
              Bool
          | GeneralizedNewtypeDeriving :
              Bool
          | Generics :
              Bool
          | HereDocuments :
              Bool
          | ImplicitParams :
              Bool
          | ImplicitPrelude :
              Bool
          | ImpredicativeTypes :
              Bool
          | IncoherentInstances :
              Bool
          | InstanceSigs :
              Bool
          | InterruptibleFFI :
              Bool
          | JavaScriptFFI :
              Bool
          | KindSignatures :
              Bool
          | LambdaCase :
              Bool
          | LiberalTypeSynonyms :
              Bool
          | MagicHash :
              Bool
          | MonadComprehensions :
              Bool
          | MonadFailDesugaring :
              Bool
          | MonoLocalBinds :
              Bool
          | MonoPatBinds :
              Bool
          | MonomorphismRestriction :
              Bool
          | MultiParamTypeClasses :
              Bool
          | MultiWayIf :
              Bool
          | NPlusKPatterns :
              Bool
          | NamedFieldPuns :
              Bool
          | NamedWildCards :
              Bool
          | NegativeLiterals :
              Bool
          | NewQualifiedOperators :
              Bool
          | NondecreasingIndentation :
              Bool
          | NullaryTypeClasses :
              Bool
          | NumDecimals :
              Bool
          | OverlappingInstances :
              Bool
          | OverloadedLabels :
              Bool
          | OverloadedLists :
              Bool
          | OverloadedStrings :
              Bool
          | PackageImports :
              Bool
          | ParallelArrays :
              Bool
          | ParallelListComp :
              Bool
          | PartialTypeSignatures :
              Bool
          | PatternGuards :
              Bool
          | PatternSignatures :
              Bool
          | PatternSynonyms :
              Bool
          | PolyKinds :
              Bool
          | PolymorphicComponents :
              Bool
          | PostfixOperators :
              Bool
          | QuasiQuotes :
              Bool
          | Rank2Types :
              Bool
          | RankNTypes :
              Bool
          | RebindableSyntax :
              Bool
          | RecordPuns :
              Bool
          | RecordWildCards :
              Bool
          | RecursiveDo :
              Bool
          | RegularPatterns :
              Bool
          | RelaxedPolyRec :
              Bool
          | RestrictedTypeSynonyms :
              Bool
          | RoleAnnotations :
              Bool
          | Safe :
              Bool
          | SafeImports :
              Bool
          | ScopedTypeVariables :
              Bool
          | StandaloneDeriving :
              Bool
          | StaticPointers :
              Bool
          | Strict :
              Bool
          | StrictData :
              Bool
          | TemplateHaskell :
              Bool
          | TemplateHaskellQuotes :
              Bool
          | TraditionalRecordSyntax :
              Bool
          | TransformListComp :
              Bool
          | Trustworthy :
              Bool
          | TupleSections :
              Bool
          | TypeApplications :
              Bool
          | TypeFamilies :
              Bool
          | TypeFamilyDependencies :
              Bool
          | TypeInType :
              Bool
          | TypeOperators :
              Bool
          | TypeSynonymInstances :
              Bool
          | UnboxedTuples :
              Bool
          | UndecidableInstances :
              Bool
          | UndecidableSuperClasses :
              Bool
          | UnicodeSyntax :
              Bool
          | UnliftedFFITypes :
              Bool
          | Unsafe :
              Bool
          | ViewPatterns :
              Bool
          | XmlSyntax :
              Bool
          >

in  let OS =
          < AIX :
              {}
          | Android :
              {}
          | DragonFly :
              {}
          | FreeBSD :
              {}
          | Ghcjs :
              {}
          | HPUX :
              {}
          | HaLVM :
              {}
          | Hurd :
              {}
          | IOS :
              {}
          | IRIX :
              {}
          | Linux :
              {}
          | NetBSD :
              {}
          | OSX :
              {}
          | OpenBSD :
              {}
          | OtherOS :
              { _1 : Text }
          | Solaris :
              {}
          | Windows :
              {}
          >

in  let Compiler = { compiler : CompilerFlavor, version : VersionRange }

in  let RepoKind =
          < RepoHead : {} | RepoKindUnknown : { _1 : Text } | RepoThis : {} >

in  let RepoType =
          < Bazaar :
              {}
          | CVS :
              {}
          | Darcs :
              {}
          | Git :
              {}
          | GnuArch :
              {}
          | Mercurial :
              {}
          | Monotone :
              {}
          | OtherRepoType :
              { _1 : Text }
          | SVN :
              {}
          >

in  let SourceRepo =
          { branch :
              Optional Text
          , kind :
              RepoKind
          , location :
              Optional Text
          , module :
              Optional Text
          , subdir :
              Optional Text
          , tag :
              Optional Text
          , type :
              Optional RepoType
          }

in  let TestSuite =
          { autogen-modules :
              List Text
          , build-depends :
              List { bounds : VersionRange, package : Text }
          , build-tool-depends :
              List { component : Text, package : Text, version : VersionRange }
          , build-tools :
              List { exe : Text, version : VersionRange }
          , buildable :
              Bool
          , c-sources :
              List Text
          , cc-options :
              List Text
          , compiler-options :
              CompilerOptions
          , cpp-options :
              List Text
          , default-extensions :
              List Extension
          , default-language :
              Optional Language
          , extra-framework-dirs :
              List Text
          , extra-ghci-libraries :
              List Text
          , extra-lib-dirs :
              List Text
          , extra-libraries :
              List Text
          , frameworks :
              List Text
          , hs-source-dirs :
              List Text
          , include-dirs :
              List Text
          , includes :
              List Text
          , install-includes :
              List Text
          , js-sources :
              List Text
          , ld-options :
              List Text
          , main-is :
              Text
          , mixins :
              List
              { package :
                  Text
              , renaming :
                  { provides :
                      List { rename : Text, to : Text }
                  , requires :
                      List { rename : Text, to : Text }
                  }
              }
          , other-extensions :
              List Extension
          , other-languages :
              List Language
          , other-modules :
              List Text
          , pkgconfig-depends :
              List { name : Text, version : VersionRange }
          , profiling-options :
              CompilerOptions
          , shared-options :
              CompilerOptions
          }

in  let Benchmark = TestSuite

in  let Executable =
          { autogen-modules :
              List Text
          , build-depends :
              List { bounds : VersionRange, package : Text }
          , build-tool-depends :
              List { component : Text, package : Text, version : VersionRange }
          , build-tools :
              List { exe : Text, version : VersionRange }
          , buildable :
              Bool
          , c-sources :
              List Text
          , cc-options :
              List Text
          , compiler-options :
              CompilerOptions
          , cpp-options :
              List Text
          , default-extensions :
              List Extension
          , default-language :
              Optional Language
          , extra-framework-dirs :
              List Text
          , extra-ghci-libraries :
              List Text
          , extra-lib-dirs :
              List Text
          , extra-libraries :
              List Text
          , frameworks :
              List Text
          , hs-source-dirs :
              List Text
          , include-dirs :
              List Text
          , includes :
              List Text
          , install-includes :
              List Text
          , js-sources :
              List Text
          , ld-options :
              List Text
          , main-is :
              Text
          , mixins :
              List
              { package :
                  Text
              , renaming :
                  { provides :
                      List { rename : Text, to : Text }
                  , requires :
                      List { rename : Text, to : Text }
                  }
              }
          , other-extensions :
              List Extension
          , other-languages :
              List Language
          , other-modules :
              List Text
          , pkgconfig-depends :
              List { name : Text, version : VersionRange }
          , profiling-options :
              CompilerOptions
          , scope :
              < Private : {} | Public : {} >
          , shared-options :
              CompilerOptions
          }

in  let ForeignLibrary =
          { autogen-modules :
              List Text
          , build-depends :
              List { bounds : VersionRange, package : Text }
          , build-tool-depends :
              List { component : Text, package : Text, version : VersionRange }
          , build-tools :
              List { exe : Text, version : VersionRange }
          , buildable :
              Bool
          , c-sources :
              List Text
          , cc-options :
              List Text
          , compiler-options :
              CompilerOptions
          , cpp-options :
              List Text
          , default-extensions :
              List Extension
          , default-language :
              Optional Language
          , extra-framework-dirs :
              List Text
          , extra-ghci-libraries :
              List Text
          , extra-lib-dirs :
              List Text
          , extra-libraries :
              List Text
          , frameworks :
              List Text
          , hs-source-dirs :
              List Text
          , include-dirs :
              List Text
          , includes :
              List Text
          , install-includes :
              List Text
          , js-sources :
              List Text
          , ld-options :
              List Text
          , lib-version-info :
              Optional { age : Natural, current : Natural, revision : Natural }
          , lib-version-linux :
              Optional (List Natural)
          , mixins :
              List
              { package :
                  Text
              , renaming :
                  { provides :
                      List { rename : Text, to : Text }
                  , requires :
                      List { rename : Text, to : Text }
                  }
              }
          , mod-def-files :
              List Text
          , options :
              List < Standalone : {} >
          , other-extensions :
              List Extension
          , other-languages :
              List Language
          , other-modules :
              List Text
          , pkgconfig-depends :
              List { name : Text, version : VersionRange }
          , profiling-options :
              CompilerOptions
          , shared-options :
              CompilerOptions
          , type :
              < Shared : {} | Static : {} >
          }

in  let Library =
          { autogen-modules :
              List Text
          , build-depends :
              List { bounds : VersionRange, package : Text }
          , build-tool-depends :
              List { component : Text, package : Text, version : VersionRange }
          , build-tools :
              List { exe : Text, version : VersionRange }
          , buildable :
              Bool
          , c-sources :
              List Text
          , cc-options :
              List Text
          , compiler-options :
              CompilerOptions
          , cpp-options :
              List Text
          , default-extensions :
              List Extension
          , default-language :
              Optional Language
          , exposed-modules :
              List Text
          , extra-framework-dirs :
              List Text
          , extra-ghci-libraries :
              List Text
          , extra-lib-dirs :
              List Text
          , extra-libraries :
              List Text
          , frameworks :
              List Text
          , hs-source-dirs :
              List Text
          , include-dirs :
              List Text
          , includes :
              List Text
          , install-includes :
              List Text
          , js-sources :
              List Text
          , ld-options :
              List Text
          , mixins :
              List
              { package :
                  Text
              , renaming :
                  { provides :
                      List { rename : Text, to : Text }
                  , requires :
                      List { rename : Text, to : Text }
                  }
              }
          , other-extensions :
              List Extension
          , other-languages :
              List Language
          , other-modules :
              List Text
          , pkgconfig-depends :
              List { name : Text, version : VersionRange }
          , profiling-options :
              CompilerOptions
          , reexported-modules :
              List
              { name :
                  Text
              , original :
                  { name : Text, package : Optional Text }
              }
          , shared-options :
              CompilerOptions
          , signatures :
              List Text
          }

in  { author :
        Text
    , benchmarks :
        List
        { benchmark :
            List
            { body :
                Benchmark
            , guard :
                  { arch :
                      Arch → Bool
                  , flag :
                      Text → Bool
                  , impl :
                      CompilerFlavor → VersionRange → Bool
                  , os :
                      OS → Bool
                  }
                → Bool
            }
        , name :
            Text
        }
    , bug-reports :
        Text
    , build-type :
        Optional BuildType
    , cabal-version :
        List Natural
    , category :
        Text
    , copyright :
        Text
    , custom-setup :
        Optional
        { setup-depends : List { bounds : VersionRange, package : Text } }
    , data-dir :
        Text
    , data-files :
        List Text
    , description :
        Text
    , executables :
        List
        { executable :
            List
            { body :
                Executable
            , guard :
                  { arch :
                      Arch → Bool
                  , flag :
                      Text → Bool
                  , impl :
                      CompilerFlavor → VersionRange → Bool
                  , os :
                      OS → Bool
                  }
                → Bool
            }
        , name :
            Text
        }
    , extra-doc-files :
        List Text
    , extra-source-files :
        List Text
    , extra-tmp-files :
        List Text
    , flags :
        List { default : Bool, description : Text, manual : Bool, name : Text }
    , foreign-libraries :
        List
        { foreign-lib :
            List
            { body :
                ForeignLibrary
            , guard :
                  { arch :
                      Arch → Bool
                  , flag :
                      Text → Bool
                  , impl :
                      CompilerFlavor → VersionRange → Bool
                  , os :
                      OS → Bool
                  }
                → Bool
            }
        , name :
            Text
        }
    , homepage :
        Text
    , library :
        Optional
        ( List
          { body :
              Library
          , guard :
                { arch :
                    Arch → Bool
                , flag :
                    Text → Bool
                , impl :
                    CompilerFlavor → VersionRange → Bool
                , os :
                    OS → Bool
                }
              → Bool
          }
        )
    , license :
        License
    , license-files :
        List Text
    , maintainer :
        Text
    , name :
        Text
    , package-url :
        Text
    , source-repos :
        List SourceRepo
    , stability :
        Text
    , sub-libraries :
        List
        { library :
            List
            { body :
                Library
            , guard :
                  { arch :
                      Arch → Bool
                  , flag :
                      Text → Bool
                  , impl :
                      CompilerFlavor → VersionRange → Bool
                  , os :
                      OS → Bool
                  }
                → Bool
            }
        , name :
            Text
        }
    , synopsis :
        Text
    , test-suites :
        List
        { name :
            Text
        , test-suite :
            List
            { body :
                Benchmark
            , guard :
                  { arch :
                      Arch → Bool
                  , flag :
                      Text → Bool
                  , impl :
                      CompilerFlavor → VersionRange → Bool
                  , os :
                      OS → Bool
                  }
                → Bool
            }
        }
    , tested-with :
        List Compiler
    , version :
        List Natural
    , x-fields :
        List { _1 : Text, _2 : Text }
    }
ocharles commented 6 years ago

I've just refreshed shell.nix so you should be able to build master now.

ocharles commented 6 years ago

Sorry, forgot to switch to InsOrdHashMap. That is done, now master should work (and I'm going to take the hint to go to bed!)

Gabriella439 commented 6 years ago

More notes from converting dhall.cabal to dhall.dhall:

I can split these into more granular issues tomorrow evening

Also, here is the final configuration I came up with. I could clean it up a bit, but I just wanted to show what my quick and dirty first draft looked like:

    let defaultPackage =
          https://raw.githubusercontent.com/ocharles/dhall-to-cabal/bc8337b1c2c7363b5cfedbfee2aefd5b1e7e4181/dhall/empty-package.dhall 

in  let RepoKind =
          https://raw.githubusercontent.com/ocharles/dhall-to-cabal/bc8337b1c2c7363b5cfedbfee2aefd5b1e7e4181/dhall/types/RepoKind.dhall 

in  let MakeRepoKind = constructors RepoKind

in  let RepoType =
          https://raw.githubusercontent.com/ocharles/dhall-to-cabal/bc8337b1c2c7363b5cfedbfee2aefd5b1e7e4181/dhall/types/RepoType.dhall 

in  let MakeRepoType = constructors RepoType

in  let defaultSourceRepo =
          https://raw.githubusercontent.com/ocharles/dhall-to-cabal/bc8337b1c2c7363b5cfedbfee2aefd5b1e7e4181/dhall/defaults/SourceRepo.dhall 

in  let BuildType =
          https://raw.githubusercontent.com/ocharles/dhall-to-cabal/bc8337b1c2c7363b5cfedbfee2aefd5b1e7e4181/dhall/types/BuildType.dhall 

in  let MakeBuildType = constructors BuildType

in  let License =
          https://raw.githubusercontent.com/ocharles/dhall-to-cabal/bc8337b1c2c7363b5cfedbfee2aefd5b1e7e4181/dhall/types/License.dhall 

in  let MakeLicense = constructors License

in  let CompilerFlavor =
          < GHCJS :
              {}
          | NHC :
              {}
          | GHC :
              {}
          | Hugs :
              {}
          | HBC :
              {}
          | YHC :
              {}
          | JHC :
              {}
          | LHC :
              {}
          | Helium :
              {}
          | HaskellSuite :
              { _1 : Text }
          | OtherCompiler :
              { _1 : Text }
          | UHC :
              {}
          >

in  let MakeCompilerFlavor = constructors CompilerFlavor

in  let Library =
          https://raw.githubusercontent.com/ocharles/dhall-to-cabal/bc8337b1c2c7363b5cfedbfee2aefd5b1e7e4181/dhall/types/Library.dhall 

in  let OS =
          https://raw.githubusercontent.com/ocharles/dhall-to-cabal/bc8337b1c2c7363b5cfedbfee2aefd5b1e7e4181/dhall/types/OS.dhall 

in  let Arch =
          https://raw.githubusercontent.com/ocharles/dhall-to-cabal/bc8337b1c2c7363b5cfedbfee2aefd5b1e7e4181/dhall/types/Arch.dhall 

in  let always =
            λ ( _
              : { os :
                    OS → Bool
                , arch :
                    Arch → Bool
                , flag :
                    Text → Bool
                , impl :
                    CompilerFlavor → VersionRange → Bool
                }
              )
          → True

in  let defaultLibrary =
          https://raw.githubusercontent.com/ocharles/dhall-to-cabal/bc8337b1c2c7363b5cfedbfee2aefd5b1e7e4181/dhall/defaults/Library.dhall 

in  let defaultExecutable =
          https://raw.githubusercontent.com/ocharles/dhall-to-cabal/bc8337b1c2c7363b5cfedbfee2aefd5b1e7e4181/dhall/defaults/Executable.dhall 

in  let defaultTestSuite =
          https://raw.githubusercontent.com/ocharles/dhall-to-cabal/bc8337b1c2c7363b5cfedbfee2aefd5b1e7e4181/dhall/defaults/TestSuite.dhall 

in  let before =
            λ(name : Text)
          → λ(xs : List Natural)
          → { package = name, bounds = earlierVersion xs }

in  let between =
            λ(name : Text)
          → λ(xs : List Natural)
          → λ(ys : List Natural)
          → { package =
                name
            , bounds =
                intersectVersionRanges (orLaterVersion xs) (earlierVersion ys)
            }

in  let any = λ(name : Text) → { package = name, bounds = anyVersion }

in  let defaultCompilerOptions =
          https://raw.githubusercontent.com/ocharles/dhall-to-cabal/bc8337b1c2c7363b5cfedbfee2aefd5b1e7e4181/dhall/defaults/CompilerOptions.dhall 

in  let wall = defaultCompilerOptions ⫽ { GHC = [ "-Wall" ] }

in    defaultPackage
    ⫽ { name =
          "dhall"
      , version =
          [ +1, +9, +1 ]
      , source-repos =
          [   defaultSourceRepo
            ⫽ { kind =
                  MakeRepoKind.RepoHead {=}
              , type =
                  [ MakeRepoType.Git {=} ] : Optional RepoType
              , location =
                  [ "https://github.com/dhall-lang/dhall-haskell" ] : Optional
                                                                      Text
              }
          ]
      , cabal-version =
          [ +1, +8, +0, +2 ]
      , build-type =
          [ MakeBuildType.Simple {=} ] : Optional BuildType
      , license =
          MakeLicense.BSD3 {=}
      , license-files =
          [ "LICENSE" ]
      , copyright =
          "2017 Gabriel Gonzalez"
      , maintainer =
          "Gabriel439@gmail.com"
      , author =
          "Gabriel Gonzalez"
      , tested-with =
          [ { compiler =
                MakeCompilerFlavor.GHC {=}
            , version =
                thisVersion [ +8, +0, +1 ]
            }
          ]
      , bug-reports =
          "https://github.com/dhall-lang/dhall-haskell/issues"
      , synopsis =
          "A configuration language guaranteed to terminate"
      , description =
          ''
          Dhall is an explicitly typed configuration language that is not Turing
          complete.  Despite being Turing incomplete, Dhall is a real programming
          language with a type-checker and evaluator.

          Use this library to parse, type-check, evaluate, and pretty-print the Dhall
          configuration language.  This package also includes an executable which
          type-checks a Dhall file and reduces the file to a fully evaluated normal
          form.

          Read "Dhall.Tutorial" to learn how to use this library
          ''
      , category =
          "Compiler"
      , extra-source-files =
          [ "CHANGELOG.md"
          , "Prelude/Bool/and"
          , "Prelude/Bool/build"
          , "Prelude/Bool/even"
          , "Prelude/Bool/fold"
          , "Prelude/Bool/not"
          , "Prelude/Bool/odd"
          , "Prelude/Bool/or"
          , "Prelude/Bool/show"
          , "Prelude/Double/show"
          , "Prelude/Integer/show"
          , "Prelude/List/all"
          , "Prelude/List/any"
          , "Prelude/List/build"
          , "Prelude/List/concat"
          , "Prelude/List/concatMap"
          , "Prelude/List/filter"
          , "Prelude/List/fold"
          , "Prelude/List/generate"
          , "Prelude/List/head"
          , "Prelude/List/indexed"
          , "Prelude/List/iterate"
          , "Prelude/List/last"
          , "Prelude/List/length"
          , "Prelude/List/map"
          , "Prelude/List/null"
          , "Prelude/List/replicate"
          , "Prelude/List/reverse"
          , "Prelude/List/shifted"
          , "Prelude/List/unzip"
          , "Prelude/Monoid"
          , "Prelude/Natural/build"
          , "Prelude/Natural/enumerate"
          , "Prelude/Natural/even"
          , "Prelude/Natural/fold"
          , "Prelude/Natural/isZero"
          , "Prelude/Natural/odd"
          , "Prelude/Natural/product"
          , "Prelude/Natural/show"
          , "Prelude/Natural/sum"
          , "Prelude/Natural/toInteger"
          , "Prelude/Optional/all"
          , "Prelude/Optional/any"
          , "Prelude/Optional/build"
          , "Prelude/Optional/concat"
          , "Prelude/Optional/filter"
          , "Prelude/Optional/fold"
          , "Prelude/Optional/head"
          , "Prelude/Optional/last"
          , "Prelude/Optional/length"
          , "Prelude/Optional/map"
          , "Prelude/Optional/null"
          , "Prelude/Optional/toList"
          , "Prelude/Optional/unzip"
          , "Prelude/Text/concat"
          , "Prelude/Text/concatMap"
          , "Prelude/Text/concatMapSep"
          , "Prelude/Text/concatSep"
          , "tests/format/*.dhall"
          , "tests/parser/*.dhall"
          , "tests/regression/*.dhall"
          , "tests/tutorial/*.dhall"
          ]
      , library =
          [ [ { guard =
                  always
              , body =
                    defaultLibrary
                  ⫽ { hs-source-dirs =
                        [ "src" ]
                    , build-depends =
                        [ between "base" [ +4, +9, +0, +0 ] [ +5 ]
                        , before "ansi-wl-pprint" [ +0, +7 ]
                        , before "base16-bytestring" [ +0, +2 ]
                        , before "bytestring" [ +0, +11 ]
                        , before "case-insensitive" [ +1, +3 ]
                        , before "charset" [ +0, +4 ]
                        , between "containers" [ +0, +5, +0, +0 ] [ +0, +6 ]
                        , before "contravariant" [ +1, +5 ]
                        , before "cryptohash" [ +0, +12 ]
                        , between "exceptions" [ +0, +8, +3 ] [ +0, +9 ]
                        , between "directory" [ +1, +3 ] [ +1, +4 ]
                        , between "filepath" [ +1, +4 ] [ +1, +5 ]
                        , between "http-client" [ +0, +4, +30 ] [ +0, +6 ]
                        , between "http-client-tls" [ +0, +2, +0 ] [ +0, +4 ]
                        , between
                          "insert-ordered-containers"
                          [ +0, +1, +0, +1 ]
                          [ +0, +3 ]
                        , between "lens-family-core" [ +1, +0, +0 ] [ +1, +3 ]
                        , between "parsers" [ +0, +12, +4 ] [ +0, +13 ]
                        , between "prettyprinter" [ +1, +1, +1 ] [ +1, +2 ]
                        , between "scientific" [ +0, +3, +0, +0 ] [ +0, +4 ]
                        , between "text" [ +0, +11, +1, +0 ] [ +1, +3 ]
                        , before "text-format" [ +0, +4 ]
                        , between "transformers" [ +0, +2, +0, +0 ] [ +0, +6 ]
                        , between "trifecta" [ +1, +6 ] [ +1, +8 ]
                        , between
                          "unordered-containers"
                          [ +0, +1, +3, +0 ]
                          [ +0, +3 ]
                        , between "vector" [ +0, +11, +0, +0 ] [ +0, +13 ]
                        ]
                    , exposed-modules =
                        [ "Dhall"
                        , "Dhall.Context"
                        , "Dhall.Core"
                        , "Dhall.Import"
                        , "Dhall.Parser"
                        , "Dhall.Tutorial"
                        , "Dhall.TypeCheck"
                        ]
                    , compiler-options =
                        wall
                    }
              }
            ]
          ] : Optional
              ( List
                { guard :
                      { os :
                          OS → Bool
                      , arch :
                          Arch → Bool
                      , flag :
                          Text → Bool
                      , impl :
                          CompilerFlavor → VersionRange → Bool
                      }
                    → Bool
                , body :
                    Library
                }
              )
      , executables =
          [ { name =
                "dhall"
            , executable =
                [ { guard =
                      always
                  , body =
                        defaultExecutable
                      ⫽ { hs-source-dirs =
                            [ "dhall" ]
                        , main-is =
                            "Main.hs"
                        , build-depends =
                            [ any "base"
                            , any "dhall"
                            , between
                              "optparse-generic"
                              [ +1, +1, +1 ]
                              [ +1, +3 ]
                            , any "prettyprinter"
                            , any "trifecta"
                            , any "text"
                            ]
                        , compiler-options =
                            wall
                        , other-modules =
                            [ "Paths_dhall" ]
                        }
                  }
                ]
            }
          , { name =
                "dhall-hash"
            , executable =
                [ { guard =
                      always
                  , body =
                        defaultExecutable
                      ⫽ { main-is =
                            "Main.hs"
                        , hs-source-dirs =
                            [ "dhall-hash" ]
                        , build-depends =
                            [ any "base"
                            , any "dhall"
                            , any "optparse-generic"
                            , any "trifecta"
                            , any "text"
                            ]
                        }
                  }
                ]
            }
          , { name =
                "dhall-format"
            , executable =
                [ { guard =
                      always
                  , body =
                        defaultExecutable
                      ⫽ { main-is =
                            "Main.hs"
                        , hs-source-dirs =
                            [ "dhall-hash" ]
                        , build-depends =
                            [ any "base"
                            , any "dhall"
                            , any "optparse-generic"
                            , any "prettyprinter"
                            , any "system-filepath"
                            , any "trifecta"
                            , any "text"
                            ]
                        }
                  }
                ]
            }
          ]
      , test-suites =
          [ { name =
                "test"
            , test-suite =
                [ { guard =
                      always
                  , body =
                        defaultTestSuite
                      ⫽ { main-is =
                            "Test.hs"
                        , hs-source-dirs =
                            [ "tests" ]
                        , compiler-options =
                            wall
                        , other-modules =
                            [ "Examples"
                            , "Format"
                            , "Normalization"
                            , "Parser"
                            , "Regression"
                            , "Tutorial"
                            , "Util"
                            ]
                        , build-depends =
                            [ any "base"
                            , any "containers"
                            , between "deepseq" [ +1, +2, +0, +1 ] [ +1, +5 ]
                            , any "dhall"
                            , any "insert-ordered-containers"
                            , any "prettyprinter"
                            , between "tasty" [ +0, +11, +2 ] [ +1, +1 ]
                            , between "tasty-hunit" [ +0, +9, +2 ] [ +0, +11 ]
                            , any "text"
                            , any "vector"
                            ]
                        }
                  }
                ]
            }
          ]
      }
ocharles commented 6 years ago

There needs to be some sort of convention for naming types versus naming the record generated by constructors. I prefixed name of the type with Make when generating constructors but I'm not sure if it's the best convention

I've been thinking about having the type name as singular and constructors as plural. E.g., Compiler and let Compilers = constructors Compiler.

I should probably add support for records with type-valued fields to reduce the number of imports necessary

Yes please, as this also lets me give people a single record of the dhall-to-cabal standard library.

There should probably be a utility for a "guard" that accepts any configuration

I think you're looking for unconditional. There are also helpers to created unguraded executables and so on. You can see it in use here

There appears to be a typo in the --print-type where it has the type of the testsuites.*.test-suite.body field as Benchmark instead of TestSuite (although it seems harmless since they appear to be the same type)

This is an interesting one. The way --print-type works is by doing a let binding and then trying to replace an Expr with the bound variable (see here). What's happening here is I first substitute Benchmark, and TestSuite has exactly the same type as Benchmark.

However, as you noticed, I've excluded type from TestSuite, which would be enough to make them different and solve this problem.

I didn't see a TestSuite field for the test suite type (i.e. exitcode-stdio-1.0)

I purposely excluded this as anything other than exitcode-stdio-1.0 is pretty useless. Cabal's standardised test format has been almost entirely unused and undocumented. However, I realise it's probably not dhall-to-cabals place to dictate that, so I will add this field in. It also solves the above problem.

It looks like CompilerFlavor is missing from the types/ folder

It's actually just dhall/types/Compiler. I think having --print-type know about CompilerFlavor is wrong, I'll take that out.

I got several "type errors of doom", which definitely needs to provide a better user experience. However, a surprisingly quick and effective trick was to just pretty-print the two types and diff them textually. I might add something like that as a stopgap until proper type diffing is in place

This has been my strategy throughout this whole development process (along with dhall-format). However, I have needed the entire file open (I use ediff) to get enough context to actually work out what the diff is telling me.

I can split these into more granular issues tomorrow evening

If you can split out the ones that you want me to act on, that would be very helpful.

ocharles commented 6 years ago

Ok, quite a few changes landed tonight that I think will help:

Gabriella439 commented 6 years ago

Regarding stdlib, it looks great so far!

In general, the fact that things don't work with the standard Dhall tooling is still a bit jarring. For example, one of the first things I wanted to do was to learn more about stdlib by using dhall to retrieve it and get the type + normal form, but this doesn't work:

$ dhall <<< https://raw.githubusercontent.com/ocharles/dhall-to-cabal/master/dhall/stdlib.dhall

Use "dhall --explain" for detailed errors

↳ https://raw.githubusercontent.com/ocharles/dhall-to-cabal/master/dhall/stdlib.dhall 
  ↳ https://raw.githubusercontent.com/ocharles/dhall-to-cabal/master/dhall/GitHub-project.dhall 
    ↳ https://raw.githubusercontent.com/ocharles/dhall-to-cabal/master/dhall/defaults/Package.dhall 
      ↳ https://raw.githubusercontent.com/ocharles/dhall-to-cabal/master/dhall/types/Guarded.dhall 
        ↳ https://raw.githubusercontent.com/ocharles/dhall-to-cabal/master/dhall/types/Config.dhall 

_ : < GHC : {} | GHCJS : {} | HBC : {} | HaskellSuite : { _1 : Text } | Helium : {} | Hugs : {} | JHC : {} | LHC : {} | NHC : {} | OtherCompiler : { _1 : Text } | UHC : {} | YHC : {} >

Error: Unbound variable

VersionRange

https://raw.githubusercontent.com/ocharles/dhall-to-cabal/master/dhall/types/Config.dhall:6:25

I think if you could get this working without builtins it would do a lot to improve integration with the rest of the ecosystem. I still think the best compromise is to use Text instead of VersionRange both for ease of integration and usability

Gabriella439 commented 6 years ago

Also, I have a proposal out for adding support for type-valued fields and alternatives so you can have a single import for the entire standard library: https://github.com/dhall-lang/dhall-lang/pull/91