diff --git a/.hlint.yaml b/.hlint.yaml index aa6b7289..07a95a59 100644 --- a/.hlint.yaml +++ b/.hlint.yaml @@ -18,6 +18,8 @@ - error: {lhs: "const", rhs: "pure", name: "Use pure"} - error: {lhs: "mapM", rhs: "traverse"} - error: {lhs: "mapM_", rhs: "traverse_"} +- error: {lhs: "if p then x else pure ()", rhs: "when p x"} +- error: {lhs: "if p then pure () else x", rhs: "when (not p) x"} - ignore: {name: Avoid lambda, within: [Language.ATS.Types.Lens]} - ignore: {name: Use <$>, within: [Language.ATS.PrettyPrint]} diff --git a/ats-pkg/CHANGELOG.md b/ats-pkg/CHANGELOG.md index 5345c5ea..86cc1e5a 100644 --- a/ats-pkg/CHANGELOG.md +++ b/ats-pkg/CHANGELOG.md @@ -1,10 +1,12 @@ # ats-pkg -## 3.2.1.1 - - * Don't default to 4 processors +## 3.2.1.2 -## 3.2.1.0 +Bug Fixes: + * Don't default to 4 processors * Use `getAppUserDirectory` for better portability + +Breaking Changes: + * Only build C sources when sensible to do so diff --git a/ats-pkg/ats-pkg.cabal b/ats-pkg/ats-pkg.cabal index 7e29b5ef..e68af340 100644 --- a/ats-pkg/ats-pkg.cabal +++ b/ats-pkg/ats-pkg.cabal @@ -1,6 +1,6 @@ cabal-version: 2.0 name: ats-pkg -version: 3.2.1.2 +version: 3.2.1.3 license: BSD3 license-file: LICENSE copyright: Copyright: (c) 2018 Vanessa McHale diff --git a/ats-pkg/src/Language/ATS/Package.hs b/ats-pkg/src/Language/ATS/Package.hs index 6e7a2724..e240d028 100644 --- a/ats-pkg/src/Language/ATS/Package.hs +++ b/ats-pkg/src/Language/ATS/Package.hs @@ -22,6 +22,7 @@ module Language.ATS.Package ( buildAll , LibDep , DepSelector , PackageError (..) + , Debian (..) -- * Lenses , dirLens ) where @@ -29,6 +30,7 @@ module Language.ATS.Package ( buildAll import Distribution.ATS.Version import Language.ATS.Package.Build import Language.ATS.Package.Compiler +import Language.ATS.Package.Debian import Language.ATS.Package.Dependency import Language.ATS.Package.Error import Language.ATS.Package.PackageSet diff --git a/ats-pkg/src/Language/ATS/Package/Build.hs b/ats-pkg/src/Language/ATS/Package/Build.hs index 09ff2318..72846a57 100644 --- a/ats-pkg/src/Language/ATS/Package/Build.hs +++ b/ats-pkg/src/Language/ATS/Package/Build.hs @@ -92,7 +92,7 @@ mkInstall tgt mStr = zipWithM_ copyFile' (bins ++ libs' ++ incs) (binDest ++ libDest ++ inclDest) pa <- pandoc case man config of - Just mt -> if not pa then pure () else do + Just mt -> when pa $ do let mt' = manTarget mt manDest = home ".local" "share" "man" "man1" takeFileName mt' need [mt'] @@ -100,7 +100,7 @@ mkInstall tgt mStr = Nothing -> pure () co <- compleat case completions config of - Just com -> if not co then pure () else do + Just com -> when co $ do let com' = unpack com comDest = home ".compleat" takeFileName com' need [com'] -- FIXME do this all in one step diff --git a/cabal.project b/cabal.project index 1d40157d..4c36aaee 100644 --- a/cabal.project +++ b/cabal.project @@ -27,6 +27,7 @@ constraints: executable-stripping: true optimization: 2 +documentation: true program-options happy-options: -gcsa diff --git a/language-ats/CHANGELOG.md b/language-ats/CHANGELOG.md index d3879179..647578fc 100644 --- a/language-ats/CHANGELOG.md +++ b/language-ats/CHANGELOG.md @@ -12,7 +12,7 @@ Enhancements: * Better Error messages * Add support for boxed records - * Add support for proof expressions introducing witnesses (`[ m | [] ]`) + * Add support for proof expressions introducing witnesses (`[ m | () ]`) Bug Fixes: diff --git a/shake-ats/shake-ats.cabal b/shake-ats/shake-ats.cabal index b6235857..3c52731e 100644 --- a/shake-ats/shake-ats.cabal +++ b/shake-ats/shake-ats.cabal @@ -1,6 +1,6 @@ cabal-version: 1.18 name: shake-ats -version: 1.9.0.2 +version: 1.9.0.3 license: BSD3 license-file: LICENSE copyright: Copyright: (c) 2018 Vanessa McHale @@ -13,6 +13,7 @@ description: category: Development, Build, ATS, Shake build-type: Simple extra-doc-files: README.md + CHANGELOG.md source-repository head type: darcs diff --git a/shake-ats/src/Development/Shake/ATS/Environment.hs b/shake-ats/src/Development/Shake/ATS/Environment.hs index 4ff7698a..96553eea 100644 --- a/shake-ats/src/Development/Shake/ATS/Environment.hs +++ b/shake-ats/src/Development/Shake/ATS/Environment.hs @@ -7,7 +7,7 @@ import Control.Monad.IO.Class import qualified Data.Text.Lazy as TL import Development.Shake.C import Development.Shake.FilePath -import System.Environment (getEnv) +import System.Directory -- | Given a C compiler, return the appropriate directory for its globally -- installed artifacts. This is used to keep libraries built for different @@ -18,7 +18,7 @@ ccToDir _ = "" -- | The directory @~/.atspkg@ pkgHome :: MonadIO m => CCompiler -> m String -pkgHome cc' = liftIO $ ( (".atspkg" ccToDir cc')) <$> getEnv "HOME" +pkgHome cc' = liftIO $ getAppUserDataDirectory ("atspkg" ccToDir cc') fixDir :: FilePath -> String -> String fixDir p = diff --git a/shake-ext/src/Development/Shake/Linters.hs b/shake-ext/src/Development/Shake/Linters.hs index 52f896e1..120d1dfa 100644 --- a/shake-ext/src/Development/Shake/Linters.hs +++ b/shake-ext/src/Development/Shake/Linters.hs @@ -16,6 +16,7 @@ module Development.Shake.Linters ( tomlcheck , module Development.Shake.FileDetect ) where +import Control.Monad (when) import Data.Char (isSpace) import Data.Foldable (traverse_) import Development.Shake @@ -39,7 +40,7 @@ checkIdempotent :: String -> FilePath -> Action () checkIdempotent s p = do contents <- liftIO $ readFile p (Stdout out) <- cmd (s ++ " " ++ p) - if trim contents == trim out then pure () else error "formatter is not fully applied!" + when (trim contents /= trim out) (error "formatter is not fully applied!") -- | Check that given files are formatted according to @stylish-haskell@ stylishHaskell :: [FilePath] -> Action ()