Commit f60980a5 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Add topLevel function to construct top-level packages like compiler.

parent a827aa58
module Package (Package (..), library, setCabal) where
module Package (Package (..), library, topLevel, setCabal) where
import Base
import Util
......@@ -20,15 +20,12 @@ instance Eq Package where
instance Ord Package where
compare = compare `on` pkgName
libraryPackage :: String -> String -> Package
libraryPackage name cabalName =
Package
name
(unifyPath $ "libraries" </> name)
cabalName
library :: String -> Package
library name = libraryPackage name (name <.> "cabal")
library name =
Package name (unifyPath $ "libraries" </> name) (name <.> "cabal")
topLevel :: String -> Package
topLevel name = Package name name (name <.> "cabal")
setCabal :: Package -> FilePath -> Package
setCabal pkg cabalName = pkg { pkgCabal = cabalName }
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