Carp/CarpHask.cabal

118 lines
3.6 KiB
Plaintext
Raw Normal View History

2017-06-26 12:15:03 +03:00
name: CarpHask
2019-07-04 11:34:03 +03:00
version: 0.3.0.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
hs-source-dirs: src
exposed-modules: Info,
Obj,
Meta,
2020-05-30 12:52:37 +03:00
Project,
2017-06-26 12:15:03 +03:00
Parsing,
2017-10-20 00:36:17 +03:00
Infer,
2017-06-26 12:15:03 +03:00
Emit,
ColorText,
Constraints,
Deftype,
2018-10-30 14:55:17 +03:00
Sumtypes,
2019-03-26 12:23:27 +03:00
SumtypeCase,
2017-06-26 12:15:03 +03:00
Commands,
Template,
ToTemplate,
SymPath,
2017-06-26 12:15:03 +03:00
Types,
TypesToC,
2017-06-26 12:15:03 +03:00
Util,
Eval,
TypeError,
InitialTypes,
2017-08-31 17:40:56 +03:00
AssignTypes,
GenerateConstraints,
2017-09-01 07:31:26 +03:00
Polymorphism,
Concretize,
2017-12-15 18:37:03 +03:00
ArrayTemplates,
StaticArrayTemplates,
Expand,
Scoring,
Lookup,
Qualify,
Repl,
2018-03-27 07:27:52 +03:00
StartingEnv,
RenderDocs,
2019-02-20 17:25:00 +03:00
StructUtils,
2019-09-24 00:47:26 +03:00
Path,
Interfaces,
2020-02-21 22:20:13 +03:00
Primitives,
Enhance type reflection; get types of values, get kinds Extends Carp's support for type reflection by returning types for values as well as bindings. `type` now also returns a valid Carp expression/s-expression and so its output can be used as input to dynamic functions and macros (prior to this commit, `type` printed the type to the REPL but did not return a meaningful expression in Carp). Here are a few illustrations of the behavior: ``` (def x 1) ;; type now returns an s-expression/symbol (type x) => Int ;; It also works on values (type 1) => Int (type 2b) => Byte (type "foo") => (Ref String <StaticLifetime>) ;; It works on more complex values as well (type Maybe) => Module (type Maybe.Just) (Fn [a] (Maybe a) <StaticLifetime>) ;; reports honestly about polymorphism (type (Maybe.Nothing)) => (Maybe a) (type (Pair.init 1 2)) => (Pair Int Int) ;; What about the type of types? (type (type 2)) => Type ;; Or the type of types of types? (type (type (type 2))) => () ;; One more time! (type (type (type (type 2)))) => () ;; so, () is the fixpoint of type, and is reached after two applications (type zero) ;; the type of an interface is all of its implementations => (((Fn [] (Array a) <StaticLifetime>) (Fn [] Bool <StaticLifetime>) (Fn [] Byte <StaticLifetime>) (Fn [] Char <StaticLifetime>) (Fn [] Double <StaticLifetime>) (Fn [] Float <StaticLifetime>) (Fn [] Int <StaticLifetime>) (Fn [] Int16 <StaticLifetime>) (Fn [] Int32 <StaticLifetime>) (Fn [] Int64 <StaticLifetime>) (Fn [] Int8 <StaticLifetime>) (Fn [] Long <StaticLifetime>) (Fn [] (Maybe a) <StaticLifetime>) (Fn [] (Pair a b) <StaticLifetime>) (Fn [] (Quadruple a b c d) <StaticLifetime>) (Fn [] String <StaticLifetime>) (Fn [] (Triple a b c) <StaticLifetime>) (Fn [] Uint16 <StaticLifetime>) (Fn [] Uint32 <StaticLifetime>) (Fn [] Uint64 <StaticLifetime>) (Fn [] Uint8 <StaticLifetime>))) ``` As shown in the example above, this change also includes a cosmetic update to the representation of lifetime variables, which are surrounded in <> to distinguish them from type variables. This commit also adds a new `kind` primitive that reports on the kind of a binding or value: ``` (def x 3) (kind x) => Base (kind 2) => Base (kind Maybe.Just) => Higher (kind (Maybe.Just 2)) => Higher ``` `kind` and `type` both support interactive development in the repl, for example, a user can rely on `kind` to check the kind of a type they plan on using in an interface that demands a higher-kinded argument. Likewise, they both also support developing macros based on type information.
2020-10-03 00:48:58 +03:00
Validate,
Reify
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
, 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
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
ghc-options: -threaded -rtsopts -with-rtsopts=-N
default-language: Haskell2010
source-repository head
type: git
location: https://github.com/carp-lang/Carp