Commit 919b7459 authored by Björn Peemöller 's avatar Björn Peemöller
Browse files

Changed Cabal configuration to also expose a library

parent 5540f7ba
Name: curry-frontend Name: curry-frontend
Version: 0.4.1 Version: 0.4.1
Cabal-Version: >= 1.6 Cabal-Version: >= 1.10
Synopsis: Compile the functional logic language Curry to several Synopsis: Compile the functional logic language Curry to several
intermediate formats intermediate formats
Description: The Curry Frontend consists of the executable program "cymake". Description: The Curry Frontend consists of the executable program "cymake".
...@@ -33,19 +33,25 @@ Flag network-uri ...@@ -33,19 +33,25 @@ Flag network-uri
description: Get Network.URI from the network-uri package description: Get Network.URI from the network-uri package
default: True default: True
Executable cymake Library
hs-source-dirs: src hs-source-dirs: src
Main-is: cymake.hs default-language: Haskell2010
Build-Depends: base == 4.*, curry-base == 0.4.1 Build-Depends:
, containers, directory, mtl, process, transformers, syb base == 4.*
, containers
, curry-base == 0.4.1
, directory
, filepath
, mtl
, process
, syb
, transformers
if flag(network-uri) if flag(network-uri)
build-depends: network-uri >= 2.6 build-depends: network-uri >= 2.6
else else
build-depends: network < 2.6 build-depends: network < 2.6
ghc-options: -Wall Exposed-Modules:
Other-Modules: Base.CurryTypes
Paths_curry_frontend
, Base.CurryTypes
, Base.Expr , Base.Expr
, Base.Messages , Base.Messages
, Base.NestEnv , Base.NestEnv
...@@ -76,6 +82,7 @@ Executable cymake ...@@ -76,6 +82,7 @@ Executable cymake
, Env.TypeConstructor , Env.TypeConstructor
, Env.Value , Env.Value
, Exports , Exports
, Files.CymakePath
, Generators , Generators
, Generators.GenAbstractCurry , Generators.GenAbstractCurry
, Generators.GenFlatCurry , Generators.GenFlatCurry
...@@ -96,10 +103,27 @@ Executable cymake ...@@ -96,10 +103,27 @@ Executable cymake
, Transformations.Lift , Transformations.Lift
, Transformations.Qual , Transformations.Qual
, Transformations.Simplify , Transformations.Simplify
Library
hs-source-dirs: src
Build-Depends: filepath
Exposed-Modules:
Files.CymakePath
Other-Modules: Other-Modules:
Paths_curry_frontend Paths_curry_frontend
ghc-options: -Wall
Executable cymake
hs-source-dirs: src
Main-is: cymake.hs
default-language: Haskell2010
Build-Depends:
base == 4.*
, containers
, curry-base == 0.4.1
, curry-frontend
, directory
, filepath
, mtl
, process
, syb
, transformers
if flag(network-uri)
build-depends: network-uri >= 2.6
else
build-depends: network < 2.6
ghc-options: -Wall
...@@ -463,6 +463,7 @@ qualifyFieldDecl m (CS.FieldDecl p l ty) = CS.FieldDecl p l (qualifyCSType m ty) ...@@ -463,6 +463,7 @@ qualifyFieldDecl m (CS.FieldDecl p l ty) = CS.FieldDecl p l (qualifyCSType m ty)
qualifyCSType :: ModuleIdent -> CS.TypeExpr -> CS.TypeExpr qualifyCSType :: ModuleIdent -> CS.TypeExpr -> CS.TypeExpr
qualifyCSType mid = fromType . toQualType mid [] qualifyCSType mid = fromType . toQualType mid []
-- TODO: Refactor
trApply :: IL.Expression -> IL.Expression -> FlatState Expr trApply :: IL.Expression -> IL.Expression -> FlatState Expr
trApply e1 e2 = genFlatApplic [e2] e1 trApply e1 e2 = genFlatApplic [e2] e1
where where
......
...@@ -338,8 +338,8 @@ expandPatternBindings :: [Ident] -> Decl -> SIM [Decl] ...@@ -338,8 +338,8 @@ expandPatternBindings :: [Ident] -> Decl -> SIM [Decl]
expandPatternBindings fvs d@(PatternDecl p t (SimpleRhs _ e _)) = case t of expandPatternBindings fvs d@(PatternDecl p t (SimpleRhs _ e _)) = case t of
VariablePattern _ -> return [d] VariablePattern _ -> return [d]
_ -> do _ -> do
pty <- getTypeOf t -- type of pattern pty <- getTypeOf t -- type of pattern
mapM (mkSelectorDecl pty) (filter (`elem` fvs) (bv t)) -- used variables mapM (mkSelectorDecl pty) (filter (`elem` fvs) (bv t)) -- used variables
where where
mkSelectorDecl pty v = do mkSelectorDecl pty v = do
vty <- getTypeOf v vty <- getTypeOf v
......
...@@ -20,8 +20,8 @@ import Base.Messages ...@@ -20,8 +20,8 @@ import Base.Messages
import Files.CymakePath (cymakeGreeting, cymakeVersion) import Files.CymakePath (cymakeGreeting, cymakeVersion)
import Html.CurryHtml (source2html) import Html.CurryHtml (source2html)
import CurryBuilder (buildCurry) import CurryBuilder (buildCurry)
import CompilerOpts (Options (..), CymakeMode (..), getCompilerOpts, usage) import CompilerOpts (Options (..), CymakeMode (..), getCompilerOpts, usage)
-- |The command line tool cymake -- |The command line tool cymake
main :: IO () main :: IO ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment