mirror of
https://github.com/carp-lang/Carp.git
synced 2024-08-15 00:00:34 +03:00
* refactor: add type candidates for validation This commit adds a new module and type, the TypeCandidate, which represents a potentially valid or invalid type. We use it as the input for both type validation routines and type binding generation. The type also allows us to unify the structure of sum types and product types in an xobj agnostic way, paving the way for future simplification of binding generation for type definitions. This commit also removes SumtypeCase.hs, since it's no longer needed. * refactor: add template generators; update type templates This commit builds on the TypeCandidate data structure further by providing "template generators" that work on candidates. Using generators, templates for type functions ("methods") can be written almost completely declaratively. Generators also remove some of the typical boilerplate involved in creating templates from lists of tokens and enable us to unify several of the generic and concrete templates for types. Generators can act on type candidates or their fields (for field-specific functions). In general, this approach makes the generation of type templates more structured. A type candidate now contains all the information a generator needs to create appropriate templates, thus it is a single and well-defined input for validation and generation of user defined types. This commit also updates the Deftype templates to use template generators. * refactor: use template generators for sumtype templates
134 lines
4.1 KiB
Plaintext
134 lines
4.1 KiB
Plaintext
name: CarpHask
|
|
version: 0.5.3.0
|
|
-- synopsis:
|
|
-- description:
|
|
homepage: https://github.com/eriksvedang/Carp
|
|
license: Apache-2.0
|
|
license-file: LICENSE
|
|
author: Erik Svedäng
|
|
maintainer: erik.svedang@gmail.com
|
|
copyright: Erik Svedäng
|
|
category: General
|
|
build-type: Simple
|
|
extra-source-files: README.md
|
|
cabal-version: >=1.10
|
|
|
|
library
|
|
ghc-options: -Wall -Werror
|
|
hs-source-dirs: src
|
|
exposed-modules: ArrayTemplates,
|
|
AssignTypes,
|
|
BoxTemplates,
|
|
ColorText,
|
|
Commands,
|
|
Concretize,
|
|
Constraints,
|
|
Context,
|
|
Deftype,
|
|
Emit,
|
|
Env,
|
|
EvalError,
|
|
Eval,
|
|
Expand,
|
|
Forms,
|
|
GenerateConstraints,
|
|
Infer,
|
|
Info,
|
|
InitialTypes,
|
|
Interfaces,
|
|
Managed,
|
|
Map,
|
|
Memory,
|
|
Meta,
|
|
Obj,
|
|
Parsing,
|
|
Path,
|
|
Polymorphism,
|
|
Primitives,
|
|
PrimitiveError
|
|
Project,
|
|
Qualify,
|
|
Reify,
|
|
RenderDocs,
|
|
Repl,
|
|
Set,
|
|
Scoring,
|
|
StartingEnv,
|
|
StaticArrayTemplates,
|
|
StructUtils,
|
|
Sumtypes,
|
|
SymPath,
|
|
Template,
|
|
TemplateGenerator,
|
|
ToTemplate,
|
|
TypeCandidate,
|
|
TypeError,
|
|
TypePredicates,
|
|
Types,
|
|
TypesToC,
|
|
Util,
|
|
Validate
|
|
|
|
build-depends: base >= 4.7 && < 5
|
|
, parsec == 3.1.*
|
|
, mtl
|
|
, containers
|
|
, process
|
|
, directory
|
|
, filepath
|
|
, split
|
|
, hashable
|
|
, haskeline
|
|
, blaze-html
|
|
, blaze-markup
|
|
, text
|
|
, ansi-terminal >= 0.10.3
|
|
, cmark
|
|
, edit-distance
|
|
, open-browser
|
|
|
|
default-language: Haskell2010
|
|
|
|
executable carp
|
|
hs-source-dirs: app
|
|
main-is: Main.hs
|
|
ghc-options: -threaded -rtsopts -with-rtsopts=-N
|
|
build-depends: base
|
|
, CarpHask
|
|
, containers
|
|
, directory
|
|
, filepath
|
|
, haskeline
|
|
, process
|
|
, optparse-applicative
|
|
default-language: Haskell2010
|
|
|
|
executable carp-header-parse
|
|
hs-source-dirs: headerparse
|
|
main-is: Main.hs
|
|
ghc-options: -threaded -rtsopts -with-rtsopts=-N
|
|
build-depends: base
|
|
, CarpHask
|
|
, containers
|
|
, directory
|
|
, parsec
|
|
, optparse-applicative
|
|
default-language: Haskell2010
|
|
|
|
test-suite CarpHask-test
|
|
type: exitcode-stdio-1.0
|
|
hs-source-dirs: test
|
|
main-is: Spec.hs
|
|
build-depends: base
|
|
, CarpHask
|
|
, HUnit
|
|
, containers
|
|
other-modules: TestConstraints
|
|
, TestLookup
|
|
ghc-options: -threaded -rtsopts -with-rtsopts=-N
|
|
default-language: Haskell2010
|
|
|
|
source-repository head
|
|
type: git
|
|
location: https://github.com/carp-lang/Carp
|