cabal-version: 3.0 name: c-expr-runtime version: 0.1.0.0 license: BSD-3-Clause license-file: LICENSE author: Well-Typed LLP maintainer: info@well-typed.com category: System build-type: Simple extra-doc-files: CHANGELOG.md synopsis: Haskell DSL for simple C arithmetic expressions tested-with: GHC ==9.2.8 || ==9.4.8 || ==9.6.7 || ==9.8.4 || ==9.10.3 || ==9.12.2 || ==9.14.1 description: This library provides a Haskell DSL for simple C arithmetic expressions, implementing the arithmetic conversion and integral promotion rules of the C standard. For example, addition is defined with the following type class: @ infixl 2 + type Add :: Type -> Type -> Constraint class Add a b where type family AddRes a b :: Type (+) :: a -> b -> AddRes a b @ That is, we can add arguments of different types, e.g. an integer and a floating-point number, in which case the integer will first get converted to the floating-point format before performing the addition. common common ghc-options: -Wall -Wunused-packages -Wno-unticked-promoted-constructors default-extensions: DataKinds DeriveGeneric DeriveTraversable DerivingStrategies FlexibleInstances GADTs ImportQualifiedPost LambdaCase MagicHash MultiParamTypeClasses ParallelListComp StandaloneKindSignatures TupleSections TypeApplications TypeFamilies TypeOperators build-depends: base >=4.16 && <4.23 default-language: Haskell2010 -- Platform independent core library -- Note: the C.Operator.Classes should not be publicly visible. -- We should only be able to import the definitions "polluted" -- by instances declarations (from C.Expr.HostPlatform). library c-expr-core import: common hs-source-dirs: core exposed-modules: C.Char C.Operator.Classes C.Operator.GenInstances C.Operators C.Type C.Type.Internal.Universe other-modules: C.Operator.Internal C.Operator.TH -- External dependencies build-depends: , containers >=0.5 && <0.9 , fin >=0.3.2 && <0.4 , some >=1.0.6 && <1.1 , template-haskell >=2.18 && <2.25 , vec >=0.5 && <0.6 if impl(ghc <9.4) build-depends: data-array-byte >=0.1.0.1 && <0.2 -- C arithmetic DSL, in the form of platform-dependent modules library import: common hs-source-dirs: lib exposed-modules: C.Expr.HostPlatform other-modules: C.Expr.Posix32 C.Expr.Posix64 C.Expr.Win64 reexported-modules: C.Char , C.Operators , C.Type -- Internal dependencies build-depends: c-expr-runtime:c-expr-core test-suite tests import: common hs-source-dirs: test main-is: Main.hs type: exitcode-stdio-1.0 other-modules: CallClang -- Internal dependencies build-depends: , c-expr-runtime:c-expr-core , libclang-bindings -- Inherited dependencies build-depends: , containers , data-default , fin , vec -- External dependencies build-depends: , directory >=1.3 && <1.4 , filepath >=1.4 && <1.6 , text >=1.2 && <2.2