Carp/CarpHask.cabal

134 lines
4.1 KiB
Plaintext
Raw Normal View History

2017-06-26 12:15:03 +03:00
name: CarpHask
2021-09-17 14:54:26 +03:00
version: 0.5.3.0
2017-06-26 12:15:03 +03:00
-- 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
2017-06-26 12:15:03 +03:00
hs-source-dirs: src
exposed-modules: ArrayTemplates,
AssignTypes,
feat: add box type (#1358) * feat: add box templates and box type This commit adds an implementation of Boxes, memory manged heap allocated values. Boxes are implemented as C pointers, with no additional structure but are treated as structs in Carp. To facilitate this, we need to add them as a clause to our special type emissions (TypesToC) as they'd otherwise be emitted like other struct types. Co-authored-by: Veit Heller <veit@veitheller.de> * fix: slight memory management fix for Box Make sure we free the box! * test: add tests for box (including memory checks) * Revert "fix: Ignore clang nitpick" This reverts commit 70ec6d46d4c636c39dc4d47dc7732421a30a0b3f. * fix: update example/functor.carp Now that a builtin type named Box exists, the definitions in this file cause a conflict. I've renamed the "Box" type in the functor example to remove the conflict. * feat: add Box.peek Box.peek allows users to transform a reference to a box into a a reference to the box's contained value. The returned reference will have the same lifetime as the box. This function allows callers to manipulate the value in a box without re-allocation, for example: ```clojure (deftype Num [val Int]) (let-do [box (Box.init (Num.init 0))] (Num.set-val! (Box.peek &box) 1) @(Num.val (Box.peek &box))) ``` This commit also includes tests for Box.peek. Co-authored-by: TimDeve <TimDeve@users.noreply.github.com> Co-authored-by: Veit Heller <veit@veitheller.de> Co-authored-by: Erik Svedäng <erik@coherence.io> Co-authored-by: TimDeve <TimDeve@users.noreply.github.com>
2021-11-30 12:35:22 +03:00
BoxTemplates,
2017-06-26 12:15:03 +03:00
ColorText,
Commands,
Concretize,
2017-06-26 12:15:03 +03:00
Constraints,
Context,
2017-06-26 12:15:03 +03:00
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,
2018-03-27 07:27:52 +03:00
StartingEnv,
StaticArrayTemplates,
2019-02-20 17:25:00 +03:00
StructUtils,
Sumtypes,
SymPath,
Template,
refactor: add type candidates and template generators (#1361) * 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
2021-12-20 17:41:14 +03:00
TemplateGenerator,
ToTemplate,
refactor: add type candidates and template generators (#1361) * 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
2021-12-20 17:41:14 +03:00
TypeCandidate,
TypeError,
TypePredicates,
Types,
TypesToC,
Util,
Validate
2017-10-20 00:36:17 +03:00
2017-06-26 12:15:03 +03:00
build-depends: base >= 4.7 && < 5
, parsec == 3.1.*
, mtl
, containers
, process
, directory
, filepath
2017-06-26 12:15:03 +03:00
, split
, hashable
, haskeline
2018-07-18 13:23:02 +03:00
, blaze-html
, blaze-markup
2018-03-27 07:27:52 +03:00
, text
2020-05-21 21:44:43 +03:00
, ansi-terminal >= 0.10.3
, cmark
2019-03-12 21:11:12 +03:00
, edit-distance
, open-browser
2017-10-20 00:36:17 +03:00
2017-06-26 12:15:03 +03:00
default-language: Haskell2010
2017-06-26 13:04:39 +03:00
executable carp
2017-06-26 12:15:03 +03:00
hs-source-dirs: app
main-is: Main.hs
ghc-options: -threaded -rtsopts -with-rtsopts=-N
build-depends: base
, CarpHask
, containers
, directory
2019-09-24 00:47:26 +03:00
, filepath
2017-10-20 00:36:17 +03:00
, haskeline
2017-06-26 12:15:03 +03:00
, process
, optparse-applicative
2017-06-26 12:15:03 +03:00
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
2017-06-26 12:15:03 +03:00
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
2017-06-26 12:15:03 +03:00
ghc-options: -threaded -rtsopts -with-rtsopts=-N
default-language: Haskell2010
source-repository head
type: git
location: https://github.com/carp-lang/Carp