summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvmchale <>2018-05-15 02:56:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-05-15 02:56:00 (GMT)
commiteb4eb019f9ac51bdbc0c12c14c15fb72f333a71e (patch)
tree748f793ec92f141410dc4c70b5d0ecd118ac2e62
parentba11ad39ede0173fa76aee32d71d3a7a1b6766e2 (diff)
version 1.8.0.51.8.0.5
-rw-r--r--shake-ats.cabal5
-rw-r--r--src/Development/Shake/ATS.hs10
-rw-r--r--src/Development/Shake/ATS/Generate.hs2
-rw-r--r--src/Development/Shake/ATS/Type.hs4
4 files changed, 11 insertions, 10 deletions
diff --git a/shake-ats.cabal b/shake-ats.cabal
index 1d60778..d69b87d 100644
--- a/shake-ats.cabal
+++ b/shake-ats.cabal
@@ -1,6 +1,6 @@
cabal-version: 1.18
name: shake-ats
-version: 1.8.0.4
+version: 1.8.0.5
license: BSD3
license-file: LICENSE
copyright: Copyright: (c) 2018 Vanessa McHale
@@ -44,7 +44,8 @@ library
shake-ext >=2.9.0.0,
hs2ats >=0.2.0.1,
directory -any,
- lens -any,
+ microlens -any,
+ microlens-th -any,
text -any,
dependency -any,
shake -any,
diff --git a/src/Development/Shake/ATS.hs b/src/Development/Shake/ATS.hs
index 15f7ec9..2620fe3 100644
--- a/src/Development/Shake/ATS.hs
+++ b/src/Development/Shake/ATS.hs
@@ -53,11 +53,11 @@ module Development.Shake.ATS ( -- * Shake Rules
) where
import Control.Arrow
-import Control.Lens
import Control.Monad
import Control.Monad.IO.Class
import Data.Bool (bool)
import Data.Either (fromRight)
+import Data.Foldable (fold)
import Data.Maybe (fromMaybe)
import Data.Semigroup (Semigroup (..))
import qualified Data.Text.Lazy as TL
@@ -69,6 +69,7 @@ import Development.Shake.C
import Development.Shake.FilePath
import Development.Shake.Version
import Language.ATS
+import Lens.Micro
import System.Directory (copyFile, createDirectoryIfMissing, doesFileExist)
import System.Environment (getEnv)
import System.Exit (ExitCode (ExitSuccess))
@@ -142,7 +143,6 @@ cconfig tc libs' gc' extras = do
cc' = _cc tc
f = bool id ("atslib":) (_linkATSLib tc)
h' <- pkgHome cc'
- -- FIXME only bother with atslib if it's unnecessary?
let libs'' = f $ bool libs' ("gc" : libs') gc'
pure $ CConfig [h ++ "/ccomp/runtime/", h, h' ++ "include", ".atspkg/contrib"] libs'' [h' ++ "lib", _patsHome tc ++ "/ccomp/atslib/lib"] extras (_linkStatic tc)
@@ -245,10 +245,10 @@ maybeError p (Left y) = warnErr p y
transitiveDeps :: (MonadIO m) => [FilePath] -> [FilePath] -> m [FilePath]
transitiveDeps _ [] = pure []
-transitiveDeps gen ps = fmap join $ forM ps $ \p -> if p `elem` gen then pure mempty else do
+transitiveDeps gen ps = fmap fold $ forM ps $ \p -> if p `elem` gen then pure mempty else do
contents <- liftIO $ readFile p
- let (ats, err) = (fromRight mempty &&& maybeError p) . parseM $ contents
- err
+ let (ats, err) = (fromRight mempty &&& id) . parseM $ contents
+ maybeError p err
let dir = takeDirectory p
deps <- filterM (\f -> ((f `elem` gen) ||) <$> (liftIO . doesFileExist) f) $ fixDir dir . trim <$> getDependencies ats
deps' <- transitiveDeps gen deps
diff --git a/src/Development/Shake/ATS/Generate.hs b/src/Development/Shake/ATS/Generate.hs
index 0ec6efd..92e2fdc 100644
--- a/src/Development/Shake/ATS/Generate.hs
+++ b/src/Development/Shake/ATS/Generate.hs
@@ -1,8 +1,8 @@
module Development.Shake.ATS.Generate ( generateLinks
) where
-import Control.Lens
import Language.ATS
+import Lens.Micro
generateLinks :: String -> Either ATSError String
generateLinks = fmap (printATS . generateLinks') . parseM
diff --git a/src/Development/Shake/ATS/Type.hs b/src/Development/Shake/ATS/Type.hs
index 9fb9bd1..e3c7391 100644
--- a/src/Development/Shake/ATS/Type.hs
+++ b/src/Development/Shake/ATS/Type.hs
@@ -37,13 +37,13 @@ module Development.Shake.ATS.Type ( ForeignCabal (..)
, patsFlags
) where
-import Control.Lens
import Data.Binary (Binary (..))
import Data.Dependency (Version (..))
import Data.Hashable (Hashable)
import qualified Data.Text.Lazy as TL
import Development.Shake.C
import GHC.Generics (Generic)
+import Lens.Micro.TH
-- We should have four build types:
--
@@ -90,7 +90,7 @@ data ATSToolConfig = ATSToolConfig { _patsHome :: String -- ^ Value to be us
, _linkStatic :: Bool -- ^ Force static linking
, _solver :: Solver
, _linkATSLib :: Bool -- ^ Whether to link against atslib
- , _patsFlags :: [String] -- ^ Additional flags to pass to @patsopt@.
+ , _patsFlags :: [String] -- ^ Additional flags to pass to @patsopt@.
} deriving (Generic, Binary)
data HATSGen = HATSGen { satsFile :: FilePath -- ^ @.sats@ file containing type definitions