~jojo/Carth

df9ffb20d614efb1378777d31f85a0592c120739 — JoJo 1 year, 6 months ago 333a2df
Remove package.yaml in favor of just carth.cabal

It's annoying having to type out all modules in exposed-modules, but
still, this means a bit less complexity.
4 files changed, 126 insertions(+), 117 deletions(-)

M .gitignore
M app/Prebaked.hs
A carth.cabal
D package.yaml
M .gitignore => .gitignore +0 -1
@@ 1,5 1,4 @@
.stack-work/
carth.cabal
*~
.dbg.*
/examples/*

M app/Prebaked.hs => app/Prebaked.hs +7 -7
@@ 11,6 11,13 @@ import System.Process

type Parser = M.Parsec Void String

readCompilerVersion :: Q Exp
readCompilerVersion = do
    s <- runIO (readFile "carth.cabal")
    let (_, major, minor, patch) =
            head (catMaybes (map (M.parseMaybe pversion) (lines s)))
    lift (major, minor, patch)

pversion :: Parser (Int, Int, Int, Int)
pversion = do
    MC.string "version:" >> MC.space


@@ 23,13 30,6 @@ pversion = do
    num = ML.decimal
    dot = MC.char '.'

readCompilerVersion :: Q Exp
readCompilerVersion = do
    s <- runIO (readFile "package.yaml")
    let (_, major, minor, patch) =
            head (catMaybes (map (M.parseMaybe pversion) (lines s)))
    lift (major, minor, patch)

getCommit :: Q Exp
getCommit =
    qAddDependentFile ".git/index"

A carth.cabal => carth.cabal +119 -0
@@ 0,0 1,119 @@
cabal-version: 2.2

name:           carth
version:        0.0.4.0
description:    Please see the README on GitHub at <https://github.com/bryal/carth#readme>
homepage:       https://carth.jo.zone
author:         Johan Johansson
maintainer:     jo@jo.zone
copyright:      2020 Johan Johansson
license:        AGPL-3.0-or-later
license-file:   LICENSE
build-type:     Simple
extra-source-files:
    README.org
    CHANGELOG.org

source-repository head
  type: git
  location: https://github.com/bryal/carth

library
  exposed-modules:
      Abi
      Check
      Checked
      Codegen
      Compile
      Conf
      EnvVars
      FreeVars
      Gen
      Infer
      Inferred
      Literate
      LLCompunit
      LLSubprog
      Match
      Misc
      Monomorphic
      Monomorphize
      Parse
      Parsed
      Pretty
      Selections
      SrcPos
      Subst
      TypeErr
  other-modules:
  hs-source-dirs:
      src
  ghc-options: -Weverything -Werror -Wno-safe -Wno-unsafe -Wno-missing-import-lists -Wno-missing-exported-signatures -Wno-missing-local-signatures -Wno-monomorphism-restriction -Wno-implicit-prelude -Wno-name-shadowing -Wno-orphans -Wno-missed-specialisations -Wno-all-missed-specialisations -Wno-unticked-promoted-constructors
  build-depends:
      base
    , bytestring
    , containers
    , directory
    , filepath
    , llvm-hs
    , llvm-hs-pure
    , megaparsec
    , microlens-platform
    , mtl
    , process
    , template-haskell
    , utf8-string
  default-language: Haskell2010

executable carth
  main-is: Main.hs
  other-modules:
      GetConfig
      Prebaked
  hs-source-dirs:
      app
  ghc-options: -threaded -rtsopts -with-rtsopts=-N -Weverything -Werror -Wno-safe -Wno-unsafe -Wno-missing-import-lists -Wno-missing-exported-signatures -Wno-missing-local-signatures -Wno-monomorphism-restriction -Wno-implicit-prelude -Wno-name-shadowing -Wno-orphans -Wno-missed-specialisations -Wno-all-missed-specialisations -Wno-unticked-promoted-constructors
  build-depends:
      base
    , bytestring
    , carth
    , containers
    , directory
    , filepath
    , llvm-hs
    , llvm-hs-pure
    , megaparsec
    , microlens-platform
    , mtl
    , process
    , template-haskell
    , utf8-string
  default-language: Haskell2010

test-suite carth-test
  type: exitcode-stdio-1.0
  main-is: Spec.hs
  other-modules:
      CheckSpec
  hs-source-dirs:
      test
  ghc-options: -threaded -rtsopts -with-rtsopts=-N -Weverything -Werror -Wno-safe -Wno-unsafe -Wno-missing-import-lists -Wno-missing-exported-signatures -Wno-missing-export-lists -Wno-missing-local-signatures -Wno-missing-signatures -Wno-monomorphism-restriction -Wno-implicit-prelude -Wno-name-shadowing -Wno-orphans -Wno-missed-specialisations -Wno-all-missed-specialisations -Wno-unticked-promoted-constructors
  build-depends:
      QuickCheck
    , base
    , bytestring
    , carth
    , containers
    , directory
    , filepath
    , hspec
    , hspec-discover
    , llvm-hs
    , llvm-hs-pure
    , megaparsec
    , microlens-platform
    , mtl
    , process
    , template-haskell
    , utf8-string
  default-language: Haskell2010

D package.yaml => package.yaml +0 -109
@@ 1,109 0,0 @@
name:                carth
version:             0.0.4.0
git:                 https://github.com/bryal/carth
homepage:            https://carth.jo.zone
license:             AGPL-3.0-or-later
author:              "Johan Johansson"
maintainer:          "jo@jo.zone"
copyright:           "2020 Johan Johansson"

extra-source-files:
- README.org
- CHANGELOG.org

# Metadata used when publishing your package
# synopsis:            Short description of your package
# category:            Web

# To avoid duplicated efforts in documentation and dealing with the
# complications of embedding Haddock markup inside cabal files, it is
# common to point users to the README.md file.
description:         Please see the README on GitHub at <https://github.com/bryal/carth#readme>

dependencies:
- base
- megaparsec
- containers
- mtl
- microlens-platform
- llvm-hs-pure
- llvm-hs
- filepath
- directory
- bytestring
- utf8-string
- process
- template-haskell

library:
  source-dirs: src
  ghc-options:
  - -Weverything
  - -Werror
  - -Wno-safe
  - -Wno-unsafe
  - -Wno-missing-import-lists
  - -Wno-missing-exported-signatures
  - -Wno-missing-local-signatures
  - -Wno-monomorphism-restriction
  - -Wno-implicit-prelude
  - -Wno-name-shadowing
  - -Wno-orphans
  - -Wno-missed-specialisations
  - -Wno-all-missed-specialisations
  - -Wno-unticked-promoted-constructors

executables:
  carth:
    main:                Main.hs
    source-dirs:         app
    ghc-options:
    - -threaded
    - -rtsopts
    - -with-rtsopts=-N
    - -Weverything
    - -Werror
    - -Wno-safe
    - -Wno-unsafe
    - -Wno-missing-import-lists
    - -Wno-missing-exported-signatures
    - -Wno-missing-local-signatures
    - -Wno-monomorphism-restriction
    - -Wno-implicit-prelude
    - -Wno-name-shadowing
    - -Wno-orphans
    - -Wno-missed-specialisations
    - -Wno-all-missed-specialisations
    - -Wno-unticked-promoted-constructors
    dependencies:
    - carth

tests:
  carth-test:
    main:                Spec.hs
    source-dirs:         test
    ghc-options:
    - -threaded
    - -rtsopts
    - -with-rtsopts=-N
    - -Weverything
    - -Werror
    - -Wno-safe
    - -Wno-unsafe
    - -Wno-missing-import-lists
    - -Wno-missing-exported-signatures
    - -Wno-missing-export-lists
    - -Wno-missing-local-signatures
    - -Wno-missing-signatures
    - -Wno-monomorphism-restriction
    - -Wno-implicit-prelude
    - -Wno-name-shadowing
    - -Wno-orphans
    - -Wno-missed-specialisations
    - -Wno-all-missed-specialisations
    - -Wno-unticked-promoted-constructors
    dependencies:
    - carth
    - hspec
    - hspec-discover
    - QuickCheck