diff --git a/.gitignore b/.gitignore index a774166..c3e127b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ elisp/*.elc *~ /.cabal-sandbox/ /.stack-work/ +/test/data/**/stack.yaml add-source-timestamps package.cache cabal.sandbox.config @@ -19,4 +20,3 @@ cabal.sandbox.config cabal-dev /TAGS /tags -/cabal.project.local diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5c690f7..0beac30 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,20 +1,22 @@ stages: - build -before_script: - - cabal update - - mkdir -p ../ghc-mod.sdist - - ls -l .. - - touch ChangeLog - - cabal sdist --output-directory=../ghc-mod.sdist - - rm -f cabal.sandbox.config && cabal sandbox init - - cp cabal.sandbox.config ../ghc-mod.sdist - - cd ../ghc-mod.sdist +.before_script_template: &common_before_script + before_script: + - ls -l .. + - apt-get update && apt-get install alex happy + - mkdir -p ../ghc-mod.sdist-$CI_PIPELINE_ID + - touch ChangeLog + - cabal update + - cabal sdist --output-directory=../ghc-mod.sdist-$CI_PIPELINE_ID + - cd ../ghc-mod.sdist-$CI_PIPELINE_ID after_script: - - rm -rf "$CI_PROJECT_DIR"/../ghc-mod.sdist + - cd "$CI_PROJECT_DIR" + - ghc-pkg list | tee packages.list + - rm -rf "$CI_PROJECT_DIR"/../ghc-mod.sdist-$CI_PIPELINE_ID -.job_template: &common_script +.script_template: &common_script script: - echo $PWD - ghc-pkg list @@ -23,24 +25,50 @@ after_script: - cabal --version - cabal configure --enable-tests - cabal build -j2 - - ghc-pkg list - which cabal - cabal --version - ./dist/build/spec/spec - ./dist/build/doctest/doctest - cabal haddock -job-ghc801: - image: haskell:8.0.1 +.artifacts_template: &common_artifacts + artifacts: + paths: + - packages.list + - ~/.cabal/logs + when: always + +job-ghc800: + image: registry.gitlab.com/dxld/ghc-mod:ghc8.0.2-cabal-install1.24.0.2 stage: build + <<: *common_before_script <<: *common_script + <<: *common_artifacts job-ghc710: - image: haskell:7.10.3 + image: registry.gitlab.com/dxld/ghc-mod:ghc7.10.3-cabal-install1.22.8.0 stage: build + <<: *common_before_script <<: *common_script + <<: *common_artifacts job-ghc708: - image: haskell:7.8.4 + image: registry.gitlab.com/dxld/ghc-mod:ghc7.8.4-cabal-install1.18.1.0 stage: build + <<: *common_before_script <<: *common_script + <<: *common_artifacts + + +job-ghc706: + image: registry.gitlab.com/dxld/ghc-mod:ghc7.6.3-cabal-install1.18.1.0 + stage: build + before_script: + - cabal update + - cabal install alex + - cabal install happy + - cp ~/.cabal/bin/{alex,happy} /usr/local/bin + - rm -rf ~/.cabal/{bin,lib,libexec,setup-exe-cache,share,store} ~/.ghc + allow_failure: true + <<: *common_script + <<: *common_artifacts \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 9d870b0..555a56c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,59 +1,68 @@ -language: haskell -ghc: - - 7.6 - - 7.8 - +language: c sudo: false -addons: - apt: - packages: - - zlib1g-dev - cache: apt: true directories: - - ~/.cabal - - ~/.ghc - - ~/.stack + - $HOME/.stack + - $HOME/.ghc-mod -before_cache: - - rm -f $HOME/.cabal/logs $HOME/.cabal/packages/*/build-reports.log +addons: + apt: + packages: + - libfcgi-dev + - libgmp-dev before_install: - - wget https://github.com/commercialhaskell/stack/releases/download/v0.1.3.1/stack-0.1.3.1-x86_64-linux.gz - - mkdir stack-bin - - gunzip stack-0.1.3.1-x86_64-linux.gz - - mv stack-0.1.3.1-x86_64-linux stack-bin/stack - - chmod +x stack-bin/stack - - export PATH=$(pwd)/stack-bin:$PATH + - unset CC + - mkdir -p ~/.local/bin + - export PATH=$HOME/.local/bin:$PATH + - travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack' - stack --version install: - - export CABAL_VER="$(ghc-pkg describe ghc | sed -n '/^depends:/,/^[a-z]/p' | head -n-1 | sed '1{s/^depends://}' | grep " *Cabal" | tr -d "[:space:]" | sed 's/^Cabal-\([0-9.]*\)-.*/\1/g')" - - echo $CABAL_VER - - cabal update - - cabal install happy - - happy --version - - git clone --depth=1 https://github.com/DanielG/cabal-helper.git - - cabal install cabal-helper/ --constraint "Cabal == ${CABAL_VER}" - - cabal install -j --only-dependencies --enable-tests + # - git clone --depth=1 https://github.com/DanielG/cabal-helper.git + - stack --no-terminal setup --resolver=ghc-$GHCVER + - stack --no-terminal install cabal-install --resolver=$RES + - travis_retry cabal update + - stack --no-terminal install happy --resolver=$RES + - | + resf="ghc-$GHCVER.yaml" + echo "resolver: ghc-$GHCVER" > "$resf" + echo "packages: ['.']" >> "$resf" + stack --no-terminal solver --update-config --stack-yaml="$resf" || exit 101 + sed -i 's/^resolver:/compiler:/;s/^extra-deps:/packages:/' "$resf" + echo "resolver: { name: 'ghc-$GHCVER', location: './$resf' }" > stack.yaml + echo "packages: ['.']" >> stack.yaml + ir=$( stack path --snapshot-install-root ) + ls -d ${ir%/custom-ghc-*}/custom-ghc-* | grep -v "${ir%/*}" | while read i; do + rm -rfv "$i" + done script: - - touch ChangeLog # Create ChangeLog if we're not on the release branch - cabal check - - cabal sdist - - export SRC_TGZ="$PWD/dist/$(cabal info . | awk '{print $2 ".tar.gz";exit}')" - - rm -rf /tmp/test && mkdir -p /tmp/test - - cd /tmp/test - - tar -xf $SRC_TGZ && cd ghc-mod*/ - - if [ -n "$(ghc --version | awk '{ print $8 }' | sed -n '/^7.8/p')" ]; then export WERROR="--ghc-option=-Werror"; fi - - cabal configure --enable-tests $WERROR - - cabal build - - export ghc_mod_datadir=$PWD - - cabal test + - | + case "$TRAVIS_BRANCH" in + "release"*) + touch ChangeLog + sdistdir="$TRAVIS_BUILD_DIR/../sdist-test" + mkdir -p "$sdistdir" + tar zvxf $(stack sdist 2>&1 | tail -n1 | sed 's/.* //') --strip-components=1 -C "$sdistdir" + cp "ghc-$GHCVER.yaml" stack.yaml "$sdistdir" + cd "$sdistdir" + ;; + esac + - stack --no-terminal build --test --no-run-tests + - export DOCTEST_DIST_DIR="$(stack path --dist-dir)" + - stack --no-terminal test matrix: - allow_failures: - - env: GHCVER=head + matrix: + include: + - env: GHCVER=7.8.4 RES=lts-2.22 + compiler: ': #GHC 7.8.4' + - env: GHCVER=7.10.3 RES=lts-6.9 + compiler: ': #GHC 7.10.3' + - env: GHCVER=8.0.1 RES=nightly-2016-08-01 + compiler: ': #GHC 8.0.1' diff --git a/Language/Haskell/GhcMod.hs b/GhcMod.hs similarity index 70% rename from Language/Haskell/GhcMod.hs rename to GhcMod.hs index 44d78f8..551e30b 100644 --- a/Language/Haskell/GhcMod.hs +++ b/GhcMod.hs @@ -1,6 +1,6 @@ -- | The ghc-mod library. -module Language.Haskell.GhcMod ( +module GhcMod ( -- * Cradle Cradle(..) , Project(..) @@ -69,24 +69,24 @@ module Language.Haskell.GhcMod ( , unloadMappedFile ) where -import Language.Haskell.GhcMod.Boot -import Language.Haskell.GhcMod.Browse -import Language.Haskell.GhcMod.CaseSplit -import Language.Haskell.GhcMod.Check +import GhcModExe.Boot +import GhcModExe.Browse +import GhcModExe.CaseSplit +import GhcModExe.Check +import GhcModExe.Debug +import GhcModExe.FillSig +import GhcModExe.Find +import GhcModExe.Flag +import GhcModExe.Info +import GhcModExe.Lang +import GhcModExe.Lint +import GhcModExe.Modules +import GhcModExe.PkgDoc +import GhcModExe.Test import Language.Haskell.GhcMod.Cradle -import Language.Haskell.GhcMod.Debug -import Language.Haskell.GhcMod.FillSig -import Language.Haskell.GhcMod.Find -import Language.Haskell.GhcMod.Flag -import Language.Haskell.GhcMod.Info -import Language.Haskell.GhcMod.Lang -import Language.Haskell.GhcMod.Lint -import Language.Haskell.GhcMod.Logging -import Language.Haskell.GhcMod.Modules -import Language.Haskell.GhcMod.Monad -import Language.Haskell.GhcMod.PkgDoc -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Target -import Language.Haskell.GhcMod.Output import Language.Haskell.GhcMod.FileMapping -import Language.Haskell.GhcMod.Test +import Language.Haskell.GhcMod.Logging +import Language.Haskell.GhcMod.Monad +import Language.Haskell.GhcMod.Output +import Language.Haskell.GhcMod.Target +import Language.Haskell.GhcMod.Types diff --git a/Language/Haskell/GhcMod/Boot.hs b/GhcModExe/Boot.hs similarity index 75% rename from Language/Haskell/GhcMod/Boot.hs rename to GhcModExe/Boot.hs index b4652c7..35c43d3 100644 --- a/Language/Haskell/GhcMod/Boot.hs +++ b/GhcModExe/Boot.hs @@ -1,12 +1,13 @@ -module Language.Haskell.GhcMod.Boot where +module GhcModExe.Boot where import Control.Applicative import Prelude -import Language.Haskell.GhcMod.Browse -import Language.Haskell.GhcMod.Flag -import Language.Haskell.GhcMod.Lang + +import GhcModExe.Browse +import GhcModExe.Flag +import GhcModExe.Lang +import GhcModExe.Modules import Language.Haskell.GhcMod.Monad -import Language.Haskell.GhcMod.Modules import Language.Haskell.GhcMod.Types (defaultBrowseOpts) -- | Printing necessary information for front-end booting. diff --git a/Language/Haskell/GhcMod/Browse.hs b/GhcModExe/Browse.hs similarity index 98% rename from Language/Haskell/GhcMod/Browse.hs rename to GhcModExe/Browse.hs index 53bf2d4..d09666b 100644 --- a/Language/Haskell/GhcMod/Browse.hs +++ b/GhcModExe/Browse.hs @@ -1,5 +1,5 @@ {-# LANGUAGE CPP #-} -module Language.Haskell.GhcMod.Browse ( +module GhcModExe.Browse ( browse, BrowseOpts(..) ) where @@ -46,7 +46,7 @@ browse opts pkgmdl = do goPkgModule `G.gcatch` (\(SomeException _) -> goHomeModule) logException ex = - gmLog GmException "browse" $ showDoc ex + gmLog GmException "browse" $ showToDoc ex goPkgModule = do runGmPkgGhc $ diff --git a/Language/Haskell/GhcMod/CaseSplit.hs b/GhcModExe/CaseSplit.hs similarity index 99% rename from Language/Haskell/GhcMod/CaseSplit.hs rename to GhcModExe/CaseSplit.hs index d3ea112..02562aa 100644 --- a/Language/Haskell/GhcMod/CaseSplit.hs +++ b/GhcModExe/CaseSplit.hs @@ -1,6 +1,6 @@ {-# LANGUAGE CPP #-} -module Language.Haskell.GhcMod.CaseSplit ( +module GhcModExe.CaseSplit ( splits ) where @@ -70,7 +70,7 @@ splits file lineNo colNo = where handler (SomeException ex) = do gmLog GmException "splits" $ - text "" $$ nest 4 (showDoc ex) + text "" $$ nest 4 (showToDoc ex) emptyResult =<< outputOpts ---------------------------------------------------------------- diff --git a/Language/Haskell/GhcMod/Check.hs b/GhcModExe/Check.hs similarity index 97% rename from Language/Haskell/GhcMod/Check.hs rename to GhcModExe/Check.hs index 1cf52a2..dcb6868 100644 --- a/Language/Haskell/GhcMod/Check.hs +++ b/GhcModExe/Check.hs @@ -1,4 +1,4 @@ -module Language.Haskell.GhcMod.Check ( +module GhcModExe.Check ( checkSyntax , check , expandTemplate diff --git a/Language/Haskell/GhcMod/Debug.hs b/GhcModExe/Debug.hs similarity index 78% rename from Language/Haskell/GhcMod/Debug.hs rename to GhcModExe/Debug.hs index 9811e72..39f63e5 100644 --- a/Language/Haskell/GhcMod/Debug.hs +++ b/GhcModExe/Debug.hs @@ -1,4 +1,4 @@ -module Language.Haskell.GhcMod.Debug (debugInfo, rootInfo, componentInfo) where +module GhcModExe.Debug (debugInfo, rootInfo, componentInfo) where import Control.Arrow (first) import Control.Applicative @@ -6,23 +6,25 @@ import Control.Monad import qualified Data.Map as Map import qualified Data.Set as Set import Data.Char +import Data.Maybe import Data.Version import Data.List.Split import System.Directory -import Text.PrettyPrint -import Language.Haskell.GhcMod.Monad -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Internal -import Language.Haskell.GhcMod.Target -import Language.Haskell.GhcMod.Pretty -import Language.Haskell.GhcMod.Utils + +import GhcModExe.Internal import Language.Haskell.GhcMod.Cradle -import Language.Haskell.GhcMod.Stack +import Language.Haskell.GhcMod.Monad import Language.Haskell.GhcMod.Output +import Language.Haskell.GhcMod.Pretty +import Language.Haskell.GhcMod.Stack +import Language.Haskell.GhcMod.Target +import Language.Haskell.GhcMod.Types +import Language.Haskell.GhcMod.Utils import Paths_ghc_mod (version) import Config (cProjectVersion) +import Pretty ---------------------------------------------------------------- @@ -32,10 +34,17 @@ debugInfo = do Options {..} <- options Cradle {..} <- cradle + [ghcPath, ghcPkgPath] <- liftIO $ + case cradleProject of + StackProject se -> + catMaybes <$> sequence [getStackGhcPath se, getStackGhcPkgPath se] + _ -> + return ["ghc", "ghc-pkg"] + cabal <- case cradleProject of - CabalProject -> cabalDebug - StackProject {} -> (++) <$> stackPaths <*> cabalDebug + CabalProject -> cabalDebug ghcPkgPath + StackProject {} -> (++) <$> stackPaths <*> cabalDebug ghcPkgPath _ -> return [] pkgOpts <- packageGhcOptions @@ -43,7 +52,7 @@ debugInfo = do readProc <- gmReadProcess ghcVersion <- liftIO $ - dropWhileEnd isSpace <$> readProc "ghc" ["--numeric-version"] "" + dropWhileEnd isSpace <$> readProc ghcPath ["--numeric-version"] "" return $ unlines $ [ "Version: ghc-mod-" ++ showVersion version @@ -51,7 +60,7 @@ debugInfo = do , "System GHC Version: " ++ ghcVersion , "Root directory: " ++ cradleRootDir , "Current directory: " ++ cradleCurrentDir - , "GHC Package flags:\n" ++ render (nest 4 $ + , "GHC Package flags:\n" ++ renderGm (nest 4 $ fsep $ map text pkgOpts) , "GHC System libraries: " ++ ghcLibDir ] ++ cabal @@ -66,8 +75,8 @@ stackPaths = do , "Stack ghc-pkg executable:" ++ show ghcPkg ] -cabalDebug :: IOish m => GhcModT m [String] -cabalDebug = do +cabalDebug :: IOish m => FilePath -> GhcModT m [String] +cabalDebug ghcPkgPath = do Cradle {..} <- cradle mcs <- cabalResolvedComponents let entrypoints = Map.map gmcEntrypoints mcs @@ -84,22 +93,22 @@ cabalDebug = do dropWhileEnd isSpace <$> readProc "cabal" ["--numeric-version"] "" else return "" - packages <- liftIO $ readProc "ghc-pkg" ["list", "--simple-output"] "" + packages <- liftIO $ readProc ghcPkgPath ["list", "--simple-output"] "" let cabalPackages = filter ((== ["Cabal"]) . take 1 . splitOn "-") $ splitWhen isSpace packages return $ [ "cabal-install Version: " ++ cabalInstVersion - , "Cabal Library Versions:\n" ++ render (nest 4 $ + , "Cabal Library Versions:\n" ++ renderGm (nest 4 $ fsep $ map text cabalPackages) , "Cabal file: " ++ show cradleCabalFile , "Project: " ++ show cradleProject - , "Cabal entrypoints:\n" ++ render (nest 4 $ + , "Cabal entrypoints:\n" ++ renderGm (nest 4 $ mapDoc gmComponentNameDoc smpDoc entrypoints) - , "Cabal components:\n" ++ render (nest 4 $ + , "Cabal components:\n" ++ renderGm (nest 4 $ mapDoc gmComponentNameDoc graphDoc graphs) - , "GHC Cabal options:\n" ++ render (nest 4 $ + , "GHC Cabal options:\n" ++ renderGm (nest 4 $ mapDoc gmComponentNameDoc (fsep . map text) opts) - , "GHC search path options:\n" ++ render (nest 4 $ + , "GHC search path options:\n" ++ renderGm (nest 4 $ mapDoc gmComponentNameDoc (fsep . map text) srcOpts) ] @@ -117,11 +126,11 @@ componentInfo ts = do opts <- targetGhcOptions crdl sefnmn return $ unlines $ - [ "Matching Components:\n" ++ render (nest 4 $ + [ "Matching Components:\n" ++ renderGm (nest 4 $ alistDoc (either text mnDoc) (setDoc gmComponentNameDoc) mdlcs) - , "Picked Component:\n" ++ render (nest 4 $ + , "Picked Component:\n" ++ renderGm (nest 4 $ gmComponentNameDoc cn) - , "GHC Cabal options:\n" ++ render (nest 4 $ fsep $ map text opts) + , "GHC Cabal options:\n" ++ renderGm (nest 4 $ fsep $ map text opts) ] where zipMap f l = l `zip` (f `map` l) @@ -169,4 +178,5 @@ mapDoc kd ad m = vcat $ rootInfo :: forall m. (IOish m, GmOut m, GmEnv m) => m String rootInfo = do crdl <- findCradleNoLog =<< (optPrograms <$> options) + liftIO $ cleanupCradle crdl return $ cradleRootDir crdl ++ "\n" diff --git a/Language/Haskell/GhcMod/FillSig.hs b/GhcModExe/FillSig.hs similarity index 98% rename from Language/Haskell/GhcMod/FillSig.hs rename to GhcModExe/FillSig.hs index 7b4f3ba..0172a3b 100644 --- a/Language/Haskell/GhcMod/FillSig.hs +++ b/GhcModExe/FillSig.hs @@ -1,7 +1,7 @@ {-# LANGUAGE CPP, MultiParamTypeClasses, FunctionalDependencies #-} {-# LANGUAGE FlexibleInstances #-} -module Language.Haskell.GhcMod.FillSig ( +module GhcModExe.FillSig ( sig , refine , auto @@ -13,12 +13,12 @@ import Data.Functor import Data.List (find, nub, sortBy) import qualified Data.Map as M import Data.Maybe (catMaybes) -import Text.PrettyPrint (($$), text, nest) import Prelude import Exception (ghandle, SomeException(..)) import GHC (GhcMonad, Id, ParsedModule(..), TypecheckedModule(..), DynFlags, SrcSpan, Type, GenLocated(L)) +import Pretty (($$), text, nest) import qualified GHC as G import qualified Name as G import Outputable (PprStyle) @@ -27,11 +27,7 @@ import qualified HsBinds as Ty import qualified Class as Ty import qualified Var as Ty import qualified HsPat as Ty -#if MIN_VERSION_haskell_src_exts(1,18,0) import qualified Language.Haskell.Exts as HE -#else -import qualified Language.Haskell.Exts.Annotated as HE -#endif import Djinn.GHC import qualified Language.Haskell.GhcMod.Gap as Gap @@ -40,7 +36,7 @@ import Language.Haskell.GhcMod.DynFlags import Language.Haskell.GhcMod.Monad import Language.Haskell.GhcMod.SrcUtils import Language.Haskell.GhcMod.Logging (gmLog) -import Language.Haskell.GhcMod.Pretty (showDoc) +import Language.Haskell.GhcMod.Pretty (showToDoc) import Language.Haskell.GhcMod.Doc import Language.Haskell.GhcMod.Types import Language.Haskell.GhcMod.FileMapping (fileModSummaryWithMapping) @@ -195,11 +191,7 @@ getSignatureFromHE file lineNo colNo = do HE.TypeSig (HE.SrcSpanInfo s _) names ty -> return $ HESignature s names ty -#if MIN_VERSION_haskell_src_exts(1,18,0) HE.TypeFamDecl (HE.SrcSpanInfo s _) declHead _ _ -> -#else - HE.TypeFamDecl (HE.SrcSpanInfo s _) declHead _ -> -#endif let (name, tys) = dHeadTyVars declHead in return $ HEFamSignature s Open name (map cleanTyVarBind tys) @@ -386,7 +378,7 @@ refine file lineNo colNo (Expression expr) = where handler (SomeException ex) = do gmLog GmException "refining" $ - text "" $$ nest 4 (showDoc ex) + text "" $$ nest 4 (showToDoc ex) emptyResult =<< outputOpts -- Look for the variable in the specified position @@ -483,7 +475,7 @@ auto file lineNo colNo = where handler (SomeException ex) = do gmLog GmException "auto-refining" $ - text "" $$ nest 4 (showDoc ex) + text "" $$ nest 4 (showToDoc ex) emptyResult =<< outputOpts -- Functions we do not want in completions diff --git a/Language/Haskell/GhcMod/Find.hs b/GhcModExe/Find.hs similarity index 91% rename from Language/Haskell/GhcMod/Find.hs rename to GhcModExe/Find.hs index 23462aa..3e0a7fd 100644 --- a/Language/Haskell/GhcMod/Find.hs +++ b/GhcModExe/Find.hs @@ -1,7 +1,6 @@ {-# LANGUAGE CPP, BangPatterns, TupleSections, DeriveGeneric #-} -module Language.Haskell.GhcMod.Find -#ifndef SPEC +module GhcModExe.Find ( Symbol , SymbolDb , loadSymbolDb @@ -14,9 +13,7 @@ module Language.Haskell.GhcMod.Find , AsyncSymbolDb , newAsyncSymbolDb , getAsyncSymbolDb - ) -#endif - where + ) where import qualified GHC as G import FastString @@ -135,7 +132,7 @@ loadSymbolDb = do dumpSymbol :: IOish m => GhcModT m () dumpSymbol = do ts <- liftIO getCurrentModTime - st <- runGmPkgGhc $ (liftIO . getGlobalSymbolTable) =<< G.getSession + st <- runGmPkgGhc $ getGlobalSymbolTable liftIO . LBS.putStr $ encode SymbolDb { sdTable = st , sdTimestamp = ts @@ -148,19 +145,20 @@ isOlderThan tCache files = any (tCache <=) $ map tfTime files -- including equal just in case -- | Browsing all functions in all system modules. -getGlobalSymbolTable :: HscEnv -> IO (Map Symbol (Set ModuleNameBS)) -getGlobalSymbolTable hsc_env = - foldM (extend hsc_env) M.empty $ listVisibleModules $ hsc_dflags hsc_env +getGlobalSymbolTable :: (G.GhcMonad m, MonadIO m) + => m (Map Symbol (Set ModuleNameBS)) +getGlobalSymbolTable = + foldM extend M.empty =<< (listVisibleModules <$> G.getSessionDynFlags) -extend :: HscEnv - -> Map Symbol (Set ModuleNameBS) +extend :: (G.GhcMonad m, MonadIO m) + => Map Symbol (Set ModuleNameBS) -> Module - -> IO (Map Symbol (Set ModuleNameBS)) -extend hsc_env mm mdl = do - eps <- readIORef $ hsc_EPS hsc_env - modinfo <- unsafeInterleaveIO $ runLightGhc hsc_env $ do + -> m (Map Symbol (Set ModuleNameBS)) +extend mm mdl = do + hsc_env <- G.getSession + eps <- liftIO $ readIORef $ hsc_EPS hsc_env + modinfo <- liftIO $ unsafeInterleaveIO $ runLightGhc hsc_env $ do G.getModuleInfo mdl <* liftIO (writeIORef (hsc_EPS hsc_env) eps) - return $ M.unionWith S.union mm $ extractBindings modinfo mdl extractBindings :: Maybe G.ModuleInfo diff --git a/Language/Haskell/GhcMod/Flag.hs b/GhcModExe/Flag.hs similarity index 87% rename from Language/Haskell/GhcMod/Flag.hs rename to GhcModExe/Flag.hs index 24cb61b..1a09f77 100644 --- a/Language/Haskell/GhcMod/Flag.hs +++ b/GhcModExe/Flag.hs @@ -1,4 +1,4 @@ -module Language.Haskell.GhcMod.Flag where +module GhcModExe.Flag where import qualified Language.Haskell.GhcMod.Gap as Gap import Language.Haskell.GhcMod.Convert diff --git a/Language/Haskell/GhcMod/Info.hs b/GhcModExe/Info.hs similarity index 94% rename from Language/Haskell/GhcMod/Info.hs rename to GhcModExe/Info.hs index dc18f7c..0b635ae 100644 --- a/Language/Haskell/GhcMod/Info.hs +++ b/GhcModExe/Info.hs @@ -1,4 +1,4 @@ -module Language.Haskell.GhcMod.Info ( +module GhcModExe.Info ( info , types ) where @@ -10,8 +10,8 @@ import Exception (ghandle, SomeException(..)) import GHC (GhcMonad, SrcSpan) import Prelude import qualified GHC as G -import qualified Language.Haskell.GhcMod.Gap as Gap +import qualified Language.Haskell.GhcMod.Gap as Gap import Language.Haskell.GhcMod.Convert import Language.Haskell.GhcMod.Doc import Language.Haskell.GhcMod.DynFlags @@ -37,7 +37,7 @@ info file expr = convert' =<< body where handler (SomeException ex) = do - gmLog GmException "info" $ text "" $$ nest 4 (showDoc ex) + gmLog GmException "info" $ text "" $$ nest 4 (showToDoc ex) convert' "Cannot show info" body :: (GhcMonad m, GmState m, GmEnv m) => m String @@ -69,7 +69,7 @@ types withConstraints file lineNo colNo = convert' $ map (toTup dflag st) $ sortBy (cmp `on` fst) srcSpanTypes where handler (SomeException ex) = do - gmLog GmException "types" $ showDoc ex + gmLog GmException "types" $ showToDoc ex return [] getSrcSpanType :: (GhcMonad m) => Bool -> G.ModSummary -> Int -> Int -> m [(SrcSpan, G.Type)] diff --git a/Language/Haskell/GhcMod/Internal.hs b/GhcModExe/Internal.hs similarity index 97% rename from Language/Haskell/GhcMod/Internal.hs rename to GhcModExe/Internal.hs index 2aa4e1b..d310690 100644 --- a/Language/Haskell/GhcMod/Internal.hs +++ b/GhcModExe/Internal.hs @@ -1,6 +1,6 @@ -- | Low level access to the ghc-mod library. -module Language.Haskell.GhcMod.Internal ( +module GhcModExe.Internal ( -- * Types GHCOption , IncludeDir diff --git a/Language/Haskell/GhcMod/Lang.hs b/GhcModExe/Lang.hs similarity index 85% rename from Language/Haskell/GhcMod/Lang.hs rename to GhcModExe/Lang.hs index badecbd..0a5ac4b 100644 --- a/Language/Haskell/GhcMod/Lang.hs +++ b/GhcModExe/Lang.hs @@ -1,4 +1,4 @@ -module Language.Haskell.GhcMod.Lang where +module GhcModExe.Lang where import DynFlags (supportedLanguagesAndExtensions) import Language.Haskell.GhcMod.Convert diff --git a/Language/Haskell/GhcMod/Lint.hs b/GhcModExe/Lint.hs similarity index 52% rename from Language/Haskell/GhcMod/Lint.hs rename to GhcModExe/Lint.hs index 0ffe713..12237a9 100644 --- a/Language/Haskell/GhcMod/Lint.hs +++ b/GhcModExe/Lint.hs @@ -1,4 +1,4 @@ -module Language.Haskell.GhcMod.Lint where +module GhcModExe.Lint where import Exception (ghandle) import Control.Exception (SomeException(..)) @@ -9,8 +9,7 @@ import Language.Haskell.GhcMod.Monad import Language.Haskell.HLint3 import Language.Haskell.GhcMod.Utils (withMappedFile) -import Language.Haskell.Exts.SrcLoc (SrcLoc(..)) -import System.IO +import Language.Haskell.Exts.SrcLoc (SrcSpan(..)) -- | Checking syntax of a target file using hlint. -- Warnings and errors are returned. @@ -20,15 +19,12 @@ lint :: IOish m -> GhcModT m String lint opt file = ghandle handler $ withMappedFile file $ \tempfile -> do - (flags, classify, hint) <- liftIO $ argsSettings $ optLintHlintOpts opt - hSrc <- liftIO $ openFile tempfile ReadMode - liftIO $ hSetEncoding hSrc (encoding flags) - res <- liftIO $ parseModuleEx flags file =<< Just `fmap` hGetContents hSrc - case res of - Right m -> pack . map show $ filter ((/=Ignore) . ideaSeverity) $ applyHints classify hint [m] - Left ParseError{parseErrorLocation=loc, parseErrorMessage=err} -> - return $ showSrcLoc loc ++ ":Error:" ++ err ++ "\n" + res <- liftIO $ hlint $ "--quiet" : tempfile : optLintHlintOpts opt + pack . map (show . substFile file tempfile) $ res where pack = convert' . map init -- init drops the last \n. handler (SomeException e) = return $ checkErrorPrefix ++ show e ++ "\n" - showSrcLoc (SrcLoc f l c) = concat [f, ":", show l, ":", show c] + substFile orig temp idea + | srcSpanFilename (ideaSpan idea) == temp + = idea{ideaSpan=(ideaSpan idea){srcSpanFilename = orig}} + substFile _ _ idea = idea diff --git a/Language/Haskell/GhcMod/Modules.hs b/GhcModExe/Modules.hs similarity index 94% rename from Language/Haskell/GhcMod/Modules.hs rename to GhcModExe/Modules.hs index 7d7365e..80abe7d 100644 --- a/Language/Haskell/GhcMod/Modules.hs +++ b/GhcModExe/Modules.hs @@ -1,4 +1,4 @@ -module Language.Haskell.GhcMod.Modules (modules) where +module GhcModExe.Modules (modules) where import Control.Arrow import Data.List diff --git a/Language/Haskell/GhcMod/PkgDoc.hs b/GhcModExe/PkgDoc.hs similarity index 94% rename from Language/Haskell/GhcMod/PkgDoc.hs rename to GhcModExe/PkgDoc.hs index 6ec5d0d..d10d2d8 100644 --- a/Language/Haskell/GhcMod/PkgDoc.hs +++ b/GhcModExe/PkgDoc.hs @@ -1,4 +1,4 @@ -module Language.Haskell.GhcMod.PkgDoc (pkgDoc) where +module GhcModExe.PkgDoc (pkgDoc) where import Language.Haskell.GhcMod.Types import Language.Haskell.GhcMod.GhcPkg diff --git a/Language/Haskell/GhcMod/Test.hs b/GhcModExe/Test.hs similarity index 96% rename from Language/Haskell/GhcMod/Test.hs rename to GhcModExe/Test.hs index 0e95171..be127e9 100644 --- a/Language/Haskell/GhcMod/Test.hs +++ b/GhcModExe/Test.hs @@ -1,4 +1,4 @@ -module Language.Haskell.GhcMod.Test where +module GhcModExe.Test where import Control.Applicative import Data.List diff --git a/Language/Haskell/GhcMod/DynFlagsTH.hs b/Language/Haskell/GhcMod/DynFlagsTH.hs deleted file mode 100644 index afb2cc5..0000000 --- a/Language/Haskell/GhcMod/DynFlagsTH.hs +++ /dev/null @@ -1,126 +0,0 @@ --- ghc-mod: Making Haskell development *more* fun --- Copyright (C) 2015 Daniel Gröber --- --- This program is free software: you can redistribute it and/or modify --- it under the terms of the GNU Affero General Public License as published by --- the Free Software Foundation, either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU Affero General Public License for more details. --- --- You should have received a copy of the GNU Affero General Public License --- along with this program. If not, see . - -{-# LANGUAGE CPP, TemplateHaskell #-} -module Language.Haskell.GhcMod.DynFlagsTH where - -import Language.Haskell.TH.Syntax -import Control.Applicative -import Data.Maybe -import Data.Generics.Aliases -import Data.Generics.Schemes -import DynFlags -import Prelude - -deriveEqDynFlags :: Q [Dec] -> Q [Dec] -deriveEqDynFlags qds = do -#if __GLASGOW_HASKELL__ <= 710 - ~(TyConI (DataD [] _ [] [ctor] _ )) -#else - ~(TyConI (DataD [] _ [] _ [ctor] _ )) -#endif - <- reify ''DynFlags - let ~(RecC _ fs) = ctor - - a <- newName "a" - b <- newName "b" - - e <- AppE (VarE 'and) . ListE <$> sequence (catMaybes $ map (eq a b) fs) - - tysig@(SigD n _) :_ <- qds - - return $ [tysig, FunD n [Clause [VarP a, VarP b] (NormalB e) []]] - - where - eq :: Name -> Name -> (Name, Strict, Type) -> Maybe (Q Exp) - eq a b (fn@(Name (OccName fon) _), _, ft) - | not (isUneqable || isIgnored) = Just expr - | otherwise = Nothing - where - isUneqable = everything (||) (mkQ False hasUnEqable) ft - - hasUnEqable ArrowT = True - hasUnEqable (ConT (Name (OccName on) _)) - | any (==on) ignoredTypeNames = True - | any (==on) ignoredTypeOccNames = True - hasUnEqable _ = False - - isIgnored = fon `elem` ignoredNames - - ignoredNames = [ "pkgDatabase" -- 7.8 -#if __GLASGOW_HASKELL__ <= 706 - , "ways" -- 'Ways' is not exported :/ -#endif - ] - ignoredTypeNames = - [ "LogAction" - , "PackageState" - , "Hooks" - , "FlushOut" - , "FlushErr" - , "Settings" -- I think these can't cange at runtime - ] - ignoredTypeOccNames = [ "OnOff" ] - - fa = AppE (VarE fn) (VarE a) - fb = AppE (VarE fn) (VarE b) - expr = - case fon of - "rtsOptsEnabled" -> do - eqfn <- [| let eqfn RtsOptsNone RtsOptsNone = True - eqfn RtsOptsSafeOnly RtsOptsSafeOnly = True - eqfn RtsOptsAll RtsOptsAll = True - eqfn _ _ = False - in eqfn - |] - return $ AppE (AppE eqfn fa) fb - -#if __GLASGOW_HASKELL__ >= 710 && __GLASGOW_HASKELL__ < 800 - "sigOf" -> do - eqfn <- [| let eqfn NotSigOf NotSigOf = True - eqfn (SigOf a') (SigOf b') = a' == b' - eqfn (SigOfMap a') (SigOfMap b') = a' == b' - eqfn _ _ = False - in eqfn - |] - return $ AppE (AppE eqfn fa) fb -#endif - -#if __GLASGOW_HASKELL <= 706 - "profAuto" -> do - eqfn <- [| let eqfn NoProfAuto NoProfAuto = True - eqfn ProfAutoAll ProfAutoAll = True - eqfn ProfAutoTop ProfAutoTop = True - eqfn ProfAutoExports ProfAutoExports = True - eqfn ProfAutoCalls ProfAutoCalls = True - eqfn _ _ = False - in eqfn - |] - return $ AppE (AppE eqfn fa) fb -#endif - -#if __GLASGOW_HASKELL__ >= 706 - "language" -> do - eqfn <- [| let eqfn (Just Haskell98) (Just Haskell98) = True - eqfn (Just Haskell2010) (Just Haskell2010) = True - eqfn _ _ = False - in eqfn - |] - return $ AppE (AppE eqfn fa) fb -#endif - - _ -> - return $ InfixE (Just fa) (VarE '(==)) (Just fb) diff --git a/Language/Haskell/GhcMod/LightGhc.hs b/Language/Haskell/GhcMod/LightGhc.hs deleted file mode 100644 index 6c53716..0000000 --- a/Language/Haskell/GhcMod/LightGhc.hs +++ /dev/null @@ -1,48 +0,0 @@ -module Language.Haskell.GhcMod.LightGhc where - -import Control.Monad.Reader (runReaderT) -import Data.IORef - -import GHC -import GHC.Paths (libdir) -import StaticFlags -import SysTools -import DynFlags -import HscMain -import HscTypes - -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Monad.Types -import Language.Haskell.GhcMod.DynFlags - -withLightHscEnv :: forall m a. IOish m - => [GHCOption] -> (HscEnv -> m a) -> m a -withLightHscEnv opts action = gbracket initEnv teardownEnv action - where - teardownEnv :: HscEnv -> m () - teardownEnv env = liftIO $ do - let dflags = hsc_dflags env - cleanTempFiles dflags - cleanTempDirs dflags - - initEnv :: m HscEnv - initEnv = liftIO $ do - initStaticOpts - settings <- initSysTools (Just libdir) - dflags <- initDynFlags (defaultDynFlags settings) - env <- newHscEnv dflags - dflags' <- runLightGhc env $ do - -- HomeModuleGraph and probably all other clients get into all sorts of - -- trouble if the package state isn't initialized here - _ <- setSessionDynFlags =<< addCmdOpts opts =<< getSessionDynFlags - getSessionDynFlags - newHscEnv dflags' - -runLightGhc :: HscEnv -> LightGhc a -> IO a -runLightGhc env action = do - renv <- newIORef env - flip runReaderT renv $ unLightGhc action - -runLightGhc' :: IORef HscEnv -> LightGhc a -> IO a -runLightGhc' renv action = do - flip runReaderT renv $ unLightGhc action diff --git a/NotCPP/COPYING b/NotCPP/COPYING deleted file mode 100644 index 9eb8e81..0000000 --- a/NotCPP/COPYING +++ /dev/null @@ -1,30 +0,0 @@ -Copyright Ben Millwood 2012 - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * Neither the name of Ben Millwood nor the names of other - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/NotCPP/Declarations.hs b/NotCPP/Declarations.hs index 9567689..e8844d1 100644 --- a/NotCPP/Declarations.hs +++ b/NotCPP/Declarations.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015 Daniel Gröber -- -- This program is free software: you can redistribute it and/or modify diff --git a/NotCPP/LookupValueName.hs b/NotCPP/LookupValueName.hs deleted file mode 100644 index b12d08f..0000000 --- a/NotCPP/LookupValueName.hs +++ /dev/null @@ -1,44 +0,0 @@ -{-# LANGUAGE CPP #-} -{-# LANGUAGE TemplateHaskell #-} --- | This module uses scope lookup techniques to either export --- 'lookupValueName' from @Language.Haskell.TH@, or define --- its own 'lookupValueName', which attempts to do the --- same job with just 'reify'. This will sometimes fail, but if it --- succeeds it will give the answer that the real function would have --- given. --- --- The idea is that if you use lookupValueName from this module, --- your client code will automatically use the best available name --- lookup mechanism. This means that e.g. 'scopeLookup' can work --- very well on recent GHCs and less well but still somewhat --- usefully on older GHCs. -module NotCPP.LookupValueName ( - lookupValueName - ) where - -import Language.Haskell.TH - -import NotCPP.Utils - -bestValueGuess :: String -> Q (Maybe Name) -bestValueGuess s = do - mi <- maybeReify (mkName s) - case mi of - Nothing -> no - Just i -> case i of -#if __GLASGOW_HASKELL__ >= 800 - VarI n _ _ -> yes n - DataConI n _ _ -> yes n -#else - VarI n _ _ _ -> yes n - DataConI n _ _ _ -> yes n -#endif - _ -> err ["unexpected info:", show i] - where - no = return Nothing - yes = return . Just - err = fail . showString "NotCPP.bestValueGuess: " . unwords - -$(recover [d| lookupValueName = bestValueGuess |] $ do - VarI{} <- reify (mkName "lookupValueName") - return []) diff --git a/NotCPP/OrphanEvasion.hs b/NotCPP/OrphanEvasion.hs deleted file mode 100644 index d666d7b..0000000 --- a/NotCPP/OrphanEvasion.hs +++ /dev/null @@ -1,114 +0,0 @@ -{-# LANGUAGE EmptyDataDecls, TemplateHaskell #-} --- | --- The orphan instance problem is well-known in Haskell. This module --- by no means purports to solve the problem, but provides a workaround --- that may be significantly less awful than the status quo in some --- cases. --- --- Say I think that the 'Name' type should have an 'IsString' instance. --- But I don't control either the class or the type, so if I define the --- instance, and then the template-haskell package defines one, my code --- is going to break. --- --- 'safeInstance' can help me to solve this problem: --- --- > safeInstance ''IsString [t| Name |] [d| --- > fromString = mkName |] --- --- This will declare an instance only if one doesn't already exist. --- Now anyone importing your module is guaranteed to get an instance --- one way or the other. --- --- This module is still highly experimental. The example given above --- does work, but anything involving type variables or complex method --- bodies may be less fortunate. The names of the methods are mangled --- a bit, so using recursion to define them may not work. Define the --- method outside the code and then use a simple binding as above. --- --- If you use this code (successfully or unsuccessfully!), go fetch --- the maintainer address from the cabal file and let me know! -module NotCPP.OrphanEvasion ( - MultiParams, - safeInstance, - safeInstance', - ) where - -import Control.Applicative - -import Language.Haskell.TH -import Language.Haskell.TH.Syntax - -import NotCPP.ScopeLookup - --- | An empty type used only to signify a multiparameter typeclass in --- 'safeInstance'. -data MultiParams a - --- | Given @(forall ts. Cxt => t)@, return @(Cxt, [t])@. --- Given @(forall ts. Cxt => 'MultiParams' (t1, t2, t3))@, return --- @(Cxt, [t1, t2, t3])@. --- --- This is used in 'safeInstance' to allow types to be specified more --- easily with TH typequotes. -fromTuple :: Type -> (Cxt, [Type]) -fromTuple ty = unTuple <$> case ty of - ForallT _ cxt ty' -> (cxt, ty') - _ -> ([], ty) - where - unTuple :: Type -> [Type] - unTuple (AppT (ConT n) ta) - | n == ''MultiParams = case unrollAppT ta of - (TupleT{}, ts) -> ts - _ -> [ty] - unTuple t = [t] - --- | A helper function to unwind type application. --- Given @TyCon t1 t2 t3@, returns @(TyCon, [t1,t2,t3])@ -unrollAppT :: Type -> (Type, [Type]) -unrollAppT = go [] - where - go acc (AppT tc ta) = go (ta : acc) tc - go acc ty = (ty, reverse acc) - --- | Left inverse to unrollAppT, equal to @'foldl' 'AppT'@ -rollAppT :: Type -> [Type] -> Type -rollAppT = foldl AppT - --- | @'safeInstance'' className cxt types methods@ produces an instance --- of the given class if and only if one doesn't already exist. --- --- See 'safeInstance' for a simple way to construct the 'Cxt' and --- @['Type']@ parameters. -safeInstance' :: Name -> Cxt -> [Type] -> Q [Dec] -> Q [Dec] -safeInstance' cl cxt tys inst = do - b <- $(scopeLookups ["isInstance", "isClassInstance"]) cl tys - if b - then return [] - else do - ds <- map fixInst <$> inst - return [InstanceD cxt (rollAppT (ConT cl) tys) ds] - where - fixInst (FunD n cls) = FunD (fixName n) cls - fixInst (ValD (VarP n) rhs wh) = ValD (VarP (fixName n)) rhs wh - fixInst d = d - fixName (Name n _) = Name n NameS - --- | 'safeInstance' is a more convenient version of 'safeInstance'' --- that takes the context and type from a @'Q' 'Type'@ with the intention --- that it be supplied using a type-quote. --- --- To define an instance @Show a => Show (Wrapper a)@, you'd use: --- --- > safeInstance ''Show [t| Show a => Wrapper a |] --- > [d| show _ = "stuff" |] --- --- To define an instance of a multi-param type class, use the --- 'MultiParams' type constructor with a tuple: --- --- > safeInstance ''MonadState --- > [t| MonadState s m => MultiParams (s, MaybeT m) |] --- > [d| put = ... |] -safeInstance :: Name -> Q Type -> Q [Dec] -> Q [Dec] -safeInstance n qty inst = do - (cxt, tys) <- fromTuple <$> qty - safeInstance' n cxt tys inst diff --git a/NotCPP/ScopeLookup.hs b/NotCPP/ScopeLookup.hs deleted file mode 100644 index 5fb6415..0000000 --- a/NotCPP/ScopeLookup.hs +++ /dev/null @@ -1,65 +0,0 @@ -{-# LANGUAGE TemplateHaskell #-} --- | --- This module exports 'scopeLookup', which will find a variable or --- value constructor for you and present it for your use. E.g. at some --- point in the history of the acid-state package, 'openAcidState' was --- renamed 'openLocalState'; for compatibility with both, you could --- use: --- --- > openState :: IO (AcidState st) --- > openState = case $(scopeLookup "openLocalState") of --- > Just open -> open defaultState --- > Nothing -> case $(scopeLookup "openAcidState") of --- > Just open -> open defaultState --- > Nothing -> error --- > "openState: runtime name resolution has its drawbacks :/" --- --- Or, for this specific case, you can use 'scopeLookups': --- --- > openState :: IO (AcidState st) --- > openState = open defaultState --- > where --- > open = $(scopeLookups ["openLocalState","openAcidState"]) --- --- Now if neither of the names are found then TH will throw a --- compile-time error. -module NotCPP.ScopeLookup ( - scopeLookup, - scopeLookups, - scopeLookup', - liftMaybe, - recoverMaybe, - maybeReify, - infoToExp, - ) where - -import Control.Applicative ((<$>)) - -import Language.Haskell.TH (Q, Exp, recover, reify) - -import NotCPP.LookupValueName -import NotCPP.Utils - --- | Produces a spliceable expression which expands to @'Just' val@ if --- the given string refers to a value @val@ in scope, or 'Nothing' --- otherwise. --- --- @scopeLookup = 'fmap' 'liftMaybe' . 'scopeLookup''@ -scopeLookup :: String -> Q Exp -scopeLookup = fmap liftMaybe . scopeLookup' - --- | Finds the first string in the list that names a value, and produces --- a spliceable expression of that value, or reports a compile error if --- it fails. -scopeLookups :: [String] -> Q Exp -scopeLookups xs = foldr - (\s r -> maybe r return =<< scopeLookup' s) - (fail ("scopeLookups: none found: " ++ show xs)) - xs - --- | Produces @'Just' x@ if the given string names the value @x@, --- or 'Nothing' otherwise. -scopeLookup' :: String -> Q (Maybe Exp) -scopeLookup' s = recover (return Nothing) $ do - Just n <- lookupValueName s - infoToExp <$> reify n diff --git a/NotCPP/Utils.hs b/NotCPP/Utils.hs deleted file mode 100644 index d25b637..0000000 --- a/NotCPP/Utils.hs +++ /dev/null @@ -1,35 +0,0 @@ -{-# LANGUAGE CPP #-} -{-# LANGUAGE TemplateHaskell #-} -module NotCPP.Utils where - -import Control.Applicative ((<$>)) -import Language.Haskell.TH - --- | Turns 'Nothing' into an expression representing 'Nothing', and --- @'Just' x@ into an expression representing 'Just' applied to the --- expression in @x@. -liftMaybe :: Maybe Exp -> Exp -liftMaybe = maybe (ConE 'Nothing) (AppE (ConE 'Just)) - --- | A useful variant of 'reify' that returns 'Nothing' instead of --- halting compilation when an error occurs (e.g. because the given --- name was not in scope). -maybeReify :: Name -> Q (Maybe Info) -maybeReify = recoverMaybe . reify - --- | Turns a possibly-failing 'Q' action into one returning a 'Maybe' --- value. -recoverMaybe :: Q a -> Q (Maybe a) -recoverMaybe q = recover (return Nothing) (Just <$> q) - --- | Returns @'Just' ('VarE' n)@ if the info relates to a value called --- @n@, or 'Nothing' if it relates to a different sort of thing. -infoToExp :: Info -> Maybe Exp -#if __GLASGOW_HASKELL__ >= 800 -infoToExp (VarI n _ _) = Just (VarE n) -infoToExp (DataConI n _ _) = Just (ConE n) -#else -infoToExp (VarI n _ _ _) = Just (VarE n) -infoToExp (DataConI n _ _ _) = Just (ConE n) -#endif -infoToExp _ = Nothing diff --git a/README.md b/README.md index 3466337..4114d38 100644 --- a/README.md +++ b/README.md @@ -1,71 +1,99 @@ -# Happy Haskell Programming -[![Build Status](https://travis-ci.org/kazu-yamamoto/ghc-mod.svg?branch=master)](https://travis-ci.org/kazu-yamamoto/ghc-mod) +# ghc-mod: Happy Haskell Hacking +[![build status](https://gitlab.com/dxld/ghc-mod/badges/master/build.svg)](https://gitlab.com/dxld/ghc-mod/commits/master) -Please read: [http://www.mew.org/~kazu/proj/ghc-mod/](http://www.mew.org/~kazu/proj/ghc-mod/) +ghc-mod provides editors/IDEs with support for Haskell compiler features, it +supports both Cabal and Stack based projects and integrations exist for Emacs, +Vim, Atom, IntelliJ and VSCode. -## Using the stable version +- for [all Haskell developers (Using ghc-mod in your development environment)](#using-ghc-mod-in-your-development-environment) +- for [people developing Haskell IDEs (Using ghc-mod as an IDE backend program)](#using-ghc-mod-as-an-ide-backend-program) +- for [developing Haskell tooling (Using ghc-mod as a library)](#using-ghc-mod-as-a-library) -The Emacs front-end is available from -[*stable* MELPA](https://stable.melpa.org/). This package should -always be compatible with the latest version of ghc-mod from hackage. +## Overview -To use stable *stable* MELPA add this to your `.emacs`: +### Using ghc-mod in your Development Environment -```elisp -(require 'package) -(add-to-list 'package-archives - '("melpa" . "https://stable.melpa.org/packages/")) -(package-initialize) -``` +To use `ghc-mod` in your development environment of choice you need two things: -With this configuration you can install the Emacs front end from MELPA (the -package is called `ghc` there, not `ghc-mod`) and install the -`ghc-mod`/`ghc-modi` binaries from hackage by doing: + - The `ghc-mod` program included in the package of the same name, see [Installing](https://github.com/DanielG/ghc-mod/wiki/Installing) + - A ghc-mod frontend to integrate it into your development environment, see [Frontend](https://github.com/DanielG/ghc-mod/wiki/Frontend) -```shell -% cabal update && cabal install ghc-mod -``` +### Using ghc-mod as an IDE Backend Program -### Nix & NixOS +We provide two modes of operation for frontends: interactive and single shot +mode. The former is accessed by calling `$ ghc-mod legacy-interactive` this will +sit and wait for you to type a command and exit when an empty line is +entered. Interactive mode is pretty much always faster than single shot mode +since it gives ghc-mod the ability to cache the compiler session between +commands on the other hand it needs more memory because it keeps these things +cached. -`ghc-mod` works fine for users of Nix who follow a recent version of the -package database such as the `nixos-15.09` or `nixos-unstable` channel. Just -include the package `ghc-mod` into your `ghcWithPackages` environment like any -other library. The [Nixpkgs Haskell User's -Guide](http://hydra.nixos.org/job/nixpkgs/trunk/manual/latest/download-by-type/doc/manual#users-guide-to-the-haskell-infrastructure) -covers this subject in great detail. +Single shot mode is pretty much only there for (backwards) compatibility with +Vim since it only recently got the ability to talk to background processes +without installing some external plugin. You can use single-shot mode by simply +calling the sub-comamnds of the `ghc-mod` program. Since re-compiling large +projects can be really, really slow you really shouldn't use this and use +interactive mode instead. -## Using the development version +As a rule of thumb all commands available in single shot mode are available in +interactive mode, a list of the former can be obtained by running +`$ ghc-mod --help`. -The easiest way to hack on ghc-mod is compile it, then add `dist/build/ghc-mod` -and `dist/build/ghc-modi` to your `PATH` and add the `elisp/` directory to your -Emacs `load-path`. +If you're developing a new ghc-mod fronted we'd love to hear from you! Please +open an issue or e-mail the maintainer. Also we invite you to add installation +and configuration instructions to +[Frontend](https://github.com/DanielG/ghc-mod/wiki/Frontend). -Make sure you're not using the MELPA version of `ghc.el` otherwise you might get -all sorts of nasty conflicts. +### Using ghc-mod as a Library +Internally ghc-mod uses the Glasgow Haskell Compilers's API to implement most of +it's functionality. -## Custom ghc-mod cradle +In order to provide a hassle free experience to users ghc-mod tries hard to +automatically, and correctly, detect and if needed tweak the environment GHC +needs. It also handles some of the more cumbersome parts of getting a working +compiler session up and running. -To customize the package databases used by `ghc-mod`, put a file called `ghc-mod.package-db-stack` beside the `.cabal` file with the following syntax: +This functionality can be very useful to all kinds of Haskell development tools +therefore want to expose all the useful abstractions ghc-mod provides. -``` -temp directory root -package db 1 -... -package db n -``` +Right now the ghc-mod API is pretty messy; a result of major internal rewrites +and reorganization coupled with too little time for cleanups over the course of +almost 100 releases! We would like to make a cut during v6.0 or so and +completely re-do the API but we need more input from downstream tool writers to +do that properly, see [Library API Redesign](Library-API-Redesign.md). -each package database line is either a *path* to a package database, or `global` or `user`. +For example [The Haskell Refactorer (HaRe)](https://github.com/alanz/HaRe) uses +the build environment abstraction ghc-mod provides so it can concentrate on it's +core functionality instead of worrying about build environments and compiler +session setup. + +Recently the +[`haskell-ide-engine`](https://github.com/haskell/haskell-ide-engine) project +has sprung up and if you're planning to write any kind of tool that needs editor +integration eventually you should definetly look into that. `haskell-ide-engine` +uses `ghc-mod` at it's core so you'll want to be familliar with it either way. + +API "documentation" is here: +[Hackage docs](https://hackage.haskell.org/package/ghc-mod#modules). + +## Reporting Bugs + +Please report bugs on the GitHub issue tracker for ghc-mod: +https://github.com/DanielG/ghc-mod/issues + +Including general environment information like the operating system +(distribution, version) you're using and the output of `$ ghc-mod debug` run in +your project directory is probably a good idea. ## IRC If you have any problems, suggestions, comments swing by [\#ghc-mod (web client)](https://kiwiirc.com/client/irc.freenode.org/ghc-mod) on Freenode. If you're reporting a bug please also create an issue -[here](https://github.com/kazu-yamamoto/ghc-mod/issues) so we have a way to contact -you if you don't have time to stay. +[here (GitHub issue tracker)](https://github.com/DanielG/ghc-mod/issues) so we +have a way to contact you if you don't have time to stay. Do hang around for a while if no one answers and repeat your question if you -still haven't gotten any answer after a day or so. You're most likely to get an -answer during the day in GMT+1. +still haven't gotten any answer after a day or so (the maintainer was probably +asleep). You're most likely to get an answer during the day in GMT+1. diff --git a/Setup.hs b/Setup.hs index 2e76de4..bdfda09 100755 --- a/Setup.hs +++ b/Setup.hs @@ -1,13 +1,19 @@ #!/usr/bin/env runhaskell -{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE RecordWildCards, NamedFieldPuns #-} import Distribution.Simple +import Distribution.Simple.Utils import Distribution.Simple.Setup import Distribution.Simple.Install +import Distribution.Simple.Program import Distribution.Simple.Register -import Distribution.Simple.InstallDirs as ID +import Distribution.Simple.BuildPaths +import qualified Distribution.Simple.InstallDirs as ID import Distribution.Simple.LocalBuildInfo import Distribution.PackageDescription +import qualified Data.Map as M +import Data.Map (Map) + import Control.Arrow import Control.Applicative import Control.Monad @@ -18,46 +24,23 @@ import Data.Monoid import System.Process import System.Exit import System.FilePath -import Text.ParserCombinators.ReadP - -import SetupCompat +import System.Directory (renameFile) main :: IO () main = defaultMainWithHooks $ simpleUserHooks { - confHook = \(gpd, hbi) cf -> - xBuildDependsLike <$> (confHook simpleUserHooks) (gpd, hbi) cf - - , instHook = inst - , copyHook = copy - --- , postConf = sanityCheckCabalVersions + instHook = inst, + copyHook = copy, + buildHook = \pd lbi hooks flags -> (buildHook simpleUserHooks) pd (patchLibexecdir lbi) hooks flags, + hookedPrograms = [ simpleProgram "shelltest" ] } -xBuildDependsLike :: LocalBuildInfo -> LocalBuildInfo -xBuildDependsLike lbi = - let - cc = componentsConfigs lbi - pd = localPkgDescr lbi - deps = dependsMap lbi - in setComponentsConfigs lbi - [ (cn, updateClbi deps comp clbi, cdeps) - | (cn, clbi, cdeps) <- cc - , let comp = getComponent pd cn - ] - - where - updateClbi deps comp clbi = setUnionDeps (otherDeps deps comp) clbi - - dependsMap :: - LocalBuildInfo -> [(ComponentName, Deps)] - dependsMap lbi = - second getDeps <$> allComponentsInBuildOrder lbi - - otherDeps :: [(ComponentName, Deps)] -> Component -> Deps - otherDeps deps comp = fromMaybe noDeps $ - flip lookup deps =<< read <$> lookup "x-build-depends-like" fields - where - fields = customFieldsBI (componentBuildInfo comp) +patchLibexecdir :: LocalBuildInfo -> LocalBuildInfo +patchLibexecdir lbi = let + idirtpl = installDirTemplates lbi + libexecdir' = toPathTemplate $ fromPathTemplate (libexecdir idirtpl) "$abi/$pkgid" + lbi' = lbi { installDirTemplates = idirtpl { libexecdir = libexecdir' } } + in + lbi' -- mostly copypasta from 'defaultInstallHook' inst :: @@ -68,7 +51,7 @@ inst pd lbi _uf ifl = do copyDest = toFlag NoCopyDest, copyVerbosity = installVerbosity ifl } - xInstallTarget pd lbi (\pd' lbi' -> install pd' lbi' copyFlags) + xInstallTarget pd lbi copyFlags (\pd' lbi' -> install pd' lbi' copyFlags) let registerFlags = defaultRegisterFlags { regDistPref = installDistPref ifl, regInPlace = installInPlace ifl, @@ -79,124 +62,46 @@ inst pd lbi _uf ifl = do copy :: PackageDescription -> LocalBuildInfo -> UserHooks -> CopyFlags -> IO () copy pd lbi _uh cf = - xInstallTarget pd lbi (\pd' lbi' -> install pd' lbi' cf) + xInstallTarget pd lbi cf (\pd' lbi' -> install pd' lbi' cf) xInstallTarget :: PackageDescription -> LocalBuildInfo + -> CopyFlags -> (PackageDescription -> LocalBuildInfo -> IO ()) -> IO () -xInstallTarget pd lbi fn = do - let (extended, regular) = partition (isJust . installTarget) (executables pd) +xInstallTarget pd lbi cf fn = do + let (extended, regular) = partition isInternal (executables pd) let pd_regular = pd { executables = regular } _ <- flip mapM extended $ \exe -> do - putStrLn $ "extended " ++ show (exeName exe) + let pd_extended = onlyExePackageDesc [exe] pd + fn pd_extended lbi - let - idirtpl = installDirTemplates lbi - env = installDirsTemplateEnv idirtpl - libexecdir' = fromPathTemplate (libexecdir idirtpl) + let lbi' = patchLibexecdir lbi + copydest = fromFlag (copyDest cf) + verbosity = fromFlag (copyVerbosity cf) + InstallDirs { bindir, libexecdir } = absoluteInstallDirs pd lbi' copydest + progprefix = substPathTemplate (packageId pd) lbi (progPrefix lbi) + progsuffix = substPathTemplate (packageId pd) lbi (progSuffix lbi) + fixedExeBaseName = progprefix ++ exeName exe ++ progsuffix - pd_extended = onlyExePackageDesc [exe] pd - install_target = fromJustNote "xInstallTarget" $ installTarget exe - install_target' = ID.substPathTemplate env install_target - -- $libexec isn't a real thing :/ so we have to simulate it - install_target'' = substLibExec' libexecdir' install_target' + fixedExeFileName = bindir fixedExeBaseName <.> exeExtension + newExeFileName = libexecdir fixedExeBaseName <.> exeExtension - let lbi' = lbi { - installDirTemplates = - (installDirTemplates lbi) { - bindir = install_target'' - } - } - fn pd_extended lbi' + when (exeName exe == "ghc-mod-real") $ do + createDirectoryIfMissingVerbose verbosity True libexecdir + renameFile fixedExeFileName newExeFileName fn pd_regular lbi where - installTarget :: Executable -> Maybe PathTemplate - installTarget exe = - toPathTemplate <$> lookup "x-install-target" (customFieldsBI $ buildInfo exe) - - substLibExec libexecdir "$libexecdir" = libexecdir - substLibExec _ comp = comp - - substLibExec' dir = - withPT $ - withSP $ map (substLibExec dir . dropTrailingPathSeparator) - - - withPT f pt = toPathTemplate $ f (fromPathTemplate pt) - withSP f p = joinPath $ f (splitPath p) + isInternal :: Executable -> Bool + isInternal exe = + fromMaybe False $ (=="True") <$> lookup "x-internal" (customFieldsBI $ buildInfo exe) onlyExePackageDesc :: [Executable] -> PackageDescription -> PackageDescription onlyExePackageDesc exes pd = emptyPackageDescription { package = package pd , executables = exes } - -parseVer str = - case filter ((=="") . snd) $ readP_to_S parseVersion str of - [(ver, _)] -> ver - _ -> error $ "No parse (Ver) :(\n" ++ str ++ "\n" - -fromJustNote :: String -> Maybe a -> a -fromJustNote _ (Just x) = x -fromJustNote note Nothing = error $ "fromJustNote ("++note++"): " - --- sanityCheckCabalVersions args cf desc lbi = do --- (cabalInstallVer, cabalVer) <- getCabalExecVer - --- let --- ghcVer = compilerVersion (compiler lbi) --- -- ghc >= 7.10? --- minGhc710 = ghcVer `withinRange` orLaterVersion (parseVer "7.10") - --- when minGhc710 $ do --- let cabalHelperCabalVer = compCabalVer (CExeName "cabal-helper") - --- when (not $ cabalVer `sameMajorVersionAs` cabalHelperCabalVer) $ --- failCabalVersionDifferent cabalVer cabalHelperCabalVer - --- -- carry on as usual --- (postConf simpleUserHooks) args cf desc lbi - --- where --- earlierVersionThan ver ver' = --- ver `withinRange` earlierVersion ver' --- sameMajorVersionAs ver ver' = --- ver `withinRange` withinVersion (Version (take 2 $ versionBranch ver') []) - --- compCabalVer comp = let --- clbi = getComponentLocalBuildInfo lbi comp - --- [cabalVer] = --- [ ver | (_, PackageIdentifier pkg ver) <- componentPackageDeps clbi --- , pkg == PackageName "Cabal" ] --- in cabalVer - --- getCabalExecVer = do --- ["cabal-install", "version", cabalInstallVer, "using", "version", cabalVer, "of", "the", "Cabal", "library"] <- words <$> readProcess "cabal" ["--version"] "" --- return (parseVer cabalInstallVer, parseVer cabalVer) - --- failCabalVersionDifferent cabalVer libCabalVer = --- putStrLn rerr >> exitFailure --- where --- replace :: String -> String -> String -> String --- replace _ _ [] = [] --- replace n r h@(h':hs) --- | map snd (n `zip` h ) == n = r ++ replace n r (drop (length n) h) --- | otherwise = h':replace n r hs - --- rerr = replace "X.XX.X.X" (showVersion libCabalVer) $ --- replace "Y.YY.Y.Y" (showVersion cabalVer) err --- err = "\ --- \Error: Cabal seems to have decided ghc-mod should be built using Cabal\n\ --- \X.XX.X.X while the `cabal' executable in your PATH was built with Cabal\n\ --- \Y.YY.Y.Y. This will lead to conflicts when running ghc-mod in any project\n\ --- \where you use this `cabal' executable. Please compile ghc-mod using the same\n\ --- \Cabal version as your `cabal' executable or recompile cabal-install using\n\ --- \this version of the Cabal library.\n\ --- \\n\ --- \See: https://github.com/kazu-yamamoto/ghc-mod/wiki/InconsistentCabalVersions\n" diff --git a/SetupCompat.hs b/SetupCompat.hs deleted file mode 100644 index b35b3eb..0000000 --- a/SetupCompat.hs +++ /dev/null @@ -1,198 +0,0 @@ -{-# LANGUAGE TemplateHaskell, RecordWildCards, StandaloneDeriving #-} -module SetupCompat where - -import Control.Arrow -import Control.Monad.Trans.State -import Data.List -import Data.Maybe -import Data.Functor -import Data.Function -import Distribution.Simple.LocalBuildInfo -import Distribution.PackageDescription - -import Distribution.Simple -import Distribution.Simple.Setup -import Distribution.Simple.Install - -import qualified Data.Map as M -import Data.Map (Map) - - -import NotCPP.Declarations -import Language.Haskell.TH - --- $(ifdefD "componentsConfigs" [d| deriving instance (Ord ComponentName) |] ) - -$(ifD [d| - - showComponentName :: ComponentName -> String - showComponentName CLibName = "library" - showComponentName (CExeName name) = "executable '" ++ name ++ "'" - showComponentName (CTestName name) = "test suite '" ++ name ++ "'" - showComponentName (CBenchName name) = "benchmark '" ++ name ++ "'" - - |]) - -$(ifelsedefD "componentsConfigs" [d| - - setComponentsConfigs - :: LocalBuildInfo - -> [(ComponentName, ComponentLocalBuildInfo, [ComponentName])] - -> LocalBuildInfo - setComponentsConfigs lbi cs = $(recUpdE' (nE "lbi") (mkName "componentsConfigs") (VarE $ mkName "cs")) - - |] [d| - - setComponentsConfigs - :: LocalBuildInfo - -> [(ComponentName, ComponentLocalBuildInfo, a)] - -> LocalBuildInfo - setComponentsConfigs lbi cs = flip execState lbi $ mapM setClbis gcs - where - gcs = groupBy (sameKind `on` fst3) $ sortBy (compare `on` showComponentName . fst3) cs - - fst3 (x,_,_) = x - - sameKind CLibName CLibName = True - sameKind CLibName _ = False - sameKind (CExeName _) (CExeName _) = True - sameKind (CExeName _) _ = False - sameKind (CTestName _) (CTestName _) = True - sameKind (CTestName _) _ = False - sameKind (CBenchName _) (CBenchName _) = True - sameKind (CBenchName _) _ = False - - setClbis [(CLibName, clbi, _)] = - get >>= \lbi -> - put $ $(recUpdE' (nE "lbi") (mkName "libraryConfig") (AppE (ConE (mkName "Just")) (VarE (mkName "clbi")))) - - setClbis cs@((CExeName _, _, _):_) = - let cfg = (\((CExeName n), clbi, _) -> (n, clbi)) <$> cs in - get >>= \lbi -> - put $ $(recUpdE' (nE "lbi") (mkName "executableConfigs") (VarE $ mkName "cfg")) - - setClbis cs@((CTestName _, _, _):_) = - let cfg = (\((CTestName n), clbi, _) -> (n, clbi)) <$> cs in - get >>= \lbi -> - put $ $(recUpdE' (nE "lbi") (mkName "testSuiteConfigs") (VarE $ mkName "cfg")) - - setClbis cs@((CBenchName _, _, _):_) = - let cfg = (\((CBenchName n), clbi, _) -> (n, clbi)) <$> cs in - get >>= \lbi -> - put $ $(recUpdE' (nE "lbi") (mkName "benchmarkConfigs") (VarE $ mkName "cfg")) - - |]) - - -$(ifD [d| - - componentsConfigs :: - LocalBuildInfo -> [(ComponentName, ComponentLocalBuildInfo, [ComponentName])] - componentsConfigs LocalBuildInfo {..} = - (maybe [] (\c -> [(CLibName, c, [])]) $(nE "libraryConfig")) - ++ ((\(n, clbi) -> (CExeName n, clbi, [])) <$> $(nE "executableConfigs")) - ++ ((\(n, clbi) -> (CTestName n, clbi, [])) <$> $(nE "testSuiteConfigs")) - ++ ((\(n, clbi) -> (CBenchName n, clbi, [])) <$> $(nE "benchmarkConfigs")) - - getComponent :: PackageDescription -> ComponentName -> Component - getComponent pkg cname = - case lookupComponent pkg cname of - Just cpnt -> cpnt - Nothing -> missingComponent - where - missingComponent = - error $ "internal error: the package description contains no " - ++ "component corresponding to " ++ show cname - - lookupComponent :: PackageDescription -> ComponentName -> Maybe Component - lookupComponent pkg CLibName = - fmap CLib $ library pkg - lookupComponent pkg (CExeName name) = - fmap CExe $ find ((name ==) . exeName) (executables pkg) - lookupComponent pkg (CTestName name) = - fmap CTest $ find ((name ==) . testName) (testSuites pkg) - lookupComponent pkg (CBenchName name) = - fmap CBench $ find ((name ==) . benchmarkName) (benchmarks pkg) - --- We're lying here can't be bothered to order these - allComponentsInBuildOrder :: LocalBuildInfo - -> [(ComponentName, ComponentLocalBuildInfo)] - allComponentsInBuildOrder lbi = - [ (cname, clbi) | (cname, clbi, _) <- componentsConfigs lbi ] - - getComponentLocalBuildInfo :: LocalBuildInfo -> ComponentName -> ComponentLocalBuildInfo - getComponentLocalBuildInfo lbi cname = - case [ clbi - | (cname', clbi, _) <- componentsConfigs lbi - , cname == cname' ] of - [clbi] -> clbi - _ -> missingComponent - where - missingComponent = - error $ "internal error: there is no configuration data " - ++ "for component " ++ show cname - - componentBuildInfo :: Component -> BuildInfo - componentBuildInfo = - foldComponent libBuildInfo buildInfo testBuildInfo benchmarkBuildInfo - - |]) - - -$(ifelsedefD "componentPackageRenaming" [d| - -- M.Map PackageName - newtype Deps = Deps { unDeps :: ([(InstalledPackageId, PackageId)], Map PackageName $(cT "ModuleRenaming")) } --- $(return $ TySynD $(mkName "Deps") [] [t| |] ) - - noDeps = Deps ([], M.empty) - - getDeps :: ComponentLocalBuildInfo -> Deps - getDeps = componentPackageDeps &&& $(nE "componentPackageRenaming") >>> Deps - - setUnionDeps :: Deps -> ComponentLocalBuildInfo -> ComponentLocalBuildInfo - setUnionDeps (Deps (deps, rns)) clbi = let - clbi' = setComponentPackageRenaming clbi rns - cpdeps = componentPackageDeps clbi - in - clbi' { - componentPackageDeps = cpdeps `union` deps - } - - setComponentPackageRenaming clbi cprn = - -- [| clbi { componentPackageRenaming = componentPackageRenaming clbi `M.union` cprn } |] - $(recUpdE' - (nE "clbi") - (mkName "componentPackageRenaming") - (InfixE - (Just - (AppE - (VarE - (mkName "componentPackageRenaming")) - (VarE (mkName "clbi")) - )) - (VarE (mkName "M.union")) - (Just (VarE (mkName "cprn"))) - ) - ) - - |] [d| - - newtype Deps = Deps { unDeps :: [(InstalledPackageId, PackageId)] } - - noDeps = Deps [] - - getDeps :: ComponentLocalBuildInfo -> Deps - getDeps lbi = Deps $ componentPackageDeps lbi - - setUnionDeps :: Deps -> ComponentLocalBuildInfo -> ComponentLocalBuildInfo - setUnionDeps (Deps deps) clbi = let - cpdeps = componentPackageDeps clbi - in - clbi { - componentPackageDeps = cpdeps `union` deps - } - - --- setComponentPackageRenaming clbi _cprn = clbi - - |]) diff --git a/bench/Bench.hs b/bench/Bench.hs new file mode 100644 index 0000000..1880492 --- /dev/null +++ b/bench/Bench.hs @@ -0,0 +1,30 @@ +import Criterion.Main +import Language.Haskell.GhcMod.Target +import Language.Haskell.GhcMod.Monad +import Language.Haskell.GhcMod.Types +import Dir +import System.IO.Temp +import System.Process hiding (env) +import Control.Monad + +main = defaultMain [ + env setup $ \dir -> bgroup "simple-cabal" [ + bench "nop" $ whnfIO (simpleCabalNop dir 1) + , bench "nop10" $ whnfIO (simpleCabalNop dir 10) + ] + ] + +setup = do + tdir <- createTempDirectory "/tmp" "ghc-mod-bench" + system $ "cp -rv \"bench/data/simple-cabal/\" \""++ tdir ++"\"" + + simpleCabalNop tdir 1 -- warmup dist/ + + return tdir + +simpleCabalNop :: FilePath -> Int -> IO () +simpleCabalNop dir n = withDirectory_ (dir "simple-cabal") $ do + _ <- runGhcModT defaultOptions $ + forM_ [1..n] $ \_ -> do + runGmlT [Left "Main.hs"] (return ()) + return () diff --git a/bench/data/simple-cabal/Main.hs b/bench/data/simple-cabal/Main.hs new file mode 100644 index 0000000..65ae4a0 --- /dev/null +++ b/bench/data/simple-cabal/Main.hs @@ -0,0 +1,4 @@ +module Main where + +main :: IO () +main = putStrLn "Hello, Haskell!" diff --git a/bench/data/simple-cabal/Setup.hs b/bench/data/simple-cabal/Setup.hs new file mode 100644 index 0000000..9a994af --- /dev/null +++ b/bench/data/simple-cabal/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/bench/data/simple-cabal/simple-cabal.cabal b/bench/data/simple-cabal/simple-cabal.cabal new file mode 100644 index 0000000..c4c0cfb --- /dev/null +++ b/bench/data/simple-cabal/simple-cabal.cabal @@ -0,0 +1,13 @@ +name: simple-cabal +version: 0.1.0.0 +license: BSD3 +license-file: LICENSE +author: Daniel Gröber +maintainer: dxld@darkboxed.org +build-type: Simple +cabal-version: >=1.10 + +executable simple-cabal + main-is: Main.hs + build-depends: base + default-language: Haskell2010 diff --git a/cabal.project b/cabal.project deleted file mode 100644 index 4c4949f..0000000 --- a/cabal.project +++ /dev/null @@ -1,3 +0,0 @@ --- do not build sub-packages when using features from --- http://blog.ezyang.com/2016/05/announcing-cabal-new-build-nix-style-local-builds/ -packages: . diff --git a/Data/Binary/Generic.hs b/core/Data/Binary/Generic.hs similarity index 100% rename from Data/Binary/Generic.hs rename to core/Data/Binary/Generic.hs diff --git a/Language/Haskell/GhcMod/CabalHelper.hs b/core/Language/Haskell/GhcMod/CabalHelper.hs similarity index 97% rename from Language/Haskell/GhcMod/CabalHelper.hs rename to core/Language/Haskell/GhcMod/CabalHelper.hs index 119f745..cb09569 100644 --- a/Language/Haskell/GhcMod/CabalHelper.hs +++ b/core/Language/Haskell/GhcMod/CabalHelper.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015 Daniel Gröber -- -- This program is free software: you can redistribute it and/or modify @@ -16,15 +16,13 @@ {-# LANGUAGE CPP #-} module Language.Haskell.GhcMod.CabalHelper -#ifndef SPEC ( getComponents , getGhcMergedPkgOptions , getCabalPackageDbStack , prepareCabalHelper , withAutogen - ) -#endif - where + , withCabal + ) where import Control.Applicative import Control.Monad @@ -208,7 +206,7 @@ withCabal action = do -- "--flag PACKAGE:[-]FLAG Override flags set in stack.yaml -- (applies to local packages and extra-deps)" - stackReconfigure crdl (optPrograms opts) + stackReconfigure (optStackBuildDeps opts) crdl (optPrograms opts) _ -> error $ "withCabal: unsupported project type: " ++ show proj @@ -234,12 +232,13 @@ withCabal action = do flagOpt = ["--flags", unwords $ map toFlag flgs] liftIO $ void $ readProc (T.cabalProgram progs) ("configure":progOpts) "" - stackReconfigure crdl progs = do + stackReconfigure deps crdl progs = do withDirectory_ (cradleRootDir crdl) $ do supported <- haveStackSupport if supported then do - spawn [T.stackProgram progs, "build", "--only-dependencies", "."] + when deps $ + spawn [T.stackProgram progs, "build", "--only-dependencies", "."] spawn [T.stackProgram progs, "build", "--only-configure", "."] else gmLog GmWarning "" $ strDoc $ "Stack project configuration is out of date, please reconfigure manually using 'stack build' as your stack version is too old (need at least 0.1.4.0)" diff --git a/Language/Haskell/GhcMod/Caching.hs b/core/Language/Haskell/GhcMod/Caching.hs similarity index 99% rename from Language/Haskell/GhcMod/Caching.hs rename to core/Language/Haskell/GhcMod/Caching.hs index 26387c0..c8cdb05 100644 --- a/Language/Haskell/GhcMod/Caching.hs +++ b/core/Language/Haskell/GhcMod/Caching.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015 Daniel Gröber -- -- This program is free software: you can redistribute it and/or modify diff --git a/Language/Haskell/GhcMod/Caching/Types.hs b/core/Language/Haskell/GhcMod/Caching/Types.hs similarity index 97% rename from Language/Haskell/GhcMod/Caching/Types.hs rename to core/Language/Haskell/GhcMod/Caching/Types.hs index 604384e..501eae2 100644 --- a/Language/Haskell/GhcMod/Caching/Types.hs +++ b/core/Language/Haskell/GhcMod/Caching/Types.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015 Daniel Gröber -- -- This program is free software: you can redistribute it and/or modify diff --git a/Language/Haskell/GhcMod/Convert.hs b/core/Language/Haskell/GhcMod/Convert.hs similarity index 100% rename from Language/Haskell/GhcMod/Convert.hs rename to core/Language/Haskell/GhcMod/Convert.hs diff --git a/Language/Haskell/GhcMod/Cradle.hs b/core/Language/Haskell/GhcMod/Cradle.hs similarity index 96% rename from Language/Haskell/GhcMod/Cradle.hs rename to core/Language/Haskell/GhcMod/Cradle.hs index 730c76b..b4e499b 100644 --- a/Language/Haskell/GhcMod/Cradle.hs +++ b/core/Language/Haskell/GhcMod/Cradle.hs @@ -1,15 +1,14 @@ {-# LANGUAGE CPP #-} module Language.Haskell.GhcMod.Cradle -#ifndef SPEC - ( - findCradle + ( findCradle , findCradle' , findCradleNoLog , findSpecCradle , cleanupCradle - ) -#endif - where + + -- * for @spec@ + , plainCradle + ) where import Language.Haskell.GhcMod.PathsAndFiles import Language.Haskell.GhcMod.Monad.Types @@ -101,7 +100,7 @@ cabalCradle cabalProg wdir = do stackCradle :: (IOish m, GmLog m, GmOut m) => FilePath -> FilePath -> MaybeT m Cradle stackCradle stackProg wdir = do -#if !MIN_VERSION_ghc(7,8,0) +#if __GLASGOW_HASKELL__ < 708 -- GHC < 7.8 is not supported by stack mzero #endif @@ -126,7 +125,7 @@ stackCradle stackProg wdir = do mzero (True, True) -> do - gmLog GmWarning "" $ text "STACK_EXE set, preferring Stack project" + gmLog GmInfo "" $ text "STACK_EXE set, preferring Stack project" (True, False) | setupCfgExists -> do gmLog GmWarning "" $ text "'dist/setup-config' exists, ignoring Stack project" @@ -134,7 +133,7 @@ stackCradle stackProg wdir = do (True, False) -> return () - senv <- MaybeT $ getStackEnv cabalDir + senv <- MaybeT $ getStackEnv cabalDir stackProg gmLog GmInfo "" $ text "Using Stack project at" <+>: text cabalDir return Cradle { diff --git a/Language/Haskell/GhcMod/CustomPackageDb.hs b/core/Language/Haskell/GhcMod/CustomPackageDb.hs similarity index 96% rename from Language/Haskell/GhcMod/CustomPackageDb.hs rename to core/Language/Haskell/GhcMod/CustomPackageDb.hs index 15485c0..8fc78e3 100644 --- a/Language/Haskell/GhcMod/CustomPackageDb.hs +++ b/core/Language/Haskell/GhcMod/CustomPackageDb.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015 Daniel Gröber -- -- This program is free software: you can redistribute it and/or modify diff --git a/Language/Haskell/GhcMod/DebugLogger.hs b/core/Language/Haskell/GhcMod/DebugLogger.hs similarity index 99% rename from Language/Haskell/GhcMod/DebugLogger.hs rename to core/Language/Haskell/GhcMod/DebugLogger.hs index 0bd0d59..780dcd6 100644 --- a/Language/Haskell/GhcMod/DebugLogger.hs +++ b/core/Language/Haskell/GhcMod/DebugLogger.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015 Daniel Gröber -- -- This program is free software: you can redistribute it and/or modify diff --git a/Language/Haskell/GhcMod/Doc.hs b/core/Language/Haskell/GhcMod/Doc.hs similarity index 100% rename from Language/Haskell/GhcMod/Doc.hs rename to core/Language/Haskell/GhcMod/Doc.hs diff --git a/Language/Haskell/GhcMod/DynFlags.hs b/core/Language/Haskell/GhcMod/DynFlags.hs similarity index 100% rename from Language/Haskell/GhcMod/DynFlags.hs rename to core/Language/Haskell/GhcMod/DynFlags.hs diff --git a/core/Language/Haskell/GhcMod/DynFlagsTH.hs b/core/Language/Haskell/GhcMod/DynFlagsTH.hs new file mode 100644 index 0000000..f5a1c01 --- /dev/null +++ b/core/Language/Haskell/GhcMod/DynFlagsTH.hs @@ -0,0 +1,144 @@ +-- ghc-mod: Happy Haskell Hacking +-- Copyright (C) 2015 Daniel Gröber +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU Affero General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU Affero General Public License for more details. +-- +-- You should have received a copy of the GNU Affero General Public License +-- along with this program. If not, see . + +{-# LANGUAGE CPP, TemplateHaskell #-} +module Language.Haskell.GhcMod.DynFlagsTH where + +import Language.Haskell.TH +import Language.Haskell.TH.Syntax +import Control.Applicative +import Data.Maybe +import Data.Generics.Aliases +import Data.Generics.Schemes +import DynFlags +import Prelude + +deriveEqDynFlags :: Q [Dec] -> Q [Dec] +deriveEqDynFlags qds = do +#if __GLASGOW_HASKELL__ <= 710 + ~(TyConI (DataD [] _ [] [ctor] _ )) +#else + ~(TyConI (DataD [] _ [] _ [ctor] _ )) +#endif + <- reify ''DynFlags + let ~(RecC _ fs) = ctor + + a <- newName "a" + b <- newName "b" + + e <- AppE (VarE 'and) . ListE <$> sequence (catMaybes $ map (eq a b) fs) + + tysig@(SigD n _) :_ <- qds + + return $ [tysig, FunD n [Clause [VarP a, VarP b] (NormalB e) []]] + + where + eq :: Name -> Name -> (Name, Strict, Type) -> Maybe (Q Exp) + eq a b (fun@(Name (OccName fon) _), _, ft) + | not (isUneqable || isIgnored) = Just expr + | otherwise = Nothing + where + isUneqable = everything (||) (mkQ False hasUnEqable) ft + + hasUnEqable (AppT (ConT (Name (OccName on) _)) _) + | any (==on) ignoredConstructorNames = True + hasUnEqable (ConT (Name (OccName on) _)) + | any (==on) ignoredTypeNames = True + | any (==on) ignoredTypeOccNames = True + hasUnEqable _ = False + + isIgnored = fon `elem` ignoredNames + + ignoredConstructorNames = [ "IORef" ] + + ignoredNames = [ "pkgDatabase" -- 7.8 +#if __GLASGOW_HASKELL__ <= 706 + , "ways" -- 'Ways' is not exported :/ +#endif + ] + ignoredTypeNames = + [ "LogAction" + , "PackageState" + , "Hooks" + , "FlushOut" + , "FlushErr" + , "Settings" -- I think these can't cange at runtime + ] + ignoredTypeOccNames = [ "OnOff" ] + + fa = AppE (VarE fun) (VarE a) + fb = AppE (VarE fun) (VarE b) + expr = + case fon of + "rtsOptsEnabled" -> do + let eqfn = [| let fn RtsOptsNone RtsOptsNone = True + fn RtsOptsSafeOnly RtsOptsSafeOnly = True + fn RtsOptsAll RtsOptsAll = True + fn _ _ = False + in fn + |] + [e| $(eqfn) $(return fa) $(return fb) |] + + "extraPkgConfs" -> do + let eqfn = [| let fn a' b' = and (zipWith eqpr (a' []) (b' [])) + && length (a' []) == length (b' []) + eqpr GlobalPkgConf GlobalPkgConf = True + eqpr UserPkgConf UserPkgConf = True + eqpr (PkgConfFile pa) (PkgConfFile pb) = pa == pb + eqpr _ _ = False + in fn + |] + [e| $(eqfn) $(return fa) $(return fb) |] + +#if __GLASGOW_HASKELL__ >= 710 && __GLASGOW_HASKELL__ < 800 + "sigOf" -> do + let eqfn = [| let fn NotSigOf NotSigOf = True + fn (SigOf a') (SigOf b') = a' == b' + fn (SigOfMap a') (SigOfMap b') = a' == b' + fn _ _ = False + in fn + |] + [e| $(eqfn) $(return fa) $(return fb) |] +#endif + +#if __GLASGOW_HASKELL <= 706 + "profAuto" -> do + let eqfn = [| let fn NoProfAuto NoProfAuto = True + fn ProfAutoAll ProfAutoAll = True + fn ProfAutoTop ProfAutoTop = True + fn ProfAutoExports ProfAutoExports = True + fn ProfAutoCalls ProfAutoCalls = True + fn _ _ = False + in fn + |] + [e| $(eqfn) $(return fa) $(return fb) |] +#endif + +#if __GLASGOW_HASKELL__ >= 706 + "language" -> do + let eqfn = [| let fn (Just Haskell98) (Just Haskell98) = True + fn (Just Haskell2010) (Just Haskell2010) = True + fn Nothing Nothing = True + fn _ _ = False + in fn + |] + [e| $(eqfn) $(return fa) $(return fb) |] +#endif + + _ -> + [e| $(return fa) == $(return fb) |] + +-- expr' = [e| trace (if $(expr) == True then "" else show ($(litE $ StringL fon), $(expr))) $(expr) |] diff --git a/Language/Haskell/GhcMod/Error.hs b/core/Language/Haskell/GhcMod/Error.hs similarity index 98% rename from Language/Haskell/GhcMod/Error.hs rename to core/Language/Haskell/GhcMod/Error.hs index 4ec373c..bf60962 100644 --- a/Language/Haskell/GhcMod/Error.hs +++ b/core/Language/Haskell/GhcMod/Error.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015 Daniel Gröber -- -- This program is free software: you can redistribute it and/or modify @@ -39,11 +39,11 @@ import qualified Data.Set as Set import Data.List import Data.Version import System.Process (showCommandForUser) -import Text.PrettyPrint import Text.Printf import Exception import Panic +import Pretty import Config (cProjectVersion, cHostPlatformString) import Paths_ghc_mod (version) diff --git a/Language/Haskell/GhcMod/FileMapping.hs b/core/Language/Haskell/GhcMod/FileMapping.hs similarity index 100% rename from Language/Haskell/GhcMod/FileMapping.hs rename to core/Language/Haskell/GhcMod/FileMapping.hs diff --git a/Language/Haskell/GhcMod/Gap.hs b/core/Language/Haskell/GhcMod/Gap.hs similarity index 91% rename from Language/Haskell/GhcMod/Gap.hs rename to core/Language/Haskell/GhcMod/Gap.hs index 2659c5a..13d0246 100644 --- a/Language/Haskell/GhcMod/Gap.hs +++ b/core/Language/Haskell/GhcMod/Gap.hs @@ -31,6 +31,7 @@ module Language.Haskell.GhcMod.Gap ( , occNameForUser , deSugar , showDocWith + , renderGm , GapThing(..) , fromTyThing , fileModSummary @@ -47,6 +48,7 @@ module Language.Haskell.GhcMod.Gap ( , parseModuleHeader , mkErrStyle' , everythingStagedWithContext + , withCleanupSession ) where import Control.Applicative hiding (empty) @@ -56,7 +58,7 @@ import Data.List (intersperse) import Data.Maybe (catMaybes) import Data.Time.Clock (UTCTime) import Data.Traversable hiding (mapM) -import DataCon (dataConRepType) +import DataCon (dataConUserType) import Desugar (deSugarExpr) import DynFlags import ErrUtils @@ -72,6 +74,10 @@ import StringBuffer import TcType import Var (varType) import System.Directory +import SysTools +#if __GLASGOW_HASKELL__ >= 800 +import GHCi (stopIServ) +#endif import qualified Name import qualified InstEnv @@ -90,7 +96,19 @@ import PatSyn import TcRnTypes #endif -#if __GLASGOW_HASKELL__ >= 706 +-- GHC 7.8 doesn't define this macro, nor does GHC 7.10.0 +-- It IS defined from 7.10.1 and up though. +-- So we can only test for 7.10.1.0 and up with it. +#if __GLASGOW_HASKELL__ < 710 +#ifndef MIN_VERSION_GLASGOW_HASKELL +#define MIN_VERSION_GLASGOW_HASKELL(a,b,c,d) FALSE +#endif +#endif + +#if MIN_VERSION_GLASGOW_HASKELL(8,0,1,20161117) +import GHC hiding (ClsInst, withCleanupSession) +import qualified GHC (withCleanupSession) +#elif __GLASGOW_HASKELL__ >= 706 import GHC hiding (ClsInst) #else import GHC hiding (Instance) @@ -183,6 +201,23 @@ showDocWith dflags mode = Pretty.showDoc mode (pprCols dflags) showDocWith _ = Pretty.showDocWith #endif +renderGm :: Pretty.Doc -> String +#if __GLASGOW_HASKELL__ >= 800 +renderGm = Pretty.fullRender Pretty.PageMode 80 1.2 string_txt "" +#else +renderGm = Pretty.fullRender Pretty.PageMode 80 1.2 string_txt "" +#endif + where + string_txt :: Pretty.TextDetails -> String -> String + string_txt (Pretty.Chr c) s = c:s + string_txt (Pretty.Str s1) s2 = s1 ++ s2 + string_txt (Pretty.PStr s1) s2 = unpackFS s1 ++ s2 + string_txt (Pretty.LStr s1 _) s2 = unpackLitString s1 ++ s2 +#if __GLASGOW_HASKELL__ >= 708 + string_txt (Pretty.ZStr s1) s2 = zString s1 ++ s2 +#endif + + ---------------------------------------------------------------- ---------------------------------------------------------------- @@ -498,14 +533,14 @@ data GapThing = GtA Type fromTyThing :: TyThing -> GapThing fromTyThing (AnId i) = GtA $ varType i #if __GLASGOW_HASKELL__ >= 708 -fromTyThing (AConLike (RealDataCon d)) = GtA $ dataConRepType d +fromTyThing (AConLike (RealDataCon d)) = GtA $ dataConUserType d #if __GLASGOW_HASKELL__ >= 800 fromTyThing (AConLike (PatSynCon p)) = GtPatSyn p #else fromTyThing (AConLike (PatSynCon p)) = GtA $ patSynType p #endif #else -fromTyThing (ADataCon d) = GtA $ dataConRepType d +fromTyThing (ADataCon d) = GtA $ dataConUserType d #endif fromTyThing (ATyCon t) = GtT t fromTyThing _ = GtN @@ -665,3 +700,24 @@ everythingStagedWithContext stage s0 f z q x #endif fixity = const (stage Bool (r, s') = q x s0 + +withCleanupSession :: GhcMonad m => m a -> m a +#if __GLASGOW_HASKELL__ >= 800 +#if MIN_VERSION_GLASGOW_HASKELL(8,0,1,20161117) +withCleanupSession = GHC.withCleanupSession +#else +withCleanupSession ghc = ghc `gfinally` cleanup + where + cleanup = do + hsc_env <- getSession + let dflags = hsc_dflags hsc_env + liftIO $ do + cleanTempFiles dflags + cleanTempDirs dflags + stopIServ hsc_env +#endif +#else +withCleanupSession action = do + df <- getSessionDynFlags + GHC.defaultCleanupHandler df action +#endif diff --git a/Language/Haskell/GhcMod/GhcPkg.hs b/core/Language/Haskell/GhcMod/GhcPkg.hs similarity index 97% rename from Language/Haskell/GhcMod/GhcPkg.hs rename to core/Language/Haskell/GhcMod/GhcPkg.hs index db2581d..86ab83b 100644 --- a/Language/Haskell/GhcMod/GhcPkg.hs +++ b/core/Language/Haskell/GhcMod/GhcPkg.hs @@ -86,7 +86,7 @@ getPackageDbStack = do CabalProject -> getCabalPackageDbStack (StackProject StackEnv {..}) -> - return $ map PackageDb [seSnapshotPkgDb, seLocalPkgDb] + return $ [GlobalDb, PackageDb seSnapshotPkgDb, PackageDb seLocalPkgDb] return $ fromMaybe stack mCusPkgStack getPackageCachePaths :: IOish m => FilePath -> GhcModT m [FilePath] diff --git a/Language/Haskell/GhcMod/HomeModuleGraph.hs b/core/Language/Haskell/GhcMod/HomeModuleGraph.hs similarity index 98% rename from Language/Haskell/GhcMod/HomeModuleGraph.hs rename to core/Language/Haskell/GhcMod/HomeModuleGraph.hs index e9e2a85..7ed7b01 100644 --- a/Language/Haskell/GhcMod/HomeModuleGraph.hs +++ b/core/Language/Haskell/GhcMod/HomeModuleGraph.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015 Daniel Gröber -- -- This program is free software: you can redistribute it and/or modify @@ -39,6 +39,7 @@ import Exception import Finder import GHC import HscTypes +import Pretty import Control.Arrow ((&&&)) import Control.Applicative @@ -223,7 +224,7 @@ updateHomeModuleGraph' env smp0 = do Left errs -> do -- TODO: Remember these and present them as proper errors if this is -- the file the user is looking at. - gmLog GmWarning ("preprocess " ++ show fn) $ Monoid.mempty $+$ (vcat $ map text errs) + gmLog GmWarning ("preprocess " ++ show fn) $ Pretty.empty $+$ (vcat $ map text errs) return Nothing diff --git a/core/Language/Haskell/GhcMod/LightGhc.hs b/core/Language/Haskell/GhcMod/LightGhc.hs new file mode 100644 index 0000000..8978991 --- /dev/null +++ b/core/Language/Haskell/GhcMod/LightGhc.hs @@ -0,0 +1,60 @@ +module Language.Haskell.GhcMod.LightGhc where + +import Control.Monad +import Control.Monad.Reader (runReaderT) +import Data.IORef + +import GHC +import GHC.Paths (libdir) +import StaticFlags +import SysTools +import DynFlags +import HscMain +import HscTypes + +import Language.Haskell.GhcMod.Types +import Language.Haskell.GhcMod.Monad.Types +import Language.Haskell.GhcMod.DynFlags +import qualified Language.Haskell.GhcMod.Gap as Gap + +-- We have to be more careful about tearing down 'HscEnv's since GHC 8 added an +-- out of process GHCI server which has to be shutdown. +newLightEnv :: IOish m => (DynFlags -> LightGhc DynFlags) -> m HscEnv +newLightEnv mdf = do + df <- liftIO $ do + initStaticOpts + settings <- initSysTools (Just libdir) + initDynFlags $ defaultDynFlags settings + + hsc_env <- liftIO $ newHscEnv df + df' <- runLightGhc hsc_env $ mdf df + return $ hsc_env { + hsc_dflags = df', + hsc_IC = (hsc_IC hsc_env) { ic_dflags = df' } + } + +teardownLightEnv :: MonadIO m => HscEnv -> m () +teardownLightEnv env = runLightGhc env $ do + Gap.withCleanupSession $ return () + +withLightHscEnv' + :: IOish m => (DynFlags -> LightGhc DynFlags) -> (HscEnv -> m a) -> m a +withLightHscEnv' mdf action = gbracket (newLightEnv mdf) teardownLightEnv action + +withLightHscEnv :: IOish m => [GHCOption] -> (HscEnv -> m a) -> m a +withLightHscEnv opts = withLightHscEnv' (f <=< liftIO . newHscEnv) + where + f env = runLightGhc env $ do + -- HomeModuleGraph and probably all other clients get into all sorts of + -- trouble if the package state isn't initialized here + _ <- setSessionDynFlags =<< addCmdOpts opts =<< getSessionDynFlags + getSessionDynFlags + +runLightGhc :: MonadIO m => HscEnv -> LightGhc a -> m a +runLightGhc env action = liftIO $ do + renv <- newIORef env + flip runReaderT renv $ unLightGhc action + +runLightGhc' :: MonadIO m => IORef HscEnv -> LightGhc a -> m a +runLightGhc' renv action = liftIO $ do + flip runReaderT renv $ unLightGhc action diff --git a/Language/Haskell/GhcMod/Logger.hs b/core/Language/Haskell/GhcMod/Logger.hs similarity index 98% rename from Language/Haskell/GhcMod/Logger.hs rename to core/Language/Haskell/GhcMod/Logger.hs index 74e88f0..6c14d5e 100644 --- a/Language/Haskell/GhcMod/Logger.hs +++ b/core/Language/Haskell/GhcMod/Logger.hs @@ -17,7 +17,6 @@ import Data.Function import Control.Monad.Reader (Reader, ask, runReader) import Data.IORef (IORef, newIORef, readIORef, writeIORef, modifyIORef) import System.FilePath (normalise) -import Text.PrettyPrint import ErrUtils import GHC @@ -33,6 +32,7 @@ import Language.Haskell.GhcMod.Doc (showPage) import Language.Haskell.GhcMod.DynFlags (withDynFlags) import Language.Haskell.GhcMod.Monad.Types import Language.Haskell.GhcMod.Error +import Language.Haskell.GhcMod.Pretty import Language.Haskell.GhcMod.Utils (mkRevRedirMapFunc) import qualified Language.Haskell.GhcMod.Gap as Gap import Prelude @@ -99,7 +99,7 @@ withLogger' env action = do let setLogger df = Gap.setLogAction df $ appendLogRef rfm df logref handlers = [ GHandler $ \ex -> return $ Left $ runReader (sourceError ex) gpe, - GHandler $ \ex -> return $ Left [render $ ghcExceptionDoc ex] + GHandler $ \ex -> return $ Left [renderGm $ ghcExceptionDoc ex] ] gpe = GmPprEnv { gpeDynFlags = hsc_dflags env diff --git a/Language/Haskell/GhcMod/Logging.hs b/core/Language/Haskell/GhcMod/Logging.hs similarity index 94% rename from Language/Haskell/GhcMod/Logging.hs rename to core/Language/Haskell/GhcMod/Logging.hs index a7768ff..a6cfaff 100644 --- a/Language/Haskell/GhcMod/Logging.hs +++ b/core/Language/Haskell/GhcMod/Logging.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015 Daniel Gröber -- -- This program is free software: you can redistribute it and/or modify @@ -20,8 +20,8 @@ module Language.Haskell.GhcMod.Logging ( module Language.Haskell.GhcMod.Logging , module Language.Haskell.GhcMod.Pretty , GmLogLevel(..) - , module Text.PrettyPrint , module Data.Monoid + , module Pretty ) where import Control.Applicative hiding (empty) @@ -33,9 +33,10 @@ import Data.Monoid import Data.Maybe import System.IO import System.FilePath -import Text.PrettyPrint hiding (style, (<>)) import Prelude +import Pretty hiding (style, (<>)) + import Language.Haskell.GhcMod.Monad.Types import Language.Haskell.GhcMod.Types import Language.Haskell.GhcMod.Pretty @@ -77,7 +78,7 @@ gmLog level loc' doc = do let loc | loc' == "" = empty | otherwise = text loc' <+>: empty msgDoc = sep [loc, doc] - msg = dropWhileEnd isSpace $ gmRenderDoc $ gmLogLevelDoc level <+>: msgDoc + msg = dropWhileEnd isSpace $ renderGm $ gmLogLevelDoc level <+>: msgDoc when (level <= level') $ gmErrStrLn msg gmLogQuiet level loc' doc diff --git a/Language/Haskell/GhcMod/Monad.hs b/core/Language/Haskell/GhcMod/Monad.hs similarity index 99% rename from Language/Haskell/GhcMod/Monad.hs rename to core/Language/Haskell/GhcMod/Monad.hs index fb25074..8f44db8 100644 --- a/Language/Haskell/GhcMod/Monad.hs +++ b/core/Language/Haskell/GhcMod/Monad.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015 Daniel Gröber -- -- This program is free software: you can redistribute it and/or modify diff --git a/Language/Haskell/GhcMod/Monad/Compat.hs_h b/core/Language/Haskell/GhcMod/Monad/Compat.hs_h similarity index 100% rename from Language/Haskell/GhcMod/Monad/Compat.hs_h rename to core/Language/Haskell/GhcMod/Monad/Compat.hs_h diff --git a/Language/Haskell/GhcMod/Monad/Env.hs b/core/Language/Haskell/GhcMod/Monad/Env.hs similarity index 97% rename from Language/Haskell/GhcMod/Monad/Env.hs rename to core/Language/Haskell/GhcMod/Monad/Env.hs index e154e50..23b42be 100644 --- a/Language/Haskell/GhcMod/Monad/Env.hs +++ b/core/Language/Haskell/GhcMod/Monad/Env.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015,2016 Daniel Gröber -- -- This program is free software: you can redistribute it and/or modify diff --git a/Language/Haskell/GhcMod/Monad/Log.hs b/core/Language/Haskell/GhcMod/Monad/Log.hs similarity index 98% rename from Language/Haskell/GhcMod/Monad/Log.hs rename to core/Language/Haskell/GhcMod/Monad/Log.hs index 4da0fec..f353084 100644 --- a/Language/Haskell/GhcMod/Monad/Log.hs +++ b/core/Language/Haskell/GhcMod/Monad/Log.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015,2016 Daniel Gröber -- -- This program is free software: you can redistribute it and/or modify diff --git a/Language/Haskell/GhcMod/Monad/Newtypes.hs b/core/Language/Haskell/GhcMod/Monad/Newtypes.hs similarity index 96% rename from Language/Haskell/GhcMod/Monad/Newtypes.hs rename to core/Language/Haskell/GhcMod/Monad/Newtypes.hs index ab3d82e..90a6b26 100644 --- a/Language/Haskell/GhcMod/Monad/Newtypes.hs +++ b/core/Language/Haskell/GhcMod/Monad/Newtypes.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015,2016 Daniel Gröber -- -- This program is free software: you can redistribute it and/or modify @@ -48,12 +48,12 @@ type GhcModT m = GmT (GmOutT m) newtype GmOutT m a = GmOutT { unGmOutT :: ReaderT GhcModOut m a } deriving ( Functor - , Applicative - , Alternative - , Monad - , MonadPlus - , MonadTrans - ) + , Applicative + , Alternative + , Monad + , MonadPlus + , MonadTrans + ) newtype GmT m a = GmT { unGmT :: StateT GhcModState diff --git a/Language/Haskell/GhcMod/Monad/Orphans.hs b/core/Language/Haskell/GhcMod/Monad/Orphans.hs similarity index 98% rename from Language/Haskell/GhcMod/Monad/Orphans.hs rename to core/Language/Haskell/GhcMod/Monad/Orphans.hs index 88e3e28..18fe9f5 100644 --- a/Language/Haskell/GhcMod/Monad/Orphans.hs +++ b/core/Language/Haskell/GhcMod/Monad/Orphans.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015,2016 Daniel Gröber -- -- This program is free software: you can redistribute it and/or modify diff --git a/Language/Haskell/GhcMod/Monad/Out.hs b/core/Language/Haskell/GhcMod/Monad/Out.hs similarity index 97% rename from Language/Haskell/GhcMod/Monad/Out.hs rename to core/Language/Haskell/GhcMod/Monad/Out.hs index 92e88db..d372f9f 100644 --- a/Language/Haskell/GhcMod/Monad/Out.hs +++ b/core/Language/Haskell/GhcMod/Monad/Out.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015,2016 Daniel Gröber -- -- This program is free software: you can redistribute it and/or modify diff --git a/Language/Haskell/GhcMod/Monad/State.hs b/core/Language/Haskell/GhcMod/Monad/State.hs similarity index 97% rename from Language/Haskell/GhcMod/Monad/State.hs rename to core/Language/Haskell/GhcMod/Monad/State.hs index 701ba27..5edcbe7 100644 --- a/Language/Haskell/GhcMod/Monad/State.hs +++ b/core/Language/Haskell/GhcMod/Monad/State.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015,2016 Daniel Gröber -- -- This program is free software: you can redistribute it and/or modify diff --git a/Language/Haskell/GhcMod/Monad/Types.hs b/core/Language/Haskell/GhcMod/Monad/Types.hs similarity index 99% rename from Language/Haskell/GhcMod/Monad/Types.hs rename to core/Language/Haskell/GhcMod/Monad/Types.hs index c94efcc..416ee13 100644 --- a/Language/Haskell/GhcMod/Monad/Types.hs +++ b/core/Language/Haskell/GhcMod/Monad/Types.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015 Daniel Gröber -- -- This program is free software: you can redistribute it and/or modify diff --git a/Language/Haskell/GhcMod/Options/DocUtils.hs b/core/Language/Haskell/GhcMod/Options/DocUtils.hs similarity index 96% rename from Language/Haskell/GhcMod/Options/DocUtils.hs rename to core/Language/Haskell/GhcMod/Options/DocUtils.hs index c81dec8..9fd846c 100644 --- a/Language/Haskell/GhcMod/Options/DocUtils.hs +++ b/core/Language/Haskell/GhcMod/Options/DocUtils.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015 Nikolay Yakimov -- -- This program is free software: you can redistribute it and/or modify diff --git a/Language/Haskell/GhcMod/Options/Help.hs b/core/Language/Haskell/GhcMod/Options/Help.hs similarity index 97% rename from Language/Haskell/GhcMod/Options/Help.hs rename to core/Language/Haskell/GhcMod/Options/Help.hs index d43b6fb..2ecc144 100644 --- a/Language/Haskell/GhcMod/Options/Help.hs +++ b/core/Language/Haskell/GhcMod/Options/Help.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015 Nikolay Yakimov -- -- This program is free software: you can redistribute it and/or modify diff --git a/Language/Haskell/GhcMod/Options/Options.hs b/core/Language/Haskell/GhcMod/Options/Options.hs similarity index 97% rename from Language/Haskell/GhcMod/Options/Options.hs rename to core/Language/Haskell/GhcMod/Options/Options.hs index 7d4aa3a..34d6fe0 100644 --- a/Language/Haskell/GhcMod/Options/Options.hs +++ b/core/Language/Haskell/GhcMod/Options/Options.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015 Nikolay Yakimov -- -- This program is free software: you can redistribute it and/or modify @@ -146,6 +146,10 @@ globalArgSpec = Options <=> value "UTF-8" <=> showDefault <=> help "I/O encoding" + <*> switch + $$ long "stack-build-deps" + <=> showDefault + <=> help "Build dependencies if needed when using stack" where fileMappingSpec = getFileMapping . splitOn '=' <$> strOption diff --git a/Language/Haskell/GhcMod/Output.hs b/core/Language/Haskell/GhcMod/Output.hs similarity index 99% rename from Language/Haskell/GhcMod/Output.hs rename to core/Language/Haskell/GhcMod/Output.hs index f8dfa4b..9a02b1c 100644 --- a/Language/Haskell/GhcMod/Output.hs +++ b/core/Language/Haskell/GhcMod/Output.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015 Daniel Gröber -- -- This program is free software: you can redistribute it and/or modify diff --git a/Language/Haskell/GhcMod/PathsAndFiles.hs b/core/Language/Haskell/GhcMod/PathsAndFiles.hs similarity index 75% rename from Language/Haskell/GhcMod/PathsAndFiles.hs rename to core/Language/Haskell/GhcMod/PathsAndFiles.hs index 6c0a68e..dcb982e 100644 --- a/Language/Haskell/GhcMod/PathsAndFiles.hs +++ b/core/Language/Haskell/GhcMod/PathsAndFiles.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015 Daniel Gröber -- -- This program is free software: you can redistribute it and/or modify @@ -24,6 +24,7 @@ import Control.Arrow (second) import Control.Applicative import Control.Exception as E import Control.Monad +import Control.Monad.Trans.Maybe import Data.List import Data.Char import Data.Maybe @@ -45,45 +46,41 @@ type DirPath = FilePath -- | Guaranteed to be the name of a file only (no slashes). type FileName = String -newtype UnString = UnString { unString :: String } - -instance Show UnString where - show = unString - -instance Read UnString where - readsPrec _ = \str -> [(UnString str, "")] - -- | @findCabalFiles dir@. Searches for a @.cabal@ files in @dir@'s parent -- directories. The first parent directory containing more than one cabal file -- is assumed to be the project directory. If only one cabal file exists in this -- directory it is returned otherwise @findCabalFiles@ throws 'GMENoCabalFile' -- or 'GMETooManyCabalFiles' findCabalFile :: FilePath -> IO (Maybe FilePath) -findCabalFile dir = do - -- List of directories and all cabal file candidates - dcs <- findFileInParentsP isCabalFile dir :: IO ([(DirPath, [FileName])]) - let css = uncurry appendDir `map` dcs :: [[FilePath]] - case find (not . null) css of - Nothing -> return Nothing - Just cfs@(_:_:_) -> throw $ GMETooManyCabalFiles cfs - Just (a:_) -> return (Just a) - Just [] -> error "findCabalFile" - where - appendDir :: DirPath -> [FileName] -> [FilePath] - appendDir d fs = (d ) `map` fs +findCabalFile dir = findFileInParentsP isCabalFile pick dir + where + pick [] = Nothing + pick [cf] = Just cf + pick cfs = throw $ GMETooManyCabalFiles cfs findStackConfigFile :: FilePath -> IO (Maybe FilePath) -findStackConfigFile dir = do - fs <- map (second listToMaybe) <$> findFileInParentsP (=="stack.yaml") dir - case find (isJust . snd) fs of - Nothing -> return Nothing - Just (d, Just a) -> return $ Just $ d a - Just (_, Nothing) -> error "findStackConfigFile" +findStackConfigFile dir = + findFileInParentsP (=="stack.yaml") pick dir + where + pick [] = Nothing + pick (sf:_) = Just sf + +findCabalSandboxDir :: FilePath -> IO (Maybe FilePath) +findCabalSandboxDir dir = + fmap takeDirectory <$> findFileInParentsP isSandboxConfig pick dir + where + isSandboxConfig = (==sandboxConfigFileName) + pick [] = Nothing + pick (sc:_) = Just sc + +findCustomPackageDbFile :: FilePath -> IO (Maybe FilePath) +findCustomPackageDbFile dir = + mightExist $ dir "ghc-mod.package-db-stack" -- | Get path to sandbox config file getSandboxDb :: Cradle -> IO (Maybe GhcPkgDb) getSandboxDb crdl = do - mConf <-traverse readFile =<< mightExist (sandboxConfigFile crdl) + mConf <- traverse readFile =<< mightExist (sandboxConfigFile crdl) bp <- buildPlatform readProcess return $ PackageDb . fixPkgDbVer bp <$> (extractSandboxDbDir =<< mConf) @@ -129,32 +126,35 @@ takeExtension' p = then "" -- just ".cabal" is not a valid cabal file else takeExtension p --- | @findFileInParentsP p dir@ Look for files satisfying @p@ in @dir@ and all +-- | @findFileInParentsP p r dir@ Look for files satisfying @p@ in @dir@ and all +-- it's parent directories. Files found to satisfy @p@ in a given directory are +-- passed to @r@ and if this yields a 'Just' value the search finishes early +-- without examinig any more directories and this value is returned. +findFileInParentsP :: (FilePath -> Bool) + -> ([FilePath] -> Maybe a) + -> FilePath + -> IO (Maybe a) +findFileInParentsP p r dir = runMaybeT $ + join $ msum <$> map (MaybeT . fmap r) <$> liftIO (findFilesInParentsP p dir) + +-- | @findFilesInParentsP p dir@ Look for files satisfying @p@ in @dir@ and all -- it's parent directories. -findFileInParentsP :: (FilePath -> Bool) -> FilePath - -> IO [(DirPath, [FileName])] -findFileInParentsP p dir' = U.makeAbsolute' dir' >>= \dir -> - getFilesP p `zipMapM` parents dir +findFilesInParentsP :: (FilePath -> Bool) -> FilePath + -> IO [IO [FilePath]] +findFilesInParentsP p dir' = U.makeAbsolute' dir' >>= \dir -> return $ + map (\d -> (map (d )) <$> getFilesP p d) $ parents dir -- | @getFilesP p dir@. Find all __files__ satisfying @p@ in @.cabal@ in @dir@. getFilesP :: (FilePath -> Bool) -> DirPath -> IO [FileName] -getFilesP p dir = filterM p' =<< getDirectoryContents dir +getFilesP p dir = filterM p' =<< getDirectoryContentsSafe where p' fn = do (p fn && ) <$> doesFileExist (dir fn) - -findCabalSandboxDir :: FilePath -> IO (Maybe FilePath) -findCabalSandboxDir dir = do - dss <- findFileInParentsP isSandboxConfig dir - return $ case find (not . null . snd) $ dss of - Just (sbDir, _:_) -> Just sbDir - _ -> Nothing - - where - isSandboxConfig = (==sandboxConfigFileName) - -zipMapM :: Monad m => (a -> m c) -> [a] -> m [(a,c)] -zipMapM f as = mapM (\a -> liftM ((,) a) $ f a) as + getDirectoryContentsSafe = do + rdable <- readable <$> getPermissions dir + if rdable + then getDirectoryContents dir + else return [] -- | @parents dir@. Returns all parent directories of @dir@ including @dir@. -- @@ -240,11 +240,3 @@ mergedPkgOptsCacheFile dist = pkgDbStackCacheFile :: FilePath -> FilePath pkgDbStackCacheFile dist = setupConfigPath dist <.> "ghc-mod.package-db-stack" - --- | @findCustomPackageDbFile dir@. Searches for a @ghc-mod.package-db-stack@ file in @dir@. --- If it exists in the given directory it is returned otherwise @findCradleFile@ --- returns @Nothing@ -findCustomPackageDbFile :: FilePath -> IO (Maybe FilePath) -findCustomPackageDbFile directory = do - let path = directory "ghc-mod.package-db-stack" - mightExist path diff --git a/Language/Haskell/GhcMod/Pretty.hs b/core/Language/Haskell/GhcMod/Pretty.hs similarity index 79% rename from Language/Haskell/GhcMod/Pretty.hs rename to core/Language/Haskell/GhcMod/Pretty.hs index b2d9e7d..35718a8 100644 --- a/Language/Haskell/GhcMod/Pretty.hs +++ b/core/Language/Haskell/GhcMod/Pretty.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015 Daniel Gröber -- -- This program is free software: you can redistribute it and/or modify @@ -14,21 +14,36 @@ -- You should have received a copy of the GNU Affero General Public License -- along with this program. If not, see . -module Language.Haskell.GhcMod.Pretty where +module Language.Haskell.GhcMod.Pretty + ( renderGm + , renderSDoc + , gmComponentNameDoc + , gmLogLevelDoc + , (<+>:) + , fnDoc + , showToDoc + , warnDoc + , strLnDoc + , strDoc + ) where import Control.Arrow hiding ((<+>)) import Data.Char import Data.List import Distribution.Helper -import Text.PrettyPrint +import Pretty +import GHC +import Outputable (SDoc, withPprStyleDoc) import Language.Haskell.GhcMod.Types +import Language.Haskell.GhcMod.Doc +import Language.Haskell.GhcMod.Gap (renderGm) -docStyle :: Style -docStyle = style { ribbonsPerLine = 1.2 } - -gmRenderDoc :: Doc -> String -gmRenderDoc = renderStyle docStyle +renderSDoc :: GhcMonad m => SDoc -> m Doc +renderSDoc sdoc = do + df <- getSessionDynFlags + ppsty <- getStyle + return $ withPprStyleDoc df ppsty sdoc gmComponentNameDoc :: ChComponentName -> Doc gmComponentNameDoc ChSetupHsName = text $ "Setup.hs" @@ -55,8 +70,8 @@ a <+>: b = (a <> colon) <+> b fnDoc :: FilePath -> Doc fnDoc = doubleQuotes . text -showDoc :: Show a => a -> Doc -showDoc = strLnDoc . show +showToDoc :: Show a => a -> Doc +showToDoc = strLnDoc . show warnDoc :: Doc -> Doc warnDoc d = text "Warning" <+>: d diff --git a/Language/Haskell/GhcMod/Read.hs b/core/Language/Haskell/GhcMod/Read.hs similarity index 100% rename from Language/Haskell/GhcMod/Read.hs rename to core/Language/Haskell/GhcMod/Read.hs diff --git a/Language/Haskell/GhcMod/SrcUtils.hs b/core/Language/Haskell/GhcMod/SrcUtils.hs similarity index 97% rename from Language/Haskell/GhcMod/SrcUtils.hs rename to core/Language/Haskell/GhcMod/SrcUtils.hs index 912de92..5829fde 100644 --- a/Language/Haskell/GhcMod/SrcUtils.hs +++ b/core/Language/Haskell/GhcMod/SrcUtils.hs @@ -16,11 +16,7 @@ import qualified Var as G import qualified Type as G import GHC.SYB.Utils import GhcMonad -#if MIN_VERSION_haskell_src_exts(1,18,0) import qualified Language.Haskell.Exts as HE -#else -import qualified Language.Haskell.Exts.Annotated as HE -#endif import Language.Haskell.GhcMod.Doc import Language.Haskell.GhcMod.Gap import qualified Language.Haskell.GhcMod.Gap as Gap @@ -179,11 +175,7 @@ fourIntsHE loc = ( HE.srcSpanStartLine loc, HE.srcSpanStartColumn loc typeSigInRangeHE :: Int -> Int -> HE.Decl HE.SrcSpanInfo -> Bool typeSigInRangeHE lineNo colNo (HE.TypeSig (HE.SrcSpanInfo s _) _ _) = HE.srcSpanStart s <= (lineNo, colNo) && HE.srcSpanEnd s >= (lineNo, colNo) -#if MIN_VERSION_haskell_src_exts(1,18,0) typeSigInRangeHE lineNo colNo (HE.TypeFamDecl (HE.SrcSpanInfo s _) _ _ _) = -#else -typeSigInRangeHE lineNo colNo (HE.TypeFamDecl (HE.SrcSpanInfo s _) _ _) = -#endif HE.srcSpanStart s <= (lineNo, colNo) && HE.srcSpanEnd s >= (lineNo, colNo) typeSigInRangeHE lineNo colNo (HE.DataFamDecl (HE.SrcSpanInfo s _) _ _ _) = HE.srcSpanStart s <= (lineNo, colNo) && HE.srcSpanEnd s >= (lineNo, colNo) diff --git a/Language/Haskell/GhcMod/Stack.hs b/core/Language/Haskell/GhcMod/Stack.hs similarity index 87% rename from Language/Haskell/GhcMod/Stack.hs rename to core/Language/Haskell/GhcMod/Stack.hs index 8a0fb3d..e733c88 100644 --- a/Language/Haskell/GhcMod/Stack.hs +++ b/core/Language/Haskell/GhcMod/Stack.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015 Daniel Gröber -- -- This program is free software: you can redistribute it and/or modify @@ -48,9 +48,10 @@ patchStackPrograms Cradle { cradleProject = (StackProject senv) } progs = do } patchStackPrograms _crdl progs = return progs -getStackEnv :: (IOish m, GmOut m, GmLog m) => FilePath -> m (Maybe StackEnv) -getStackEnv projdir = U.withDirectory_ projdir $ runMaybeT $ do - env <- map (liToTup . splitOn ": ") . lines <$> readStack ["path"] +getStackEnv :: (IOish m, GmOut m, GmLog m) + => FilePath -> FilePath -> m (Maybe StackEnv) +getStackEnv projdir stackProg = U.withDirectory_ projdir $ runMaybeT $ do + env <- map (liToTup . splitOn ": ") . lines <$> readStack stackProg ["path"] let look k = fromJustNote "getStackEnv" $ lookup k env return StackEnv { seDistDir = look "dist-dir" @@ -82,9 +83,10 @@ findExecutablesInDirectories' path binary = exeExtension' = if isWindows then "exe" else "" -readStack :: (IOish m, GmOut m, GmLog m) => [String] -> MaybeT m String -readStack args = do - stack <- MaybeT $ liftIO $ findExecutable "stack" +readStack :: (IOish m, GmOut m, GmLog m) + => FilePath -> [String] -> MaybeT m String +readStack exe args = do + stack <- MaybeT $ liftIO $ findExecutable exe readProc <- lift gmReadProcess flip gcatch handler $ do liftIO $ evaluate =<< readProc stack args "" diff --git a/Language/Haskell/GhcMod/Target.hs b/core/Language/Haskell/GhcMod/Target.hs similarity index 93% rename from Language/Haskell/GhcMod/Target.hs rename to core/Language/Haskell/GhcMod/Target.hs index 7b5c857..f0eeeb6 100644 --- a/Language/Haskell/GhcMod/Target.hs +++ b/core/Language/Haskell/GhcMod/Target.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015 Daniel Gröber -- -- This program is free software: you can redistribute it and/or modify @@ -27,6 +27,8 @@ import GHC.LanguageExtensions import GHC.Paths (libdir) import SysTools import DynFlags +import HscTypes +import Pretty import Language.Haskell.GhcMod.DynFlags import Language.Haskell.GhcMod.Monad.Types @@ -69,39 +71,44 @@ runGmPkgGhc action = do withLightHscEnv pkgOpts $ \env -> liftIO $ runLightGhc env action initSession :: IOish m - => [GHCOption] -> (forall gm. GhcMonad gm => DynFlags -> gm DynFlags) -> GhcModT m () + => [GHCOption] + -> (forall gm. GhcMonad gm => DynFlags -> gm DynFlags) + -> GhcModT m () initSession opts mdf = do s <- gmsGet case gmGhcSession s of Nothing -> do gmLog GmDebug "initSession" $ text "Session not initialized, creating new one" putNewSession s - Just GmGhcSession {..} -> do - gmLog GmDebug "initSession" $ text "Flags changed, creating new session" + Just (GmGhcSession hsc_env_ref) -> do crdl <- cradle - changed <- liftIO $ runLightGhc' gmgsSession $ do - df <- getSessionDynFlags - ndf <- initDF crdl - return $ ndf `eqDynFlags` df + + df <- liftIO $ hsc_dflags <$> readIORef hsc_env_ref + changed <- + withLightHscEnv' (initDF crdl) $ \hsc_env -> + return $ not $ hsc_dflags hsc_env `eqDynFlags` df if changed - then putNewSession s - else return () + then do + gmLog GmDebug "initSession" $ text "Flags changed, creating new session" + teardownSession hsc_env_ref + putNewSession s + else + gmLog GmDebug "initSession" $ text "Session already initialized" where - initDF Cradle { cradleTempDir } = do - let setDf df = setTmpDir cradleTempDir <$> (mdf =<< addCmdOpts opts df) - _ <- setSessionDynFlags =<< setDf =<< getSessionDynFlags - getSessionDynFlags + initDF Cradle { cradleTempDir } df = + setTmpDir cradleTempDir <$> (mdf =<< addCmdOpts opts df) + teardownSession hsc_env_ref = do + hsc_env <- liftIO $ readIORef hsc_env_ref + teardownLightEnv hsc_env + + putNewSession :: IOish m => GhcModState -> GhcModT m () putNewSession s = do - rghc <- (liftIO . newIORef =<< newSession) - gmsPut s { gmGhcSession = Just $ GmGhcSession opts rghc } - - newSession = do crdl <- cradle - liftIO $ runGhc (Just libdir) $ do - _ <- initDF crdl - getSession + nhsc_env_ref <- liftIO . newIORef =<< newLightEnv (initDF crdl) + runLightGhc' nhsc_env_ref $ setSessionDynFlags =<< getSessionDynFlags + gmsPut s { gmGhcSession = Just $ GmGhcSession nhsc_env_ref } -- | Drop the currently active GHC session, the next that requires a GHC session @@ -110,7 +117,7 @@ dropSession :: IOish m => GhcModT m () dropSession = do s <- gmsGet case gmGhcSession s of - Just (GmGhcSession _opts ref) -> do + Just (GmGhcSession ref) -> do -- TODO: This is still not enough, there seem to still be references to -- GHC's state around afterwards. liftIO $ writeIORef ref (error "HscEnv: session was dropped") @@ -387,7 +394,7 @@ resolveModule env srcDirs (Left fn') = do case emn of Left errs -> do gmLog GmWarning ("resolveModule " ++ show fn) $ - Monoid.mempty $+$ (vcat $ map text errs) + Pretty.empty $+$ (vcat $ map text errs) return Nothing -- TODO: should expose these errors otherwise -- modules with preprocessor/parse errors are -- going to be missing @@ -456,7 +463,6 @@ loadTargets opts targetStrs = do let interp = needsHscInterpreted mg target <- hscTarget <$> getSessionDynFlags when (interp && target /= HscInterpreted) $ do - resetTargets targets _ <- setSessionDynFlags . setHscInterpreted =<< getSessionDynFlags gmLog GmInfo "loadTargets" $ text "Target needs interpeter, switching to LinkInMemory/HscInterpreted. Perfectly normal if anything is using TemplateHaskell, QuasiQuotes or PatternSynonyms." @@ -482,11 +488,6 @@ loadTargets opts targetStrs = do return $ Target tid taoc src relativize tgt = return tgt - resetTargets targets' = do - setTargets [] - void $ load LoadAllTargets - setTargets targets' - showTargetId (Target (TargetModule s) _ _) = moduleNameString s showTargetId (Target (TargetFile s _) _ _) = s diff --git a/Language/Haskell/GhcMod/Types.hs b/core/Language/Haskell/GhcMod/Types.hs similarity index 99% rename from Language/Haskell/GhcMod/Types.hs rename to core/Language/Haskell/GhcMod/Types.hs index 407beef..4836abb 100644 --- a/Language/Haskell/GhcMod/Types.hs +++ b/core/Language/Haskell/GhcMod/Types.hs @@ -37,7 +37,7 @@ import qualified MonadUtils as GHC (MonadIO(..)) import GHC (ModuleName, moduleNameString, mkModuleName) import HscTypes (HscEnv) import GHC.Generics -import Text.PrettyPrint (Doc) +import Pretty (Doc) import Prelude import Language.Haskell.GhcMod.Caching.Types @@ -106,6 +106,7 @@ data Options = Options { , optGhcUserOptions :: [GHCOption] , optFileMappings :: [(FilePath, Maybe FilePath)] , optEncoding :: String + , optStackBuildDeps :: Bool } deriving (Show) -- | A default 'Options'. @@ -126,6 +127,7 @@ defaultOptions = Options { , optGhcUserOptions = [] , optFileMappings = [] , optEncoding = "UTF-8" + , optStackBuildDeps = False } ---------------------------------------------------------------- @@ -188,7 +190,6 @@ instance Monoid GhcModLog where GhcModLog (ml' `mplus` ml) (vd `mappend` vd') (ls `mappend` ls') data GmGhcSession = GmGhcSession { - gmgsOptions :: ![GHCOption], gmgsSession :: !(IORef HscEnv) } diff --git a/Language/Haskell/GhcMod/Utils.hs b/core/Language/Haskell/GhcMod/Utils.hs similarity index 69% rename from Language/Haskell/GhcMod/Utils.hs rename to core/Language/Haskell/GhcMod/Utils.hs index 401ab9d..c923750 100644 --- a/Language/Haskell/GhcMod/Utils.hs +++ b/core/Language/Haskell/GhcMod/Utils.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015 Daniel Gröber -- -- This program is free software: you can redistribute it and/or modify @@ -40,7 +40,7 @@ import System.IO.Temp (createTempDirectory) import System.Process (readProcess) import Text.Printf -import Paths_ghc_mod (getLibexecDir) +import Paths_ghc_mod (getLibexecDir, getBinDir) import Utils import Prelude @@ -79,73 +79,18 @@ whenM mb ma = mb >>= flip when ma -- | Returns the path to the currently running ghc-mod executable. With ghc<7.6 -- this is a guess but >=7.6 uses 'getExecutablePath'. ghcModExecutable :: IO FilePath -#ifndef SPEC ghcModExecutable = do - dir <- takeDirectory <$> getExecutablePath' - return $ (if dir == "." then "" else dir) "ghc-mod" -#else -ghcModExecutable = fmap ( "dist/build/ghc-mod/ghc-mod") getCurrentDirectory -#endif - -findLibexecExe :: String -> IO FilePath -findLibexecExe "cabal-helper-wrapper" = do - libexecdir <- getLibexecDir - let exeName = "cabal-helper-wrapper" - exe = libexecdir exeName - - exists <- doesFileExist exe - - if exists - then return exe - else do - mdir <- tryFindGhcModTreeDataDir - case mdir of - Nothing -> - error $ libexecNotExitsError exeName libexecdir - Just dir -> - return $ dir "dist" "build" exeName exeName -findLibexecExe exe = error $ "findLibexecExe: Unknown executable: " ++ exe - -libexecNotExitsError :: String -> FilePath -> String -libexecNotExitsError exe dir = printf - ( "Could not find $libexecdir/%s\n" - ++"\n" - ++"If you are a developer set the environment variable `ghc_mod_libexecdir'\n" - ++"to override $libexecdir[1] the following will work in the ghc-mod tree:\n" - ++"\n" - ++" $ export ghc_mod_libexecdir=$PWD/dist/build/%s\n" - ++"\n" - ++"[1]: %s\n" - ++"\n" - ++"If you don't know what I'm talking about something went wrong with your\n" - ++"installation. Please report this problem here:\n" - ++"\n" - ++" https://github.com/kazu-yamamoto/ghc-mod/issues") exe exe dir - -tryFindGhcModTreeLibexecDir :: IO (Maybe FilePath) -tryFindGhcModTreeLibexecDir = do - exe <- getExecutablePath' - dir <- case takeFileName exe of - "ghc" -> getCurrentDirectory -- we're probably in ghci; try CWD - _ -> return $ (!!4) $ iterate takeDirectory exe - exists <- doesFileExist $ dir "ghc-mod.cabal" - return $ if exists - then Just dir - else Nothing - -tryFindGhcModTreeDataDir :: IO (Maybe FilePath) -tryFindGhcModTreeDataDir = do - dir <- (!!4) . iterate takeDirectory <$> getExecutablePath' - exists <- doesFileExist $ dir "ghc-mod.cabal" - return $ if exists - then Just dir - else Nothing - -readLibExecProcess' :: (MonadIO m, ExceptionMonad m) - => String -> [String] -> m String -readLibExecProcess' cmd args = do - exe <- liftIO $ findLibexecExe cmd - liftIO $ readProcess exe args "" + exe <- getExecutablePath' + stack <- lookupEnv "STACK_EXE" + case takeBaseName exe of + "spec" | Just _ <- stack -> + ( "ghc-mod") <$> getBinDir + "spec" -> + ( "dist/build/ghc-mod/ghc-mod") <$> getCurrentDirectory + "ghc-mod" -> + return exe + _ -> + return $ takeDirectory exe "ghc-mod" getExecutablePath' :: IO FilePath #if __GLASGOW_HASKELL__ >= 706 diff --git a/Language/Haskell/GhcMod/World.hs b/core/Language/Haskell/GhcMod/World.hs similarity index 100% rename from Language/Haskell/GhcMod/World.hs rename to core/Language/Haskell/GhcMod/World.hs diff --git a/elisp/ghc-func.el b/elisp/ghc-func.el index 886e552..59397bc 100644 --- a/elisp/ghc-func.el +++ b/elisp/ghc-func.el @@ -211,7 +211,7 @@ default-directory))) ;; ghc-mod root (with-temp-buffer (let ((default-directory cdir)) - (apply 'ghc-call-process target nil t nil + (apply 'ghc-call-process target nil '(t nil) nil (append (ghc-make-ghc-options) cmds)) (buffer-substring (point-min) (1- (point-max))))))))) diff --git a/elisp/ghc-process.el b/elisp/ghc-process.el index 257a18e..6135d2b 100644 --- a/elisp/ghc-process.el +++ b/elisp/ghc-process.el @@ -55,7 +55,7 @@ (let ((pro (ghc-get-process cpro name buf root)) (map-cmd (format "map-file %s\n" file))) ; (unmap-cmd (format "unmap-file %s\n" file))) - (when (buffer-modified-p (current-buffer)) + (when (buffer-modified-p cbuf) (setq ghc-process-file-mapping t) (setq ghc-process-async-after-callback nil) (erase-buffer) diff --git a/elisp/ghc.el b/elisp/ghc.el index 9b1c0f2..bb054b2 100644 --- a/elisp/ghc.el +++ b/elisp/ghc.el @@ -28,7 +28,7 @@ (< emacs-minor-version minor))) (error "ghc-mod requires at least Emacs %d.%d" major minor))) -(defconst ghc-version "5.7.0.0") +(defconst ghc-version "5.8.0.0") (defgroup ghc-mod '() "ghc-mod customization") diff --git a/ghc-mod.cabal b/ghc-mod.cabal index b1178fc..61d473b 100644 --- a/ghc-mod.cabal +++ b/ghc-mod.cabal @@ -1,5 +1,5 @@ Name: ghc-mod -Version: 5.7.0.0 +Version: 5.8.0.0 Author: Kazu Yamamoto , Daniel Gröber , Alejandro Serrano , @@ -8,8 +8,8 @@ Maintainer: Daniel Gröber License: AGPL-3 License-File: LICENSE License-Files: COPYING.BSD3 COPYING.AGPL3 -Homepage: http://www.mew.org/~kazu/proj/ghc-mod/ -Synopsis: Happy Haskell Programming +Homepage: https://github.com/DanielG/ghc-mod +Synopsis: Happy Haskell Hacking Description: ghc-mod is a backend program to enrich Haskell programming in editors. It strives to offer most of the features one has come to expect from modern IDEs @@ -22,44 +22,30 @@ Description: significantly extend ghc-mod you should submit these changes upstream instead of implementing them on top of the library. - For more information, please see its home page. Category: GHC, Development -Cabal-Version: >= 1.14 +Cabal-Version: >= 1.18 Build-Type: Custom -Tested-With: GHC == 7.6.3 - GHC == 7.8.4 - , GHC == 7.10.3 - , GHC == 8.0.1 - , GHC == 8.0.2 Data-Files: elisp/Makefile elisp/*.el -Data-Files: LICENSE COPYING.BSD3 COPYING.AGPL3 Extra-Source-Files: ChangeLog - cabal.project - SetupCompat.hs - NotCPP/*.hs - NotCPP/COPYING - Language/Haskell/GhcMod/Monad/Compat.hs_h + README.md + core/Language/Haskell/GhcMod/Monad/Compat.hs_h test/data/annotations/*.hs test/data/broken-cabal/*.cabal - test/data/broken-cabal/cabal.sandbox.config.in test/data/broken-sandbox/cabal.sandbox.config test/data/broken-sandbox/dummy.cabal test/data/cabal-flags/cabal-flags.cabal test/data/cabal-project/*.cabal test/data/cabal-project/*.hs test/data/cabal-project/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/Cabal-1.18.1.3-2b161c6bf77657aa17e1681d83cb051b.conf - test/data/cabal-project/cabal.sandbox.config.in test/data/cabal-project/subdir1/subdir2/dummy test/data/case-split/*.hs - test/data/check-packageid/cabal.sandbox.config.in test/data/check-packageid/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf test/data/check-test-subdir/*.cabal test/data/check-test-subdir/src/Check/Test/*.hs test/data/check-test-subdir/test/*.hs test/data/check-test-subdir/test/Bar/*.hs - test/data/duplicate-pkgver/cabal.sandbox.config.in test/data/duplicate-pkgver/duplicate-pkgver.cabal test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-1.0-7c59d13f32294d1ef6dc6233c24df961.conf test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-14e543bdae2da4d2aeff5386892c9112.conf @@ -94,60 +80,69 @@ Extra-Source-Files: ChangeLog test/data/file-mapping/preprocessor/*.hs test/data/file-mapping/lhs/*.lhs test/data/nice-qualification/*.hs - test/data/stack-project/stack.yaml + test/data/stack-project/stack.yaml.in test/data/stack-project/new-template.cabal test/data/stack-project/*.hs test/data/stack-project/app/*.hs test/data/stack-project/src/*.hs test/data/stack-project/test/*.hs + bench/data/simple-cabal/simple-cabal.cabal + bench/data/simple-cabal/*.hs + Custom-Setup Setup-Depends: base - , Cabal < 1.25 + , Cabal >= 1.18 && < 1.25 , containers , filepath + , directory , process , template-haskell , transformers + Library Default-Language: Haskell2010 GHC-Options: -Wall -fno-warn-deprecations Default-Extensions: ScopedTypeVariables, RecordWildCards, NamedFieldPuns, ConstraintKinds, FlexibleContexts, DataKinds, KindSignatures, TypeOperators, ViewPatterns - Exposed-Modules: Language.Haskell.GhcMod - Language.Haskell.GhcMod.Internal - Language.Haskell.GhcMod.Boot - Language.Haskell.GhcMod.Browse + HS-Source-Dirs: ., core, shared + Exposed-Modules: + GhcMod + GhcModExe.Boot + GhcModExe.Browse + GhcModExe.CaseSplit + GhcModExe.Check + GhcModExe.Debug + GhcModExe.FillSig + GhcModExe.Find + GhcModExe.Flag + GhcModExe.Info + GhcModExe.Internal + GhcModExe.Lang + GhcModExe.Lint + GhcModExe.Modules + GhcModExe.PkgDoc + GhcModExe.Test Language.Haskell.GhcMod.CabalHelper Language.Haskell.GhcMod.Caching Language.Haskell.GhcMod.Caching.Types - Language.Haskell.GhcMod.CaseSplit - Language.Haskell.GhcMod.Check Language.Haskell.GhcMod.Convert Language.Haskell.GhcMod.Cradle Language.Haskell.GhcMod.CustomPackageDb - Language.Haskell.GhcMod.Debug Language.Haskell.GhcMod.DebugLogger Language.Haskell.GhcMod.Doc Language.Haskell.GhcMod.DynFlags Language.Haskell.GhcMod.DynFlagsTH Language.Haskell.GhcMod.Error Language.Haskell.GhcMod.FileMapping - Language.Haskell.GhcMod.FillSig - Language.Haskell.GhcMod.Find - Language.Haskell.GhcMod.Flag Language.Haskell.GhcMod.Gap Language.Haskell.GhcMod.GhcPkg Language.Haskell.GhcMod.HomeModuleGraph - Language.Haskell.GhcMod.Info - Language.Haskell.GhcMod.Lang - Language.Haskell.GhcMod.Lint Language.Haskell.GhcMod.LightGhc Language.Haskell.GhcMod.Logger Language.Haskell.GhcMod.Logging - Language.Haskell.GhcMod.Modules Language.Haskell.GhcMod.Monad Language.Haskell.GhcMod.Monad.Env Language.Haskell.GhcMod.Monad.Log @@ -156,69 +151,69 @@ Library Language.Haskell.GhcMod.Monad.Out Language.Haskell.GhcMod.Monad.State Language.Haskell.GhcMod.Monad.Types + Language.Haskell.GhcMod.Options.DocUtils + Language.Haskell.GhcMod.Options.Help + Language.Haskell.GhcMod.Options.Options Language.Haskell.GhcMod.Output Language.Haskell.GhcMod.PathsAndFiles - Language.Haskell.GhcMod.PkgDoc Language.Haskell.GhcMod.Pretty Language.Haskell.GhcMod.Read Language.Haskell.GhcMod.SrcUtils Language.Haskell.GhcMod.Stack Language.Haskell.GhcMod.Target - Language.Haskell.GhcMod.Test Language.Haskell.GhcMod.Types Language.Haskell.GhcMod.Utils Language.Haskell.GhcMod.World - - Language.Haskell.GhcMod.Options.Options - Language.Haskell.GhcMod.Options.DocUtils - Language.Haskell.GhcMod.Options.Help Other-Modules: Paths_ghc_mod Utils Data.Binary.Generic System.Directory.ModTime - Build-Depends: base < 5 && >= 4.0 - , bytestring < 0.11 - , binary < 0.9 && >= 0.5.1.0 - , containers < 0.6 - , cabal-helper < 0.8 && >= 0.7.3.0 - , deepseq < 1.5 - , directory < 1.4 - , filepath < 1.5 - , ghc < 8.2 && >= 7.6 - , ghc-paths < 0.2 && >= 0.1.0.9 - , ghc-syb-utils < 0.3 && >= 0.2.3 - , hlint < 1.10 && >= 1.9.27 - , monad-journal < 0.8 && >= 0.4 - , old-time < 1.2 - , pretty < 1.2 - , process < 1.5 - , syb < 0.7 && >= 0.5.1 - , temporary < 1.3 && >= 1.2.0.3 - , transformers < 0.6 - , time < 1.7 - , transformers < 0.6 - , transformers-base < 0.5 && >= 0.4.4 - , mtl < 2.3 && >= 2.0 - , monad-control < 1.1 && >= 1 - , split < 0.3 && >= 0.2.2 - , haskell-src-exts < 1.19 && >= 1.16.0.1 - , text < 1.3 && >= 1.2.1.3 - , djinn-ghc < 0.1 && >= 0.0.2.2 - , fclabels == 2.0.* - , extra < 1.6 && >= 1.4.0 - , pipes < 4.4 && >= 4.1.0 - , safe < 0.4 && >= 0.3.9 - , optparse-applicative >=0.11.0 && <0.14.0 + Build-Depends: + -- See Note [GHC Boot libraries] + base + , binary + , bytestring + , containers + , deepseq + , directory + , filepath + , mtl + , old-time + , process , template-haskell - , syb - if impl(ghc < 7.8) - Build-Depends: convertible < 1.2 && >= 1.1.0.0 + , time + , transformers + + , djinn-ghc < 0.1 && >= 0.0.2.2 + , extra < 1.6 && >= 1.4 + , fclabels < 2.1 && >= 2.0 + , ghc-paths < 0.2 && >= 0.1.0.9 + , ghc-syb-utils < 0.3 && >= 0.2.3 + , haskell-src-exts < 1.20 && >= 1.18 + , hlint < 2.1 && >= 2.0.8 + , monad-control < 1.1 && >= 1 + , monad-journal < 0.8 && >= 0.4 + , optparse-applicative == 0.13.0.* + , pipes < 4.4 && >= 4.1 + , safe < 0.4 && >= 0.3.9 + , semigroups < 0.19 && >= 0.10.0 + , split < 0.3 && >= 0.2.2 + , syb < 0.7 && >= 0.5.1 + , temporary < 1.3 && >= 1.2.0.3 + , text < 1.3 && >= 1.2.1.3 + , transformers-base < 0.5 && >= 0.4.4 + + , cabal-helper < 0.8 && >= 0.7.3.0 + , ghc < 8.2 && >= 7.6 + if impl(ghc >= 8.0) Build-Depends: ghc-boot + if impl(ghc < 7.8) + Build-Depends: convertible < 1.2 && >= 1.1.0.0 Executable ghc-mod Default-Language: Haskell2010 - Main-Is: GHCMod.hs + Main-Is: GHCModMain.hs Other-Modules: Paths_ghc_mod , GHCMod.Options , GHCMod.Options.Commands @@ -226,41 +221,51 @@ Executable ghc-mod , GHCMod.Options.ShellParse GHC-Options: -Wall -fno-warn-deprecations -threaded Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src - Build-Depends: base < 5 && >= 4.0 - , directory < 1.4 - , filepath < 1.5 - , pretty < 1.2 - , process < 1.5 - , split < 0.3 && >= 0.2.2 - , mtl < 2.3 && >= 2.0 - , ghc < 8.2 && >= 7.6 - , monad-control < 1.1 && >= 1 - , fclabels ==2.0.* - , optparse-applicative >=0.11.0 && <0.14.0 - , semigroups < 0.19 && >= 0.10.0 + HS-Source-Dirs: src, shared + X-Internal: True + Build-Depends: + -- See Note [GHC Boot libraries] + base + , directory + , filepath + , mtl + , process + + , fclabels < 2.1 && >= 2.0 + , monad-control < 1.1 && >= 1 + , optparse-applicative == 0.13.0.* + , semigroups < 0.19 && >= 0.10.0 + , split < 0.3 && >= 0.2.2 + + , ghc < 8.2 && >= 7.6 , ghc-mod + Executable ghc-modi Default-Language: Haskell2010 Main-Is: GHCModi.hs Other-Modules: Paths_ghc_mod Utils + System.Directory.ModTime GHC-Options: -Wall -threaded -fno-warn-deprecations if os(windows) Cpp-Options: -DWINDOWS Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src, . - Build-Depends: base < 5 && >= 4.0 - , binary < 0.9 && >= 0.5.1.0 - , deepseq < 1.5 - , directory < 1.4 - , filepath < 1.5 - , process < 1.5 - , old-time < 1.2 - , time < 1.7 + HS-Source-Dirs: ., src, shared + Build-Depends: + -- See Note [GHC Boot libraries] + base + , binary + , deepseq + , directory + , filepath + , old-time + , process + , time + , ghc-mod + Test-Suite doctest Type: exitcode-stdio-1.0 Default-Language: Haskell2010 @@ -269,7 +274,8 @@ Test-Suite doctest Default-Extensions: ConstraintKinds, FlexibleContexts Main-Is: doctests.hs Build-Depends: base - , doctest < 0.12 && >= 0.9.3 + , doctest < 0.12 && >= 0.9.3 + Test-Suite spec Default-Language: Haskell2010 @@ -277,31 +283,106 @@ Test-Suite spec ConstraintKinds, FlexibleContexts, DataKinds, KindSignatures, TypeOperators, ViewPatterns Main-Is: Main.hs - Hs-Source-Dirs: test, ., src + Hs-Source-Dirs: test, src Ghc-Options: -Wall -fno-warn-deprecations -threaded - CPP-Options: -DSPEC=1 Type: exitcode-stdio-1.0 Other-Modules: Paths_ghc_mod Dir - Spec TestUtils + +-- $ ls test/*Spec.hs | sed 's_^.*/\(.*\)\.hs$_\1_' | sort BrowseSpec - CustomPackageDbSpec + CabalHelperSpec + CaseSplitSpec CheckSpec + CradleSpec + CustomPackageDbSpec + FileMappingSpec + FindSpec FlagSpec + GhcPkgSpec + HomeModuleGraphSpec InfoSpec LangSpec LintSpec ListSpec MonadSpec PathsAndFilesSpec - HomeModuleGraphSpec - FileMappingSpec ShellParseSpec + TargetSpec + + Build-Depends: + -- See Note [GHC Boot libraries] + base + , containers + , directory + , filepath + , mtl + , process + , transformers + + , fclabels < 2.1 && >= 2.0 + , hspec < 2.4 && >= 2.0.0 + , monad-journal < 0.8 && >= 0.4 + , split < 0.3 && >= 0.2.2 + , temporary < 1.3 && >= 1.2.0.3 + + + if impl(ghc < 7.8) + Build-Depends: convertible < 1.2 && >= 1.1.0.0 + if impl(ghc >= 8.0) + Build-Depends: ghc-boot + + Build-Depends: + cabal-helper < 0.8 && >= 0.7.1.0 + , ghc < 8.2 && >= 7.6 + , ghc-mod + + +Test-Suite shelltest + Default-Language: Haskell2010 + Main-Is: ShellTest.hs + Hs-Source-Dirs: shelltest + Type: exitcode-stdio-1.0 + Build-Tools: shelltest + Build-Depends: base + , process < 1.5 + -- , shelltestrunner >= 1.3.5 + if !flag(shelltest) + Buildable: False + + +Benchmark criterion + Type: exitcode-stdio-1.0 + Default-Language: Haskell2010 + Default-Extensions: ScopedTypeVariables, RecordWildCards, NamedFieldPuns, + ConstraintKinds, FlexibleContexts, + DataKinds, KindSignatures, TypeOperators, ViewPatterns + HS-Source-Dirs: bench, test + Main-Is: Bench.hs + Build-Depends: + -- See Note [GHC Boot libraries] + base + , directory + , filepath + + , criterion < 1.2 && >= 1.1.1.0 + , temporary < 1.3 && >= 1.2.0.3 + + , ghc-mod + + +Flag shelltest + Description: Enable/disable shelltest test-suite + Default: False + Manual: True - Build-Depends: hspec < 2.4 && >= 2.0.0 - X-Build-Depends-Like: CLibName Source-Repository head Type: git - Location: https://github.com/kazu-yamamoto/ghc-mod.git + Location: https://github.com/DanielG/ghc-mod.git + +-- Note [GHC Boot libraries] +-- +-- We don't give bounds to GHC boot libraries as our dependency on 'ghc' already +-- constrains these packages to the version that shipped with GHC. diff --git a/hackage-metadata/ghc-mod-5.0.0.cabal b/hackage-metadata/ghc-mod-5.0.0.cabal deleted file mode 100644 index 27f2e5d..0000000 --- a/hackage-metadata/ghc-mod-5.0.0.cabal +++ /dev/null @@ -1,215 +0,0 @@ -Name: ghc-mod -Version: 5.0.0 -Author: Kazu Yamamoto - Daniel Gröber - Alejandro Serrano -Maintainer: Kazu Yamamoto -License: BSD3 -License-File: LICENSE -Homepage: http://www.mew.org/~kazu/proj/ghc-mod/ -Synopsis: Happy Haskell Programming -Description: The ghc-mod command is a backend command to enrich - Haskell programming on editors including - Emacs, Vim, and Sublime. - The ghc-mod command is based on ghc-mod library - which is a wrapper of GHC API. - This package includes the ghc-mod command, - the ghc-mod library, and Emacs front-end - (for historical reasons). - For more information, please see its home page. - -Category: Development -Cabal-Version: >= 1.10 -Build-Type: Simple -Data-Dir: elisp -Data-Files: Makefile ghc.el ghc-func.el ghc-doc.el ghc-comp.el - ghc-check.el ghc-process.el ghc-command.el ghc-info.el - ghc-ins-mod.el ghc-indent.el ghc-pkg.el -Extra-Source-Files: ChangeLog - test/data/*.cabal - test/data/*.hs - test/data/cabal.sandbox.config.in - test/data/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/Cabal-1.18.1.3-2b161c6bf77657aa17e1681d83cb051b.conf - test/data/broken-cabal/*.cabal - test/data/broken-sandbox/*.cabal - test/data/broken-sandbox/cabal.sandbox.config - test/data/check-test-subdir/*.cabal - test/data/check-test-subdir/src/Check/Test/*.hs - test/data/check-test-subdir/test/*.hs - test/data/check-test-subdir/test/Bar/*.hs - test/data/check-packageid/cabal.sandbox.config.in - test/data/check-packageid/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf - test/data/duplicate-pkgver/cabal.sandbox.config.in - test/data/duplicate-pkgver/duplicate-pkgver.cabal - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-1.0-7c59d13f32294d1ef6dc6233c24df961.conf - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-14e543bdae2da4d2aeff5386892c9112.conf - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf - test/data/ghc-mod-check/*.cabal - test/data/ghc-mod-check/*.hs - test/data/ghc-mod-check/Data/*.hs - test/data/subdir1/subdir2/dummy - test/data/.cabal-sandbox/packages/00-index.tar - -Library - Default-Language: Haskell2010 - GHC-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - Exposed-Modules: Language.Haskell.GhcMod - Language.Haskell.GhcMod.Internal - Other-Modules: Language.Haskell.GhcMod.Boot - Language.Haskell.GhcMod.Browse - Language.Haskell.GhcMod.Cabal16 - Language.Haskell.GhcMod.Cabal18 - Language.Haskell.GhcMod.CabalApi - Language.Haskell.GhcMod.CabalConfig - Language.Haskell.GhcMod.CaseSplit - Language.Haskell.GhcMod.Check - Language.Haskell.GhcMod.Convert - Language.Haskell.GhcMod.Cradle - Language.Haskell.GhcMod.Debug - Language.Haskell.GhcMod.Doc - Language.Haskell.GhcMod.DynFlags - Language.Haskell.GhcMod.FillSig - Language.Haskell.GhcMod.Find - Language.Haskell.GhcMod.Flag - Language.Haskell.GhcMod.GHCApi - Language.Haskell.GhcMod.GHCChoice - Language.Haskell.GhcMod.Gap - Language.Haskell.GhcMod.GhcPkg - Language.Haskell.GhcMod.Info - Language.Haskell.GhcMod.Lang - Language.Haskell.GhcMod.Lint - Language.Haskell.GhcMod.List - Language.Haskell.GhcMod.Logger - Language.Haskell.GhcMod.Monad - Language.Haskell.GhcMod.PkgDoc - Language.Haskell.GhcMod.Read - Language.Haskell.GhcMod.SrcUtils - Language.Haskell.GhcMod.Target - Language.Haskell.GhcMod.Types - Language.Haskell.GhcMod.Utils - Build-Depends: base >= 4.0 && < 5 - , containers - , deepseq - , directory - , filepath - , ghc - , ghc-paths - , ghc-syb-utils - , hlint >= 1.8.61 - , io-choice - , monad-journal >= 0.2.2.0 - , old-time - , process - , syb - , time - , transformers - , transformers-base - , mtl >= 2.0 - , monad-control - , split - , haskell-src-exts - , text - , djinn-ghc >= 0.0.2.2 - if impl(ghc >= 7.8) - Build-Depends: Cabal >= 1.18 - else - Build-Depends: convertible - , Cabal >= 1.10 && < 1.17 - -Executable ghc-mod - Default-Language: Haskell2010 - Main-Is: GHCMod.hs - Other-Modules: Paths_ghc_mod - GHC-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src - Build-Depends: base >= 4.0 && < 5 - , directory - , filepath - , mtl >= 2.0 - , ghc - , ghc-mod - -Executable ghc-modi - Default-Language: Haskell2010 - Main-Is: GHCModi.hs - Other-Modules: Paths_ghc_mod - Utils - GHC-Options: -Wall -threaded - Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src - Build-Depends: base >= 4.0 && < 5 - , containers - , directory - , filepath - , split - , ghc - , ghc-mod - -Test-Suite doctest - Type: exitcode-stdio-1.0 - Default-Language: Haskell2010 - HS-Source-Dirs: test - Ghc-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - Main-Is: doctests.hs - Build-Depends: base - , doctest >= 0.9.3 - -Test-Suite spec - Default-Language: Haskell2010 - Default-Extensions: ConstraintKinds, FlexibleContexts - Main-Is: Main.hs - Hs-Source-Dirs: test, . - Ghc-Options: -Wall - Type: exitcode-stdio-1.0 - Other-Modules: Dir - Spec - BrowseSpec - CabalApiSpec - CheckSpec - FlagSpec - InfoSpec - LangSpec - LintSpec - ListSpec - MonadSpec - GhcPkgSpec - TestUtils - Build-Depends: base >= 4.0 && < 5 - , containers - , deepseq - , directory - , filepath - , ghc - , ghc-paths - , ghc-syb-utils - , hlint >= 1.7.1 - , io-choice - , monad-journal >= 0.2.2.0 - , old-time - , process - , syb - , time - , transformers - , transformers-base - , mtl >= 2.0 - , monad-control - , hspec >= 1.8.2 - , split - , haskell-src-exts - , text - , djinn-ghc >= 0.0.2.2 - if impl(ghc >= 7.8) - Build-Depends: Cabal >= 1.18 - else - Build-Depends: convertible - , Cabal >= 1.10 && < 1.17 - if impl(ghc < 7.6) - Build-Depends: executable-path - CPP-Options: -DSPEC=1 - -Source-Repository head - Type: git - Location: git://github.com/kazu-yamamoto/ghc-mod.git diff --git a/hackage-metadata/ghc-mod-5.0.1.1.cabal b/hackage-metadata/ghc-mod-5.0.1.1.cabal deleted file mode 100644 index 70b374e..0000000 --- a/hackage-metadata/ghc-mod-5.0.1.1.cabal +++ /dev/null @@ -1,219 +0,0 @@ -Name: ghc-mod -Version: 5.0.1.1 -Author: Kazu Yamamoto - Daniel Gröber - Alejandro Serrano -Maintainer: Kazu Yamamoto -License: BSD3 -License-File: LICENSE -Homepage: http://www.mew.org/~kazu/proj/ghc-mod/ -Synopsis: Happy Haskell Programming -Description: The ghc-mod command is a backend command to enrich - Haskell programming on editors including - Emacs, Vim, and Sublime. - The ghc-mod command is based on ghc-mod library - which is a wrapper of GHC API. - This package includes the ghc-mod command, - the ghc-mod library, and Emacs front-end - (for historical reasons). - For more information, please see its home page. - -Category: Development -Cabal-Version: >= 1.10 -Build-Type: Simple -Data-Dir: elisp -Data-Files: Makefile ghc.el ghc-func.el ghc-doc.el ghc-comp.el - ghc-check.el ghc-process.el ghc-command.el ghc-info.el - ghc-ins-mod.el ghc-indent.el ghc-pkg.el ghc-rewrite.el -Extra-Source-Files: ChangeLog - test/data/*.cabal - test/data/*.hs - test/data/cabal.sandbox.config.in - test/data/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/Cabal-1.18.1.3-2b161c6bf77657aa17e1681d83cb051b.conf - test/data/broken-cabal/*.cabal - test/data/broken-cabal/cabal.sandbox.config.in - test/data/broken-sandbox/*.cabal - test/data/broken-sandbox/cabal.sandbox.config - test/data/check-test-subdir/*.cabal - test/data/check-test-subdir/src/Check/Test/*.hs - test/data/check-test-subdir/test/*.hs - test/data/check-test-subdir/test/Bar/*.hs - test/data/check-packageid/cabal.sandbox.config.in - test/data/check-packageid/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf - test/data/duplicate-pkgver/cabal.sandbox.config.in - test/data/duplicate-pkgver/duplicate-pkgver.cabal - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-1.0-7c59d13f32294d1ef6dc6233c24df961.conf - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-14e543bdae2da4d2aeff5386892c9112.conf - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf - test/data/ghc-mod-check/*.cabal - test/data/ghc-mod-check/*.hs - test/data/ghc-mod-check/Data/*.hs - test/data/subdir1/subdir2/dummy - test/data/.cabal-sandbox/packages/00-index.tar - -Library - Default-Language: Haskell2010 - GHC-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - Exposed-Modules: Language.Haskell.GhcMod - Language.Haskell.GhcMod.Internal - Other-Modules: Language.Haskell.GhcMod.Boot - Language.Haskell.GhcMod.Browse - Language.Haskell.GhcMod.Cabal16 - Language.Haskell.GhcMod.Cabal18 - Language.Haskell.GhcMod.CabalApi - Language.Haskell.GhcMod.CabalConfig - Language.Haskell.GhcMod.CaseSplit - Language.Haskell.GhcMod.Check - Language.Haskell.GhcMod.Convert - Language.Haskell.GhcMod.Cradle - Language.Haskell.GhcMod.Debug - Language.Haskell.GhcMod.Doc - Language.Haskell.GhcMod.DynFlags - Language.Haskell.GhcMod.FillSig - Language.Haskell.GhcMod.Find - Language.Haskell.GhcMod.Flag - Language.Haskell.GhcMod.GHCApi - Language.Haskell.GhcMod.GHCChoice - Language.Haskell.GhcMod.Gap - Language.Haskell.GhcMod.GhcPkg - Language.Haskell.GhcMod.Info - Language.Haskell.GhcMod.Lang - Language.Haskell.GhcMod.Lint - Language.Haskell.GhcMod.List - Language.Haskell.GhcMod.Logger - Language.Haskell.GhcMod.Monad - Language.Haskell.GhcMod.PkgDoc - Language.Haskell.GhcMod.Read - Language.Haskell.GhcMod.SrcUtils - Language.Haskell.GhcMod.Target - Language.Haskell.GhcMod.Types - Language.Haskell.GhcMod.Utils - Build-Depends: base >= 4.0 && < 5 - , containers - , deepseq - , directory - , filepath - , ghc - , ghc-paths - , ghc-syb-utils - , hlint >= 1.8.61 - , io-choice - , monad-journal >= 0.2.2.0 - , old-time - , process - , syb - , time - , transformers - , transformers-base - , mtl >= 2.0 - , monad-control - , split - , haskell-src-exts - , text - , djinn-ghc >= 0.0.2.2 - if impl(ghc >= 7.8) - Build-Depends: Cabal >= 1.18 - else - Build-Depends: convertible - , Cabal >= 1.10 && < 1.17 - if impl(ghc <= 7.4.2) - -- Only used to constrain random to a version that still works with GHC 7.4 - Build-Depends: random <= 1.0.1.1 - -Executable ghc-mod - Default-Language: Haskell2010 - Main-Is: GHCMod.hs - Other-Modules: Paths_ghc_mod - GHC-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src - Build-Depends: base >= 4.0 && < 5 - , directory - , filepath - , mtl >= 2.0 - , ghc - , ghc-mod - -Executable ghc-modi - Default-Language: Haskell2010 - Main-Is: GHCModi.hs - Other-Modules: Paths_ghc_mod - Utils - GHC-Options: -Wall -threaded - Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src - Build-Depends: base >= 4.0 && < 5 - , containers - , directory - , filepath - , split - , ghc - , ghc-mod - -Test-Suite doctest - Type: exitcode-stdio-1.0 - Default-Language: Haskell2010 - HS-Source-Dirs: test - Ghc-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - Main-Is: doctests.hs - Build-Depends: base - , doctest >= 0.9.3 - -Test-Suite spec - Default-Language: Haskell2010 - Default-Extensions: ConstraintKinds, FlexibleContexts - Main-Is: Main.hs - Hs-Source-Dirs: test, . - Ghc-Options: -Wall - Type: exitcode-stdio-1.0 - Other-Modules: Dir - Spec - BrowseSpec - CabalApiSpec - CheckSpec - FlagSpec - InfoSpec - LangSpec - LintSpec - ListSpec - MonadSpec - GhcPkgSpec - TestUtils - Build-Depends: base >= 4.0 && < 5 - , containers - , deepseq - , directory - , filepath - , ghc - , ghc-paths - , ghc-syb-utils - , hlint >= 1.7.1 - , io-choice - , monad-journal >= 0.2.2.0 - , old-time - , process - , syb - , time - , transformers - , transformers-base - , mtl >= 2.0 - , monad-control - , hspec >= 1.8.2 - , split - , haskell-src-exts - , text - , djinn-ghc >= 0.0.2.2 - if impl(ghc >= 7.8) - Build-Depends: Cabal >= 1.18 - else - Build-Depends: convertible - , Cabal >= 1.10 && < 1.17 - if impl(ghc < 7.6) - Build-Depends: executable-path - CPP-Options: -DSPEC=1 - -Source-Repository head - Type: git - Location: git://github.com/kazu-yamamoto/ghc-mod.git diff --git a/hackage-metadata/ghc-mod-5.0.1.2.cabal b/hackage-metadata/ghc-mod-5.0.1.2.cabal deleted file mode 100644 index 31ac7b2..0000000 --- a/hackage-metadata/ghc-mod-5.0.1.2.cabal +++ /dev/null @@ -1,219 +0,0 @@ -Name: ghc-mod -Version: 5.0.1.2 -Author: Kazu Yamamoto - Daniel Gröber - Alejandro Serrano -Maintainer: Kazu Yamamoto -License: BSD3 -License-File: LICENSE -Homepage: http://www.mew.org/~kazu/proj/ghc-mod/ -Synopsis: Happy Haskell Programming -Description: The ghc-mod command is a backend command to enrich - Haskell programming on editors including - Emacs, Vim, and Sublime. - The ghc-mod command is based on ghc-mod library - which is a wrapper of GHC API. - This package includes the ghc-mod command, - the ghc-mod library, and Emacs front-end - (for historical reasons). - For more information, please see its home page. - -Category: Development -Cabal-Version: >= 1.10 -Build-Type: Simple -Data-Dir: elisp -Data-Files: Makefile ghc.el ghc-func.el ghc-doc.el ghc-comp.el - ghc-check.el ghc-process.el ghc-command.el ghc-info.el - ghc-ins-mod.el ghc-indent.el ghc-pkg.el ghc-rewrite.el -Extra-Source-Files: ChangeLog - test/data/*.cabal - test/data/*.hs - test/data/cabal.sandbox.config.in - test/data/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/Cabal-1.18.1.3-2b161c6bf77657aa17e1681d83cb051b.conf - test/data/broken-cabal/*.cabal - test/data/broken-cabal/cabal.sandbox.config.in - test/data/broken-sandbox/*.cabal - test/data/broken-sandbox/cabal.sandbox.config - test/data/check-test-subdir/*.cabal - test/data/check-test-subdir/src/Check/Test/*.hs - test/data/check-test-subdir/test/*.hs - test/data/check-test-subdir/test/Bar/*.hs - test/data/check-packageid/cabal.sandbox.config.in - test/data/check-packageid/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf - test/data/duplicate-pkgver/cabal.sandbox.config.in - test/data/duplicate-pkgver/duplicate-pkgver.cabal - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-1.0-7c59d13f32294d1ef6dc6233c24df961.conf - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-14e543bdae2da4d2aeff5386892c9112.conf - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf - test/data/ghc-mod-check/*.cabal - test/data/ghc-mod-check/*.hs - test/data/ghc-mod-check/Data/*.hs - test/data/subdir1/subdir2/dummy - test/data/.cabal-sandbox/packages/00-index.tar - -Library - Default-Language: Haskell2010 - GHC-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - Exposed-Modules: Language.Haskell.GhcMod - Language.Haskell.GhcMod.Internal - Other-Modules: Language.Haskell.GhcMod.Boot - Language.Haskell.GhcMod.Browse - Language.Haskell.GhcMod.Cabal16 - Language.Haskell.GhcMod.Cabal18 - Language.Haskell.GhcMod.CabalApi - Language.Haskell.GhcMod.CabalConfig - Language.Haskell.GhcMod.CaseSplit - Language.Haskell.GhcMod.Check - Language.Haskell.GhcMod.Convert - Language.Haskell.GhcMod.Cradle - Language.Haskell.GhcMod.Debug - Language.Haskell.GhcMod.Doc - Language.Haskell.GhcMod.DynFlags - Language.Haskell.GhcMod.FillSig - Language.Haskell.GhcMod.Find - Language.Haskell.GhcMod.Flag - Language.Haskell.GhcMod.GHCApi - Language.Haskell.GhcMod.GHCChoice - Language.Haskell.GhcMod.Gap - Language.Haskell.GhcMod.GhcPkg - Language.Haskell.GhcMod.Info - Language.Haskell.GhcMod.Lang - Language.Haskell.GhcMod.Lint - Language.Haskell.GhcMod.List - Language.Haskell.GhcMod.Logger - Language.Haskell.GhcMod.Monad - Language.Haskell.GhcMod.PkgDoc - Language.Haskell.GhcMod.Read - Language.Haskell.GhcMod.SrcUtils - Language.Haskell.GhcMod.Target - Language.Haskell.GhcMod.Types - Language.Haskell.GhcMod.Utils - Build-Depends: base >= 4.0 && < 5 - , containers - , deepseq - , directory - , filepath - , ghc - , ghc-paths - , ghc-syb-utils - , hlint >= 1.8.61 - , io-choice - , monad-journal >= 0.2.2.0 - , old-time - , process - , syb - , time - , transformers - , transformers-base - , mtl >= 2.0 - , monad-control - , split - , haskell-src-exts - , text - , djinn-ghc >= 0.0.2.2 - if impl(ghc >= 7.8) - Build-Depends: Cabal >= 1.18 - else - Build-Depends: convertible - , Cabal >= 1.10 && < 1.17 - if impl(ghc <= 7.4.2) - -- Only used to constrain random to a version that still works with GHC 7.4 - Build-Depends: random <= 1.0.1.1 - -Executable ghc-mod - Default-Language: Haskell2010 - Main-Is: GHCMod.hs - Other-Modules: Paths_ghc_mod - GHC-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src - Build-Depends: base >= 4.0 && < 5 - , directory - , filepath - , mtl >= 2.0 - , ghc - , ghc-mod - -Executable ghc-modi - Default-Language: Haskell2010 - Main-Is: GHCModi.hs - Other-Modules: Paths_ghc_mod - Utils - GHC-Options: -Wall -threaded - Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src - Build-Depends: base >= 4.0 && < 5 - , containers - , directory - , filepath - , split - , ghc - , ghc-mod - -Test-Suite doctest - Type: exitcode-stdio-1.0 - Default-Language: Haskell2010 - HS-Source-Dirs: test - Ghc-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - Main-Is: doctests.hs - Build-Depends: base - , doctest >= 0.9.3 - -Test-Suite spec - Default-Language: Haskell2010 - Default-Extensions: ConstraintKinds, FlexibleContexts - Main-Is: Main.hs - Hs-Source-Dirs: test, . - Ghc-Options: -Wall - Type: exitcode-stdio-1.0 - Other-Modules: Dir - Spec - BrowseSpec - CabalApiSpec - CheckSpec - FlagSpec - InfoSpec - LangSpec - LintSpec - ListSpec - MonadSpec - GhcPkgSpec - TestUtils - Build-Depends: base >= 4.0 && < 5 - , containers - , deepseq - , directory - , filepath - , ghc - , ghc-paths - , ghc-syb-utils - , hlint >= 1.7.1 - , io-choice - , monad-journal >= 0.2.2.0 - , old-time - , process - , syb - , time - , transformers - , transformers-base - , mtl >= 2.0 - , monad-control - , hspec >= 1.8.2 - , split - , haskell-src-exts - , text - , djinn-ghc >= 0.0.2.2 - if impl(ghc >= 7.8) - Build-Depends: Cabal >= 1.18 - else - Build-Depends: convertible - , Cabal >= 1.10 && < 1.17 - if impl(ghc < 7.6) - Build-Depends: executable-path - CPP-Options: -DSPEC=1 - -Source-Repository head - Type: git - Location: git://github.com/kazu-yamamoto/ghc-mod.git diff --git a/hackage-metadata/ghc-mod-5.0.1.cabal b/hackage-metadata/ghc-mod-5.0.1.cabal deleted file mode 100644 index 09ac837..0000000 --- a/hackage-metadata/ghc-mod-5.0.1.cabal +++ /dev/null @@ -1,215 +0,0 @@ -Name: ghc-mod -Version: 5.0.1 -Author: Kazu Yamamoto - Daniel Gröber - Alejandro Serrano -Maintainer: Kazu Yamamoto -License: BSD3 -License-File: LICENSE -Homepage: http://www.mew.org/~kazu/proj/ghc-mod/ -Synopsis: Happy Haskell Programming -Description: The ghc-mod command is a backend command to enrich - Haskell programming on editors including - Emacs, Vim, and Sublime. - The ghc-mod command is based on ghc-mod library - which is a wrapper of GHC API. - This package includes the ghc-mod command, - the ghc-mod library, and Emacs front-end - (for historical reasons). - For more information, please see its home page. - -Category: Development -Cabal-Version: >= 1.10 -Build-Type: Simple -Data-Dir: elisp -Data-Files: Makefile ghc.el ghc-func.el ghc-doc.el ghc-comp.el - ghc-check.el ghc-process.el ghc-command.el ghc-info.el - ghc-ins-mod.el ghc-indent.el ghc-pkg.el ghc-rewrite.el -Extra-Source-Files: ChangeLog - test/data/*.cabal - test/data/*.hs - test/data/cabal.sandbox.config.in - test/data/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/Cabal-1.18.1.3-2b161c6bf77657aa17e1681d83cb051b.conf - test/data/broken-cabal/*.cabal - test/data/broken-sandbox/*.cabal - test/data/broken-sandbox/cabal.sandbox.config - test/data/check-test-subdir/*.cabal - test/data/check-test-subdir/src/Check/Test/*.hs - test/data/check-test-subdir/test/*.hs - test/data/check-test-subdir/test/Bar/*.hs - test/data/check-packageid/cabal.sandbox.config.in - test/data/check-packageid/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf - test/data/duplicate-pkgver/cabal.sandbox.config.in - test/data/duplicate-pkgver/duplicate-pkgver.cabal - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-1.0-7c59d13f32294d1ef6dc6233c24df961.conf - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-14e543bdae2da4d2aeff5386892c9112.conf - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf - test/data/ghc-mod-check/*.cabal - test/data/ghc-mod-check/*.hs - test/data/ghc-mod-check/Data/*.hs - test/data/subdir1/subdir2/dummy - test/data/.cabal-sandbox/packages/00-index.tar - -Library - Default-Language: Haskell2010 - GHC-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - Exposed-Modules: Language.Haskell.GhcMod - Language.Haskell.GhcMod.Internal - Other-Modules: Language.Haskell.GhcMod.Boot - Language.Haskell.GhcMod.Browse - Language.Haskell.GhcMod.Cabal16 - Language.Haskell.GhcMod.Cabal18 - Language.Haskell.GhcMod.CabalApi - Language.Haskell.GhcMod.CabalConfig - Language.Haskell.GhcMod.CaseSplit - Language.Haskell.GhcMod.Check - Language.Haskell.GhcMod.Convert - Language.Haskell.GhcMod.Cradle - Language.Haskell.GhcMod.Debug - Language.Haskell.GhcMod.Doc - Language.Haskell.GhcMod.DynFlags - Language.Haskell.GhcMod.FillSig - Language.Haskell.GhcMod.Find - Language.Haskell.GhcMod.Flag - Language.Haskell.GhcMod.GHCApi - Language.Haskell.GhcMod.GHCChoice - Language.Haskell.GhcMod.Gap - Language.Haskell.GhcMod.GhcPkg - Language.Haskell.GhcMod.Info - Language.Haskell.GhcMod.Lang - Language.Haskell.GhcMod.Lint - Language.Haskell.GhcMod.List - Language.Haskell.GhcMod.Logger - Language.Haskell.GhcMod.Monad - Language.Haskell.GhcMod.PkgDoc - Language.Haskell.GhcMod.Read - Language.Haskell.GhcMod.SrcUtils - Language.Haskell.GhcMod.Target - Language.Haskell.GhcMod.Types - Language.Haskell.GhcMod.Utils - Build-Depends: base >= 4.0 && < 5 - , containers - , deepseq - , directory - , filepath - , ghc - , ghc-paths - , ghc-syb-utils - , hlint >= 1.8.61 - , io-choice - , monad-journal >= 0.2.2.0 - , old-time - , process - , syb - , time - , transformers - , transformers-base - , mtl >= 2.0 - , monad-control - , split - , haskell-src-exts - , text - , djinn-ghc >= 0.0.2.2 - if impl(ghc >= 7.8) - Build-Depends: Cabal >= 1.18 - else - Build-Depends: convertible - , Cabal >= 1.10 && < 1.17 - -Executable ghc-mod - Default-Language: Haskell2010 - Main-Is: GHCMod.hs - Other-Modules: Paths_ghc_mod - GHC-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src - Build-Depends: base >= 4.0 && < 5 - , directory - , filepath - , mtl >= 2.0 - , ghc - , ghc-mod - -Executable ghc-modi - Default-Language: Haskell2010 - Main-Is: GHCModi.hs - Other-Modules: Paths_ghc_mod - Utils - GHC-Options: -Wall -threaded - Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src - Build-Depends: base >= 4.0 && < 5 - , containers - , directory - , filepath - , split - , ghc - , ghc-mod - -Test-Suite doctest - Type: exitcode-stdio-1.0 - Default-Language: Haskell2010 - HS-Source-Dirs: test - Ghc-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - Main-Is: doctests.hs - Build-Depends: base - , doctest >= 0.9.3 - -Test-Suite spec - Default-Language: Haskell2010 - Default-Extensions: ConstraintKinds, FlexibleContexts - Main-Is: Main.hs - Hs-Source-Dirs: test, . - Ghc-Options: -Wall - Type: exitcode-stdio-1.0 - Other-Modules: Dir - Spec - BrowseSpec - CabalApiSpec - CheckSpec - FlagSpec - InfoSpec - LangSpec - LintSpec - ListSpec - MonadSpec - GhcPkgSpec - TestUtils - Build-Depends: base >= 4.0 && < 5 - , containers - , deepseq - , directory - , filepath - , ghc - , ghc-paths - , ghc-syb-utils - , hlint >= 1.7.1 - , io-choice - , monad-journal >= 0.2.2.0 - , old-time - , process - , syb - , time - , transformers - , transformers-base - , mtl >= 2.0 - , monad-control - , hspec >= 1.8.2 - , split - , haskell-src-exts - , text - , djinn-ghc >= 0.0.2.2 - if impl(ghc >= 7.8) - Build-Depends: Cabal >= 1.18 - else - Build-Depends: convertible - , Cabal >= 1.10 && < 1.17 - if impl(ghc < 7.6) - Build-Depends: executable-path - CPP-Options: -DSPEC=1 - -Source-Repository head - Type: git - Location: git://github.com/kazu-yamamoto/ghc-mod.git diff --git a/hackage-metadata/ghc-mod-5.1.0.0.cabal b/hackage-metadata/ghc-mod-5.1.0.0.cabal deleted file mode 100644 index f4c6901..0000000 --- a/hackage-metadata/ghc-mod-5.1.0.0.cabal +++ /dev/null @@ -1,225 +0,0 @@ -Name: ghc-mod -Version: 5.1.0.0 -Author: Kazu Yamamoto - Daniel Gröber - Alejandro Serrano -Maintainer: Kazu Yamamoto -License: BSD3 -License-File: LICENSE -Homepage: http://www.mew.org/~kazu/proj/ghc-mod/ -Synopsis: Happy Haskell Programming -Description: The ghc-mod command is a backend command to enrich - Haskell programming on editors including - Emacs, Vim, and Sublime. - The ghc-mod command is based on ghc-mod library - which is a wrapper of GHC API. - This package includes the ghc-mod command, - the ghc-mod library, and Emacs front-end - (for historical reasons). - For more information, please see its home page. - -Category: Development -Cabal-Version: >= 1.10 -Build-Type: Simple -Data-Dir: elisp -Data-Files: Makefile ghc.el ghc-func.el ghc-doc.el ghc-comp.el - ghc-check.el ghc-process.el ghc-command.el ghc-info.el - ghc-ins-mod.el ghc-indent.el ghc-pkg.el ghc-rewrite.el -Extra-Source-Files: ChangeLog - test/data/*.cabal - test/data/*.hs - test/data/cabal.sandbox.config.in - test/data/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/Cabal-1.18.1.3-2b161c6bf77657aa17e1681d83cb051b.conf - test/data/broken-cabal/*.cabal - test/data/broken-cabal/cabal.sandbox.config.in - test/data/broken-sandbox/*.cabal - test/data/broken-sandbox/cabal.sandbox.config - test/data/cabal-flags/*.cabal - test/data/check-test-subdir/*.cabal - test/data/check-test-subdir/src/Check/Test/*.hs - test/data/check-test-subdir/test/*.hs - test/data/check-test-subdir/test/Bar/*.hs - test/data/check-packageid/cabal.sandbox.config.in - test/data/check-packageid/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf - test/data/duplicate-pkgver/cabal.sandbox.config.in - test/data/duplicate-pkgver/duplicate-pkgver.cabal - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-1.0-7c59d13f32294d1ef6dc6233c24df961.conf - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-14e543bdae2da4d2aeff5386892c9112.conf - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf - test/data/pattern-synonyms/*.cabal - test/data/pattern-synonyms/*.hs - test/data/ghc-mod-check/*.cabal - test/data/ghc-mod-check/*.hs - test/data/ghc-mod-check/Data/*.hs - test/data/subdir1/subdir2/dummy - test/data/.cabal-sandbox/packages/00-index.tar - -Library - Default-Language: Haskell2010 - GHC-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - Exposed-Modules: Language.Haskell.GhcMod - Language.Haskell.GhcMod.Internal - Other-Modules: Language.Haskell.GhcMod.Boot - Language.Haskell.GhcMod.Browse - Language.Haskell.GhcMod.Cabal16 - Language.Haskell.GhcMod.Cabal18 - Language.Haskell.GhcMod.Cabal21 - Language.Haskell.GhcMod.CabalApi - Language.Haskell.GhcMod.CabalConfig - Language.Haskell.GhcMod.CaseSplit - Language.Haskell.GhcMod.Check - Language.Haskell.GhcMod.Convert - Language.Haskell.GhcMod.Cradle - Language.Haskell.GhcMod.Debug - Language.Haskell.GhcMod.Doc - Language.Haskell.GhcMod.DynFlags - Language.Haskell.GhcMod.Error - Language.Haskell.GhcMod.FillSig - Language.Haskell.GhcMod.Find - Language.Haskell.GhcMod.Flag - Language.Haskell.GhcMod.GHCApi - Language.Haskell.GhcMod.GHCChoice - Language.Haskell.GhcMod.Gap - Language.Haskell.GhcMod.GhcPkg - Language.Haskell.GhcMod.Info - Language.Haskell.GhcMod.Lang - Language.Haskell.GhcMod.Lint - Language.Haskell.GhcMod.Logger - Language.Haskell.GhcMod.Monad - Language.Haskell.GhcMod.Modules - Language.Haskell.GhcMod.PkgDoc - Language.Haskell.GhcMod.Read - Language.Haskell.GhcMod.SrcUtils - Language.Haskell.GhcMod.Target - Language.Haskell.GhcMod.Types - Language.Haskell.GhcMod.Utils - Build-Depends: base >= 4.0 && < 5 - , containers - , deepseq - , directory - , filepath - , ghc - , ghc-paths - , ghc-syb-utils - , hlint >= 1.8.61 - , io-choice - , monad-journal >= 0.2.2.0 && < 0.2.3.2 - , old-time - , process - , syb - , time - , transformers - , transformers-base - , mtl >= 2.0 - , monad-control - , split - , haskell-src-exts - , text - , djinn-ghc >= 0.0.2.2 - if impl(ghc >= 7.8) - Build-Depends: Cabal >= 1.18 - else - Build-Depends: convertible - , Cabal >= 1.10 && < 1.17 - if impl(ghc <= 7.4.2) - -- Only used to constrain random to a version that still works with GHC 7.4 - Build-Depends: random <= 1.0.1.1 - -Executable ghc-mod - Default-Language: Haskell2010 - Main-Is: GHCMod.hs - Other-Modules: Paths_ghc_mod - GHC-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src - Build-Depends: base >= 4.0 && < 5 - , directory - , filepath - , mtl >= 2.0 - , ghc - , ghc-mod - -Executable ghc-modi - Default-Language: Haskell2010 - Main-Is: GHCModi.hs - Other-Modules: Paths_ghc_mod - Utils - GHC-Options: -Wall -threaded - Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src - Build-Depends: base >= 4.0 && < 5 - , async - , containers - , directory - , filepath - , split - , ghc - , ghc-mod - -Test-Suite doctest - Type: exitcode-stdio-1.0 - Default-Language: Haskell2010 - HS-Source-Dirs: test - Ghc-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - Main-Is: doctests.hs - Build-Depends: base - , doctest >= 0.9.3 - -Test-Suite spec - Default-Language: Haskell2010 - Default-Extensions: ConstraintKinds, FlexibleContexts - Main-Is: Main.hs - Hs-Source-Dirs: test, . - Ghc-Options: -Wall - Type: exitcode-stdio-1.0 - Other-Modules: Dir - Spec - BrowseSpec - CabalApiSpec - CheckSpec - FlagSpec - InfoSpec - LangSpec - LintSpec - ListSpec - MonadSpec - GhcPkgSpec - TestUtils - Build-Depends: base >= 4.0 && < 5 - , containers - , deepseq - , directory - , filepath - , ghc - , ghc-paths - , ghc-syb-utils - , hlint >= 1.7.1 - , io-choice - , monad-journal >= 0.2.2.0 && < 0.2.3.2 - , old-time - , process - , syb - , time - , transformers - , transformers-base - , mtl >= 2.0 - , monad-control - , hspec >= 1.8.2 - , split - , haskell-src-exts - , text - , djinn-ghc >= 0.0.2.2 - if impl(ghc >= 7.8) - Build-Depends: Cabal >= 1.18 - else - Build-Depends: convertible - , Cabal >= 1.10 && < 1.17 - if impl(ghc < 7.6) - Build-Depends: executable-path - CPP-Options: -DSPEC=1 - -Source-Repository head - Type: git - Location: git://github.com/kazu-yamamoto/ghc-mod.git diff --git a/hackage-metadata/ghc-mod-5.1.0.1.cabal b/hackage-metadata/ghc-mod-5.1.0.1.cabal deleted file mode 100644 index b394af7..0000000 --- a/hackage-metadata/ghc-mod-5.1.0.1.cabal +++ /dev/null @@ -1,225 +0,0 @@ -Name: ghc-mod -Version: 5.1.0.1 -Author: Kazu Yamamoto - Daniel Gröber - Alejandro Serrano -Maintainer: Kazu Yamamoto -License: BSD3 -License-File: LICENSE -Homepage: http://www.mew.org/~kazu/proj/ghc-mod/ -Synopsis: Happy Haskell Programming -Description: The ghc-mod command is a backend command to enrich - Haskell programming on editors including - Emacs, Vim, and Sublime. - The ghc-mod command is based on ghc-mod library - which is a wrapper of GHC API. - This package includes the ghc-mod command, - the ghc-mod library, and Emacs front-end - (for historical reasons). - For more information, please see its home page. - -Category: Development -Cabal-Version: >= 1.10 -Build-Type: Simple -Data-Dir: elisp -Data-Files: Makefile ghc.el ghc-func.el ghc-doc.el ghc-comp.el - ghc-check.el ghc-process.el ghc-command.el ghc-info.el - ghc-ins-mod.el ghc-indent.el ghc-pkg.el ghc-rewrite.el -Extra-Source-Files: ChangeLog - test/data/*.cabal - test/data/*.hs - test/data/cabal.sandbox.config.in - test/data/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/Cabal-1.18.1.3-2b161c6bf77657aa17e1681d83cb051b.conf - test/data/broken-cabal/*.cabal - test/data/broken-cabal/cabal.sandbox.config.in - test/data/broken-sandbox/*.cabal - test/data/broken-sandbox/cabal.sandbox.config - test/data/cabal-flags/*.cabal - test/data/check-test-subdir/*.cabal - test/data/check-test-subdir/src/Check/Test/*.hs - test/data/check-test-subdir/test/*.hs - test/data/check-test-subdir/test/Bar/*.hs - test/data/check-packageid/cabal.sandbox.config.in - test/data/check-packageid/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf - test/data/duplicate-pkgver/cabal.sandbox.config.in - test/data/duplicate-pkgver/duplicate-pkgver.cabal - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-1.0-7c59d13f32294d1ef6dc6233c24df961.conf - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-14e543bdae2da4d2aeff5386892c9112.conf - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf - test/data/pattern-synonyms/*.cabal - test/data/pattern-synonyms/*.hs - test/data/ghc-mod-check/*.cabal - test/data/ghc-mod-check/*.hs - test/data/ghc-mod-check/Data/*.hs - test/data/subdir1/subdir2/dummy - test/data/.cabal-sandbox/packages/00-index.tar - -Library - Default-Language: Haskell2010 - GHC-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - Exposed-Modules: Language.Haskell.GhcMod - Language.Haskell.GhcMod.Internal - Other-Modules: Language.Haskell.GhcMod.Boot - Language.Haskell.GhcMod.Browse - Language.Haskell.GhcMod.Cabal16 - Language.Haskell.GhcMod.Cabal18 - Language.Haskell.GhcMod.Cabal21 - Language.Haskell.GhcMod.CabalApi - Language.Haskell.GhcMod.CabalConfig - Language.Haskell.GhcMod.CaseSplit - Language.Haskell.GhcMod.Check - Language.Haskell.GhcMod.Convert - Language.Haskell.GhcMod.Cradle - Language.Haskell.GhcMod.Debug - Language.Haskell.GhcMod.Doc - Language.Haskell.GhcMod.DynFlags - Language.Haskell.GhcMod.Error - Language.Haskell.GhcMod.FillSig - Language.Haskell.GhcMod.Find - Language.Haskell.GhcMod.Flag - Language.Haskell.GhcMod.GHCApi - Language.Haskell.GhcMod.GHCChoice - Language.Haskell.GhcMod.Gap - Language.Haskell.GhcMod.GhcPkg - Language.Haskell.GhcMod.Info - Language.Haskell.GhcMod.Lang - Language.Haskell.GhcMod.Lint - Language.Haskell.GhcMod.Logger - Language.Haskell.GhcMod.Monad - Language.Haskell.GhcMod.Modules - Language.Haskell.GhcMod.PkgDoc - Language.Haskell.GhcMod.Read - Language.Haskell.GhcMod.SrcUtils - Language.Haskell.GhcMod.Target - Language.Haskell.GhcMod.Types - Language.Haskell.GhcMod.Utils - Build-Depends: base >= 4.0 && < 5 - , containers - , deepseq - , directory - , filepath - , ghc - , ghc-paths - , ghc-syb-utils - , hlint >= 1.8.61 - , io-choice - , monad-journal >= 0.4 - , old-time - , process - , syb - , time - , transformers - , transformers-base - , mtl >= 2.0 - , monad-control - , split - , haskell-src-exts - , text - , djinn-ghc >= 0.0.2.2 - if impl(ghc >= 7.8) - Build-Depends: Cabal >= 1.18 - else - Build-Depends: convertible - , Cabal >= 1.10 && < 1.17 - if impl(ghc <= 7.4.2) - -- Only used to constrain random to a version that still works with GHC 7.4 - Build-Depends: random <= 1.0.1.1 - -Executable ghc-mod - Default-Language: Haskell2010 - Main-Is: GHCMod.hs - Other-Modules: Paths_ghc_mod - GHC-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src - Build-Depends: base >= 4.0 && < 5 - , directory - , filepath - , mtl >= 2.0 - , ghc - , ghc-mod - -Executable ghc-modi - Default-Language: Haskell2010 - Main-Is: GHCModi.hs - Other-Modules: Paths_ghc_mod - Utils - GHC-Options: -Wall -threaded - Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src - Build-Depends: base >= 4.0 && < 5 - , async - , containers - , directory - , filepath - , split - , ghc - , ghc-mod - -Test-Suite doctest - Type: exitcode-stdio-1.0 - Default-Language: Haskell2010 - HS-Source-Dirs: test - Ghc-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - Main-Is: doctests.hs - Build-Depends: base - , doctest >= 0.9.3 - -Test-Suite spec - Default-Language: Haskell2010 - Default-Extensions: ConstraintKinds, FlexibleContexts - Main-Is: Main.hs - Hs-Source-Dirs: test, . - Ghc-Options: -Wall - Type: exitcode-stdio-1.0 - Other-Modules: Dir - Spec - BrowseSpec - CabalApiSpec - CheckSpec - FlagSpec - InfoSpec - LangSpec - LintSpec - ListSpec - MonadSpec - GhcPkgSpec - TestUtils - Build-Depends: base >= 4.0 && < 5 - , containers - , deepseq - , directory - , filepath - , ghc - , ghc-paths - , ghc-syb-utils - , hlint >= 1.7.1 - , io-choice - , monad-journal >= 0.4 - , old-time - , process - , syb - , time - , transformers - , transformers-base - , mtl >= 2.0 - , monad-control - , hspec >= 1.8.2 - , split - , haskell-src-exts - , text - , djinn-ghc >= 0.0.2.2 - if impl(ghc >= 7.8) - Build-Depends: Cabal >= 1.18 - else - Build-Depends: convertible - , Cabal >= 1.10 && < 1.17 - if impl(ghc < 7.6) - Build-Depends: executable-path - CPP-Options: -DSPEC=1 - -Source-Repository head - Type: git - Location: git://github.com/kazu-yamamoto/ghc-mod.git diff --git a/hackage-metadata/ghc-mod-5.1.0.2.cabal b/hackage-metadata/ghc-mod-5.1.0.2.cabal deleted file mode 100644 index 5abc49b..0000000 --- a/hackage-metadata/ghc-mod-5.1.0.2.cabal +++ /dev/null @@ -1,225 +0,0 @@ -Name: ghc-mod -Version: 5.1.0.2 -Author: Kazu Yamamoto - Daniel Gröber - Alejandro Serrano -Maintainer: Kazu Yamamoto -License: BSD3 -License-File: LICENSE -Homepage: http://www.mew.org/~kazu/proj/ghc-mod/ -Synopsis: Happy Haskell Programming -Description: The ghc-mod command is a backend command to enrich - Haskell programming on editors including - Emacs, Vim, and Sublime. - The ghc-mod command is based on ghc-mod library - which is a wrapper of GHC API. - This package includes the ghc-mod command, - the ghc-mod library, and Emacs front-end - (for historical reasons). - For more information, please see its home page. - -Category: Development -Cabal-Version: >= 1.10 -Build-Type: Simple -Data-Dir: elisp -Data-Files: Makefile ghc.el ghc-func.el ghc-doc.el ghc-comp.el - ghc-check.el ghc-process.el ghc-command.el ghc-info.el - ghc-ins-mod.el ghc-indent.el ghc-pkg.el ghc-rewrite.el -Extra-Source-Files: ChangeLog - test/data/*.cabal - test/data/*.hs - test/data/cabal.sandbox.config.in - test/data/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/Cabal-1.18.1.3-2b161c6bf77657aa17e1681d83cb051b.conf - test/data/broken-cabal/*.cabal - test/data/broken-cabal/cabal.sandbox.config.in - test/data/broken-sandbox/*.cabal - test/data/broken-sandbox/cabal.sandbox.config - test/data/cabal-flags/*.cabal - test/data/check-test-subdir/*.cabal - test/data/check-test-subdir/src/Check/Test/*.hs - test/data/check-test-subdir/test/*.hs - test/data/check-test-subdir/test/Bar/*.hs - test/data/check-packageid/cabal.sandbox.config.in - test/data/check-packageid/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf - test/data/duplicate-pkgver/cabal.sandbox.config.in - test/data/duplicate-pkgver/duplicate-pkgver.cabal - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-1.0-7c59d13f32294d1ef6dc6233c24df961.conf - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-14e543bdae2da4d2aeff5386892c9112.conf - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf - test/data/pattern-synonyms/*.cabal - test/data/pattern-synonyms/*.hs - test/data/ghc-mod-check/*.cabal - test/data/ghc-mod-check/*.hs - test/data/ghc-mod-check/Data/*.hs - test/data/subdir1/subdir2/dummy - test/data/.cabal-sandbox/packages/00-index.tar - -Library - Default-Language: Haskell2010 - GHC-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - Exposed-Modules: Language.Haskell.GhcMod - Language.Haskell.GhcMod.Internal - Other-Modules: Language.Haskell.GhcMod.Boot - Language.Haskell.GhcMod.Browse - Language.Haskell.GhcMod.Cabal16 - Language.Haskell.GhcMod.Cabal18 - Language.Haskell.GhcMod.Cabal21 - Language.Haskell.GhcMod.CabalApi - Language.Haskell.GhcMod.CabalConfig - Language.Haskell.GhcMod.CaseSplit - Language.Haskell.GhcMod.Check - Language.Haskell.GhcMod.Convert - Language.Haskell.GhcMod.Cradle - Language.Haskell.GhcMod.Debug - Language.Haskell.GhcMod.Doc - Language.Haskell.GhcMod.DynFlags - Language.Haskell.GhcMod.Error - Language.Haskell.GhcMod.FillSig - Language.Haskell.GhcMod.Find - Language.Haskell.GhcMod.Flag - Language.Haskell.GhcMod.GHCApi - Language.Haskell.GhcMod.GHCChoice - Language.Haskell.GhcMod.Gap - Language.Haskell.GhcMod.GhcPkg - Language.Haskell.GhcMod.Info - Language.Haskell.GhcMod.Lang - Language.Haskell.GhcMod.Lint - Language.Haskell.GhcMod.Logger - Language.Haskell.GhcMod.Monad - Language.Haskell.GhcMod.Modules - Language.Haskell.GhcMod.PkgDoc - Language.Haskell.GhcMod.Read - Language.Haskell.GhcMod.SrcUtils - Language.Haskell.GhcMod.Target - Language.Haskell.GhcMod.Types - Language.Haskell.GhcMod.Utils - Build-Depends: base >= 4.0 && < 5 - , containers - , deepseq - , directory - , filepath - , ghc - , ghc-paths - , ghc-syb-utils - , hlint >= 1.8.61 - , io-choice - , monad-journal >= 0.4 - , old-time - , process - , syb - , time - , transformers - , transformers-base - , mtl >= 2.0 - , monad-control - , split - , haskell-src-exts - , text - , djinn-ghc >= 0.0.2.2 - if impl(ghc >= 7.8) - Build-Depends: Cabal >= 1.18 - else - Build-Depends: convertible - , Cabal >= 1.10 && < 1.17 - if impl(ghc <= 7.4.2) - -- Only used to constrain random to a version that still works with GHC 7.4 - Build-Depends: random <= 1.0.1.1 - -Executable ghc-mod - Default-Language: Haskell2010 - Main-Is: GHCMod.hs - Other-Modules: Paths_ghc_mod - GHC-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src - Build-Depends: base >= 4.0 && < 5 - , directory - , filepath - , mtl >= 2.0 - , ghc - , ghc-mod - -Executable ghc-modi - Default-Language: Haskell2010 - Main-Is: GHCModi.hs - Other-Modules: Paths_ghc_mod - Utils - GHC-Options: -Wall -threaded - Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src - Build-Depends: base >= 4.0 && < 5 - , async - , containers - , directory - , filepath - , split - , ghc - , ghc-mod - -Test-Suite doctest - Type: exitcode-stdio-1.0 - Default-Language: Haskell2010 - HS-Source-Dirs: test - Ghc-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - Main-Is: doctests.hs - Build-Depends: base - , doctest >= 0.9.3 - -Test-Suite spec - Default-Language: Haskell2010 - Default-Extensions: ConstraintKinds, FlexibleContexts - Main-Is: Main.hs - Hs-Source-Dirs: test, . - Ghc-Options: -Wall - Type: exitcode-stdio-1.0 - Other-Modules: Dir - Spec - BrowseSpec - CabalApiSpec - CheckSpec - FlagSpec - InfoSpec - LangSpec - LintSpec - ListSpec - MonadSpec - GhcPkgSpec - TestUtils - Build-Depends: base >= 4.0 && < 5 - , containers - , deepseq - , directory - , filepath - , ghc - , ghc-paths - , ghc-syb-utils - , hlint >= 1.7.1 - , io-choice - , monad-journal >= 0.4 - , old-time - , process - , syb - , time - , transformers - , transformers-base - , mtl >= 2.0 - , monad-control - , hspec >= 1.8.2 - , split - , haskell-src-exts - , text - , djinn-ghc >= 0.0.2.2 - if impl(ghc >= 7.8) - Build-Depends: Cabal >= 1.18 - else - Build-Depends: convertible - , Cabal >= 1.10 && < 1.17 - if impl(ghc < 7.6) - Build-Depends: executable-path - CPP-Options: -DSPEC=1 - -Source-Repository head - Type: git - Location: git://github.com/kazu-yamamoto/ghc-mod.git diff --git a/hackage-metadata/ghc-mod-5.1.1.0.cabal b/hackage-metadata/ghc-mod-5.1.1.0.cabal deleted file mode 100644 index 4f35713..0000000 --- a/hackage-metadata/ghc-mod-5.1.1.0.cabal +++ /dev/null @@ -1,236 +0,0 @@ -Name: ghc-mod -Version: 5.1.1.0 -Author: Kazu Yamamoto - Daniel Gröber - Alejandro Serrano -Maintainer: Kazu Yamamoto -License: BSD3 -License-File: LICENSE -Homepage: http://www.mew.org/~kazu/proj/ghc-mod/ -Synopsis: Happy Haskell Programming -Description: The ghc-mod command is a backend command to enrich - Haskell programming on editors including - Emacs, Vim, and Sublime. - The ghc-mod command is based on ghc-mod library - which is a wrapper of GHC API. - This package includes the ghc-mod command, - the ghc-mod library, and Emacs front-end - (for historical reasons). - For more information, please see its home page. - -Category: Development -Cabal-Version: >= 1.10 -Build-Type: Simple -Data-Dir: elisp -Data-Files: Makefile ghc.el ghc-func.el ghc-doc.el ghc-comp.el - ghc-check.el ghc-process.el ghc-command.el ghc-info.el - ghc-ins-mod.el ghc-indent.el ghc-pkg.el ghc-rewrite.el -Extra-Source-Files: ChangeLog - test/data/*.cabal - test/data/*.hs - test/data/cabal.sandbox.config.in - test/data/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/Cabal-1.18.1.3-2b161c6bf77657aa17e1681d83cb051b.conf - test/data/broken-cabal/*.cabal - test/data/broken-cabal/cabal.sandbox.config.in - test/data/broken-sandbox/*.cabal - test/data/broken-sandbox/cabal.sandbox.config - test/data/cabal-flags/*.cabal - test/data/check-test-subdir/*.cabal - test/data/check-test-subdir/src/Check/Test/*.hs - test/data/check-test-subdir/test/*.hs - test/data/check-test-subdir/test/Bar/*.hs - test/data/check-packageid/cabal.sandbox.config.in - test/data/check-packageid/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf - test/data/duplicate-pkgver/cabal.sandbox.config.in - test/data/duplicate-pkgver/duplicate-pkgver.cabal - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-1.0-7c59d13f32294d1ef6dc6233c24df961.conf - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-14e543bdae2da4d2aeff5386892c9112.conf - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf - test/data/pattern-synonyms/*.cabal - test/data/pattern-synonyms/*.hs - test/data/ghc-mod-check/*.cabal - test/data/ghc-mod-check/*.hs - test/data/ghc-mod-check/Data/*.hs - test/data/subdir1/subdir2/dummy - test/data/.cabal-sandbox/packages/00-index.tar - -Library - Default-Language: Haskell2010 - GHC-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - Exposed-Modules: Language.Haskell.GhcMod - Language.Haskell.GhcMod.Internal - Other-Modules: Language.Haskell.GhcMod.Boot - Language.Haskell.GhcMod.Browse - Language.Haskell.GhcMod.Cabal16 - Language.Haskell.GhcMod.Cabal18 - Language.Haskell.GhcMod.Cabal21 - Language.Haskell.GhcMod.CabalApi - Language.Haskell.GhcMod.CabalConfig - Language.Haskell.GhcMod.CaseSplit - Language.Haskell.GhcMod.Check - Language.Haskell.GhcMod.Convert - Language.Haskell.GhcMod.Cradle - Language.Haskell.GhcMod.Debug - Language.Haskell.GhcMod.Doc - Language.Haskell.GhcMod.DynFlags - Language.Haskell.GhcMod.Error - Language.Haskell.GhcMod.FillSig - Language.Haskell.GhcMod.Find - Language.Haskell.GhcMod.Flag - Language.Haskell.GhcMod.GHCApi - Language.Haskell.GhcMod.GHCChoice - Language.Haskell.GhcMod.Gap - Language.Haskell.GhcMod.GhcPkg - Language.Haskell.GhcMod.Info - Language.Haskell.GhcMod.Lang - Language.Haskell.GhcMod.Lint - Language.Haskell.GhcMod.Logger - Language.Haskell.GhcMod.Modules - Language.Haskell.GhcMod.Monad - Language.Haskell.GhcMod.PkgDoc - Language.Haskell.GhcMod.Read - Language.Haskell.GhcMod.SrcUtils - Language.Haskell.GhcMod.Target - Language.Haskell.GhcMod.Types - Language.Haskell.GhcMod.Utils - Build-Depends: base >= 4.0 && < 5 - , containers - , deepseq - , directory - , filepath - , ghc - , ghc-paths - , ghc-syb-utils - , hlint >= 1.8.61 - , io-choice - , monad-journal >= 0.4 - , old-time - , pretty - , process - , syb - , time - , transformers - , transformers-base - , mtl >= 2.0 - , monad-control - , split - , haskell-src-exts - , text - , djinn-ghc >= 0.0.2.2 - if impl(ghc >= 7.8) - Build-Depends: Cabal >= 1.18 - else - Build-Depends: convertible - , Cabal >= 1.10 && < 1.17 - if impl(ghc <= 7.4.2) - -- Only used to constrain random to a version that still works with GHC 7.4 - Build-Depends: random <= 1.0.1.1 - -Executable ghc-mod - Default-Language: Haskell2010 - Main-Is: GHCMod.hs - Other-Modules: Paths_ghc_mod - GHC-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src - Build-Depends: base >= 4.0 && < 5 - , data-default - , directory - , filepath - , pretty - , process - , mtl >= 2.0 - , ghc - , ghc-mod - -Executable ghc-modi - Default-Language: Haskell2010 - Main-Is: GHCModi.hs - Other-Modules: Paths_ghc_mod - Misc - Utils - GHC-Options: -Wall -threaded - if os(windows) - Cpp-Options: -DWINDOWS - Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src - Build-Depends: base >= 4.0 && < 5 - , async - , containers - , directory - , filepath - , old-time - , process - , split - , time - , ghc - , ghc-mod - -Test-Suite doctest - Type: exitcode-stdio-1.0 - Default-Language: Haskell2010 - HS-Source-Dirs: test - Ghc-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - Main-Is: doctests.hs - Build-Depends: base - , doctest >= 0.9.3 - -Test-Suite spec - Default-Language: Haskell2010 - Default-Extensions: ConstraintKinds, FlexibleContexts - Main-Is: Main.hs - Hs-Source-Dirs: test, . - Ghc-Options: -Wall - Type: exitcode-stdio-1.0 - Other-Modules: Dir - Spec - BrowseSpec - CabalApiSpec - CheckSpec - FlagSpec - InfoSpec - LangSpec - LintSpec - ListSpec - MonadSpec - GhcPkgSpec - TestUtils - Build-Depends: base >= 4.0 && < 5 - , containers - , deepseq - , directory - , filepath - , ghc - , ghc-paths - , ghc-syb-utils - , hlint >= 1.7.1 - , io-choice - , monad-journal >= 0.4 - , old-time - , pretty - , process - , syb - , time - , transformers - , transformers-base - , mtl >= 2.0 - , monad-control - , hspec >= 1.8.2 - , split - , haskell-src-exts - , text - , djinn-ghc >= 0.0.2.2 - if impl(ghc >= 7.8) - Build-Depends: Cabal >= 1.18 - else - Build-Depends: convertible - , Cabal >= 1.10 && < 1.17 - if impl(ghc < 7.6) - Build-Depends: executable-path - CPP-Options: -DSPEC=1 - -Source-Repository head - Type: git - Location: git://github.com/kazu-yamamoto/ghc-mod.git diff --git a/hackage-metadata/ghc-mod-5.2.0.0.cabal b/hackage-metadata/ghc-mod-5.2.0.0.cabal deleted file mode 100644 index 8a2f4a3..0000000 --- a/hackage-metadata/ghc-mod-5.2.0.0.cabal +++ /dev/null @@ -1,238 +0,0 @@ -Name: ghc-mod -Version: 5.2.0.0 -Author: Kazu Yamamoto - Daniel Gröber - Alejandro Serrano -Maintainer: Kazu Yamamoto -License: BSD3 -License-File: LICENSE -Homepage: http://www.mew.org/~kazu/proj/ghc-mod/ -Synopsis: Happy Haskell Programming -Description: The ghc-mod command is a backend command to enrich - Haskell programming on editors including - Emacs, Vim, and Sublime. - The ghc-mod command is based on ghc-mod library - which is a wrapper of GHC API. - This package includes the ghc-mod command, - the ghc-mod library, and Emacs front-end - (for historical reasons). - For more information, please see its home page. - -Category: Development -Cabal-Version: >= 1.10 -Build-Type: Simple -Data-Dir: elisp -Data-Files: Makefile ghc.el ghc-func.el ghc-doc.el ghc-comp.el - ghc-check.el ghc-process.el ghc-command.el ghc-info.el - ghc-ins-mod.el ghc-indent.el ghc-pkg.el ghc-rewrite.el -Extra-Source-Files: ChangeLog - test/data/*.cabal - test/data/*.hs - test/data/cabal.sandbox.config.in - test/data/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/Cabal-1.18.1.3-2b161c6bf77657aa17e1681d83cb051b.conf - test/data/broken-cabal/*.cabal - test/data/broken-cabal/cabal.sandbox.config.in - test/data/broken-sandbox/*.cabal - test/data/broken-sandbox/cabal.sandbox.config - test/data/cabal-flags/*.cabal - test/data/check-test-subdir/*.cabal - test/data/check-test-subdir/src/Check/Test/*.hs - test/data/check-test-subdir/test/*.hs - test/data/check-test-subdir/test/Bar/*.hs - test/data/check-packageid/cabal.sandbox.config.in - test/data/check-packageid/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf - test/data/duplicate-pkgver/cabal.sandbox.config.in - test/data/duplicate-pkgver/duplicate-pkgver.cabal - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-1.0-7c59d13f32294d1ef6dc6233c24df961.conf - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-14e543bdae2da4d2aeff5386892c9112.conf - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf - test/data/pattern-synonyms/*.cabal - test/data/pattern-synonyms/*.hs - test/data/ghc-mod-check/*.cabal - test/data/ghc-mod-check/*.hs - test/data/ghc-mod-check/Data/*.hs - test/data/subdir1/subdir2/dummy - test/data/.cabal-sandbox/packages/00-index.tar - -Library - Default-Language: Haskell2010 - GHC-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - Exposed-Modules: Language.Haskell.GhcMod - Language.Haskell.GhcMod.Internal - Other-Modules: Language.Haskell.GhcMod.Boot - Language.Haskell.GhcMod.Browse - Language.Haskell.GhcMod.Cabal16 - Language.Haskell.GhcMod.Cabal18 - Language.Haskell.GhcMod.Cabal21 - Language.Haskell.GhcMod.CabalApi - Language.Haskell.GhcMod.CabalConfig - Language.Haskell.GhcMod.CaseSplit - Language.Haskell.GhcMod.Check - Language.Haskell.GhcMod.Convert - Language.Haskell.GhcMod.Cradle - Language.Haskell.GhcMod.Debug - Language.Haskell.GhcMod.Doc - Language.Haskell.GhcMod.DynFlags - Language.Haskell.GhcMod.Error - Language.Haskell.GhcMod.FillSig - Language.Haskell.GhcMod.Find - Language.Haskell.GhcMod.Flag - Language.Haskell.GhcMod.GHCApi - Language.Haskell.GhcMod.GHCChoice - Language.Haskell.GhcMod.Gap - Language.Haskell.GhcMod.GhcPkg - Language.Haskell.GhcMod.Info - Language.Haskell.GhcMod.Lang - Language.Haskell.GhcMod.Lint - Language.Haskell.GhcMod.Logger - Language.Haskell.GhcMod.Modules - Language.Haskell.GhcMod.Monad - Language.Haskell.GhcMod.PkgDoc - Language.Haskell.GhcMod.Read - Language.Haskell.GhcMod.SrcUtils - Language.Haskell.GhcMod.Target - Language.Haskell.GhcMod.Types - Language.Haskell.GhcMod.Utils - Build-Depends: base >= 4.0 && < 5 - , containers - , deepseq - , directory - , filepath - , ghc - , ghc-paths - , ghc-syb-utils - , hlint >= 1.8.61 - , io-choice - , monad-journal >= 0.4 - , old-time - , pretty - , process - , syb - , temporary - , time - , transformers - , transformers-base - , mtl >= 2.0 - , monad-control - , split - , haskell-src-exts - , text - , djinn-ghc >= 0.0.2.2 - if impl(ghc >= 7.8) - Build-Depends: Cabal >= 1.18 - else - Build-Depends: convertible - , Cabal >= 1.10 && < 1.17 - if impl(ghc <= 7.4.2) - -- Only used to constrain random to a version that still works with GHC 7.4 - Build-Depends: random <= 1.0.1.1 - -Executable ghc-mod - Default-Language: Haskell2010 - Main-Is: GHCMod.hs - Other-Modules: Paths_ghc_mod - GHC-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src - Build-Depends: base >= 4.0 && < 5 - , data-default - , directory - , filepath - , pretty - , process - , mtl >= 2.0 - , ghc - , ghc-mod - -Executable ghc-modi - Default-Language: Haskell2010 - Main-Is: GHCModi.hs - Other-Modules: Paths_ghc_mod - Misc - Utils - GHC-Options: -Wall -threaded - if os(windows) - Cpp-Options: -DWINDOWS - Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src - Build-Depends: base >= 4.0 && < 5 - , async - , containers - , directory - , filepath - , old-time - , process - , split - , time - , ghc - , ghc-mod - -Test-Suite doctest - Type: exitcode-stdio-1.0 - Default-Language: Haskell2010 - HS-Source-Dirs: test - Ghc-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - Main-Is: doctests.hs - Build-Depends: base - , doctest >= 0.9.3 - -Test-Suite spec - Default-Language: Haskell2010 - Default-Extensions: ConstraintKinds, FlexibleContexts - Main-Is: Main.hs - Hs-Source-Dirs: test, . - Ghc-Options: -Wall - Type: exitcode-stdio-1.0 - Other-Modules: Dir - Spec - BrowseSpec - CabalApiSpec - CheckSpec - FlagSpec - InfoSpec - LangSpec - LintSpec - ListSpec - MonadSpec - GhcPkgSpec - TestUtils - Build-Depends: base >= 4.0 && < 5 - , containers - , deepseq - , directory - , filepath - , ghc - , ghc-paths - , ghc-syb-utils - , hlint >= 1.7.1 - , io-choice - , monad-journal >= 0.4 - , old-time - , pretty - , process - , syb - , temporary - , time - , transformers - , transformers-base - , mtl >= 2.0 - , monad-control - , hspec >= 1.8.2 - , split - , haskell-src-exts - , text - , djinn-ghc >= 0.0.2.2 - if impl(ghc >= 7.8) - Build-Depends: Cabal >= 1.18 - else - Build-Depends: convertible - , Cabal >= 1.10 && < 1.17 - if impl(ghc < 7.6) - Build-Depends: executable-path - CPP-Options: -DSPEC=1 - -Source-Repository head - Type: git - Location: git://github.com/kazu-yamamoto/ghc-mod.git diff --git a/hackage-metadata/ghc-mod-5.2.1.0.cabal b/hackage-metadata/ghc-mod-5.2.1.0.cabal deleted file mode 100644 index 1ca6050..0000000 --- a/hackage-metadata/ghc-mod-5.2.1.0.cabal +++ /dev/null @@ -1,242 +0,0 @@ -Name: ghc-mod -Version: 5.2.1.0 -Author: Kazu Yamamoto - Daniel Gröber - Alejandro Serrano -Maintainer: Kazu Yamamoto -License: BSD3 -License-File: LICENSE -Homepage: http://www.mew.org/~kazu/proj/ghc-mod/ -Synopsis: Happy Haskell Programming -Description: The ghc-mod command is a backend command to enrich - Haskell programming on editors including - Emacs, Vim, and Sublime. - The ghc-mod command is based on ghc-mod library - which is a wrapper of GHC API. - This package includes the ghc-mod command, - the ghc-mod library, and Emacs front-end - (for historical reasons). - For more information, please see its home page. - -Category: Development -Cabal-Version: >= 1.10 -Build-Type: Simple -Data-Dir: elisp -Data-Files: Makefile ghc.el ghc-func.el ghc-doc.el ghc-comp.el - ghc-check.el ghc-process.el ghc-command.el ghc-info.el - ghc-ins-mod.el ghc-indent.el ghc-pkg.el ghc-rewrite.el -Extra-Source-Files: ChangeLog - test/data/*.cabal - test/data/*.hs - test/data/cabal.sandbox.config.in - test/data/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/Cabal-1.18.1.3-2b161c6bf77657aa17e1681d83cb051b.conf - test/data/broken-cabal/*.cabal - test/data/broken-cabal/cabal.sandbox.config.in - test/data/broken-sandbox/*.cabal - test/data/broken-sandbox/cabal.sandbox.config - test/data/cabal-flags/*.cabal - test/data/check-test-subdir/*.cabal - test/data/check-test-subdir/src/Check/Test/*.hs - test/data/check-test-subdir/test/*.hs - test/data/check-test-subdir/test/Bar/*.hs - test/data/check-packageid/cabal.sandbox.config.in - test/data/check-packageid/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf - test/data/duplicate-pkgver/cabal.sandbox.config.in - test/data/duplicate-pkgver/duplicate-pkgver.cabal - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-1.0-7c59d13f32294d1ef6dc6233c24df961.conf - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-14e543bdae2da4d2aeff5386892c9112.conf - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf - test/data/pattern-synonyms/*.cabal - test/data/pattern-synonyms/*.hs - test/data/ghc-mod-check/*.cabal - test/data/ghc-mod-check/*.hs - test/data/ghc-mod-check/Data/*.hs - test/data/subdir1/subdir2/dummy - test/data/.cabal-sandbox/packages/00-index.tar - -Library - Default-Language: Haskell2010 - GHC-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - Exposed-Modules: Language.Haskell.GhcMod - Language.Haskell.GhcMod.Internal - Other-Modules: Language.Haskell.GhcMod.Boot - Language.Haskell.GhcMod.Browse - Language.Haskell.GhcMod.Cabal16 - Language.Haskell.GhcMod.Cabal18 - Language.Haskell.GhcMod.Cabal21 - Language.Haskell.GhcMod.CabalApi - Language.Haskell.GhcMod.CabalConfig - Language.Haskell.GhcMod.CaseSplit - Language.Haskell.GhcMod.Check - Language.Haskell.GhcMod.Convert - Language.Haskell.GhcMod.Cradle - Language.Haskell.GhcMod.Debug - Language.Haskell.GhcMod.Doc - Language.Haskell.GhcMod.DynFlags - Language.Haskell.GhcMod.Error - Language.Haskell.GhcMod.FillSig - Language.Haskell.GhcMod.Find - Language.Haskell.GhcMod.Flag - Language.Haskell.GhcMod.GHCApi - Language.Haskell.GhcMod.GHCChoice - Language.Haskell.GhcMod.Gap - Language.Haskell.GhcMod.GhcPkg - Language.Haskell.GhcMod.Info - Language.Haskell.GhcMod.Lang - Language.Haskell.GhcMod.Lint - Language.Haskell.GhcMod.Logger - Language.Haskell.GhcMod.Modules - Language.Haskell.GhcMod.Monad - Language.Haskell.GhcMod.PathsAndFiles - Language.Haskell.GhcMod.PkgDoc - Language.Haskell.GhcMod.Read - Language.Haskell.GhcMod.SrcUtils - Language.Haskell.GhcMod.Target - Language.Haskell.GhcMod.Types - Language.Haskell.GhcMod.Utils - Language.Haskell.GhcMod.World - Build-Depends: base >= 4.0 && < 5 - , containers - , deepseq - , directory - , filepath - , ghc - , ghc-paths - , ghc-syb-utils - , hlint >= 1.8.61 - , io-choice - , monad-journal >= 0.4 - , old-time - , pretty - , process - , syb - , temporary - , time - , transformers - , transformers-base - , mtl >= 2.0 - , monad-control - , split - , haskell-src-exts - , text - , djinn-ghc >= 0.0.2.2 - if impl(ghc >= 7.8) - Build-Depends: Cabal >= 1.18 - else - Build-Depends: convertible - , Cabal >= 1.10 && < 1.17 - if impl(ghc <= 7.4.2) - -- Only used to constrain random to a version that still works with GHC 7.4 - Build-Depends: random <= 1.0.1.1 - -Executable ghc-mod - Default-Language: Haskell2010 - Main-Is: GHCMod.hs - Other-Modules: Paths_ghc_mod - GHC-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src - Build-Depends: base >= 4.0 && < 5 - , async - , data-default - , directory - , filepath - , pretty - , process - , split - , mtl >= 2.0 - , ghc - , ghc-mod - -Executable ghc-modi - Default-Language: Haskell2010 - Main-Is: GHCModi.hs - Other-Modules: Paths_ghc_mod - Misc - Utils - GHC-Options: -Wall -threaded - if os(windows) - Cpp-Options: -DWINDOWS - Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src - Build-Depends: base >= 4.0 && < 5 - , async - , containers - , directory - , filepath - , old-time - , process - , split - , time - , ghc - , ghc-mod - -Test-Suite doctest - Type: exitcode-stdio-1.0 - Default-Language: Haskell2010 - HS-Source-Dirs: test - Ghc-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - Main-Is: doctests.hs - Build-Depends: base - , doctest >= 0.9.3 - -Test-Suite spec - Default-Language: Haskell2010 - Default-Extensions: ConstraintKinds, FlexibleContexts - Main-Is: Main.hs - Hs-Source-Dirs: test, . - Ghc-Options: -Wall - Type: exitcode-stdio-1.0 - Other-Modules: BrowseSpec - CabalApiSpec - CheckSpec - Dir - FlagSpec - InfoSpec - LangSpec - LintSpec - ListSpec - MonadSpec - PathsAndFilesSpec - Spec - TestUtils - Build-Depends: base >= 4.0 && < 5 - , containers - , deepseq - , directory - , filepath - , ghc - , ghc-paths - , ghc-syb-utils - , hlint >= 1.7.1 - , io-choice - , monad-journal >= 0.4 - , old-time - , pretty - , process - , syb - , temporary - , time - , transformers - , transformers-base - , mtl >= 2.0 - , monad-control - , hspec >= 1.8.2 - , split - , haskell-src-exts - , text - , djinn-ghc >= 0.0.2.2 - if impl(ghc >= 7.8) - Build-Depends: Cabal >= 1.18 - else - Build-Depends: convertible - , Cabal >= 1.10 && < 1.17 - if impl(ghc < 7.6) - Build-Depends: executable-path - CPP-Options: -DSPEC=1 - -Source-Repository head - Type: git - Location: git://github.com/kazu-yamamoto/ghc-mod.git diff --git a/hackage-metadata/ghc-mod-5.2.1.1.cabal b/hackage-metadata/ghc-mod-5.2.1.1.cabal deleted file mode 100644 index 3f20b13..0000000 --- a/hackage-metadata/ghc-mod-5.2.1.1.cabal +++ /dev/null @@ -1,243 +0,0 @@ -Name: ghc-mod -Version: 5.2.1.1 -Author: Kazu Yamamoto - Daniel Gröber - Alejandro Serrano -Maintainer: Kazu Yamamoto -License: BSD3 -License-File: LICENSE -Homepage: http://www.mew.org/~kazu/proj/ghc-mod/ -Synopsis: Happy Haskell Programming -Description: The ghc-mod command is a backend command to enrich - Haskell programming on editors including - Emacs, Vim, and Sublime. - The ghc-mod command is based on ghc-mod library - which is a wrapper of GHC API. - This package includes the ghc-mod command, - the ghc-mod library, and Emacs front-end - (for historical reasons). - For more information, please see its home page. - -Category: Development -Cabal-Version: >= 1.10 -Build-Type: Simple -Data-Dir: elisp -Data-Files: Makefile ghc.el ghc-func.el ghc-doc.el ghc-comp.el - ghc-check.el ghc-process.el ghc-command.el ghc-info.el - ghc-ins-mod.el ghc-indent.el ghc-pkg.el ghc-rewrite.el -Extra-Source-Files: ChangeLog - test/data/*.cabal - test/data/*.hs - test/data/cabal.sandbox.config.in - test/data/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/Cabal-1.18.1.3-2b161c6bf77657aa17e1681d83cb051b.conf - test/data/broken-cabal/*.cabal - test/data/broken-cabal/cabal.sandbox.config.in - test/data/broken-sandbox/*.cabal - test/data/broken-sandbox/cabal.sandbox.config - test/data/case-split/*.hs - test/data/cabal-flags/*.cabal - test/data/check-test-subdir/*.cabal - test/data/check-test-subdir/src/Check/Test/*.hs - test/data/check-test-subdir/test/*.hs - test/data/check-test-subdir/test/Bar/*.hs - test/data/check-packageid/cabal.sandbox.config.in - test/data/check-packageid/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf - test/data/duplicate-pkgver/cabal.sandbox.config.in - test/data/duplicate-pkgver/duplicate-pkgver.cabal - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-1.0-7c59d13f32294d1ef6dc6233c24df961.conf - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-14e543bdae2da4d2aeff5386892c9112.conf - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf - test/data/pattern-synonyms/*.cabal - test/data/pattern-synonyms/*.hs - test/data/ghc-mod-check/*.cabal - test/data/ghc-mod-check/*.hs - test/data/ghc-mod-check/Data/*.hs - test/data/subdir1/subdir2/dummy - test/data/.cabal-sandbox/packages/00-index.tar - -Library - Default-Language: Haskell2010 - GHC-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - Exposed-Modules: Language.Haskell.GhcMod - Language.Haskell.GhcMod.Internal - Other-Modules: Language.Haskell.GhcMod.Boot - Language.Haskell.GhcMod.Browse - Language.Haskell.GhcMod.Cabal16 - Language.Haskell.GhcMod.Cabal18 - Language.Haskell.GhcMod.Cabal21 - Language.Haskell.GhcMod.CabalApi - Language.Haskell.GhcMod.CabalConfig - Language.Haskell.GhcMod.CaseSplit - Language.Haskell.GhcMod.Check - Language.Haskell.GhcMod.Convert - Language.Haskell.GhcMod.Cradle - Language.Haskell.GhcMod.Debug - Language.Haskell.GhcMod.Doc - Language.Haskell.GhcMod.DynFlags - Language.Haskell.GhcMod.Error - Language.Haskell.GhcMod.FillSig - Language.Haskell.GhcMod.Find - Language.Haskell.GhcMod.Flag - Language.Haskell.GhcMod.GHCApi - Language.Haskell.GhcMod.GHCChoice - Language.Haskell.GhcMod.Gap - Language.Haskell.GhcMod.GhcPkg - Language.Haskell.GhcMod.Info - Language.Haskell.GhcMod.Lang - Language.Haskell.GhcMod.Lint - Language.Haskell.GhcMod.Logger - Language.Haskell.GhcMod.Modules - Language.Haskell.GhcMod.Monad - Language.Haskell.GhcMod.PathsAndFiles - Language.Haskell.GhcMod.PkgDoc - Language.Haskell.GhcMod.Read - Language.Haskell.GhcMod.SrcUtils - Language.Haskell.GhcMod.Target - Language.Haskell.GhcMod.Types - Language.Haskell.GhcMod.Utils - Language.Haskell.GhcMod.World - Build-Depends: base >= 4.0 && < 5 - , containers - , deepseq - , directory - , filepath - , ghc - , ghc-paths - , ghc-syb-utils - , hlint >= 1.8.61 - , io-choice - , monad-journal >= 0.4 - , old-time - , pretty - , process - , syb - , temporary - , time - , transformers - , transformers-base - , mtl >= 2.0 - , monad-control - , split - , haskell-src-exts - , text - , djinn-ghc >= 0.0.2.2 - if impl(ghc >= 7.8) - Build-Depends: Cabal >= 1.18 - else - Build-Depends: convertible - , Cabal >= 1.10 && < 1.17 - if impl(ghc <= 7.4.2) - -- Only used to constrain random to a version that still works with GHC 7.4 - Build-Depends: random <= 1.0.1.1 - -Executable ghc-mod - Default-Language: Haskell2010 - Main-Is: GHCMod.hs - Other-Modules: Paths_ghc_mod - GHC-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src - Build-Depends: base >= 4.0 && < 5 - , async - , data-default - , directory - , filepath - , pretty - , process - , split - , mtl >= 2.0 - , ghc - , ghc-mod - -Executable ghc-modi - Default-Language: Haskell2010 - Main-Is: GHCModi.hs - Other-Modules: Paths_ghc_mod - Misc - Utils - GHC-Options: -Wall -threaded - if os(windows) - Cpp-Options: -DWINDOWS - Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src - Build-Depends: base >= 4.0 && < 5 - , async - , containers - , directory - , filepath - , old-time - , process - , split - , time - , ghc - , ghc-mod - -Test-Suite doctest - Type: exitcode-stdio-1.0 - Default-Language: Haskell2010 - HS-Source-Dirs: test - Ghc-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - Main-Is: doctests.hs - Build-Depends: base - , doctest >= 0.9.3 - -Test-Suite spec - Default-Language: Haskell2010 - Default-Extensions: ConstraintKinds, FlexibleContexts - Main-Is: Main.hs - Hs-Source-Dirs: test, . - Ghc-Options: -Wall - Type: exitcode-stdio-1.0 - Other-Modules: BrowseSpec - CabalApiSpec - CheckSpec - Dir - FlagSpec - InfoSpec - LangSpec - LintSpec - ListSpec - MonadSpec - PathsAndFilesSpec - Spec - TestUtils - Build-Depends: base >= 4.0 && < 5 - , containers - , deepseq - , directory - , filepath - , ghc - , ghc-paths - , ghc-syb-utils - , hlint >= 1.7.1 - , io-choice - , monad-journal >= 0.4 - , old-time - , pretty - , process - , syb - , temporary - , time - , transformers - , transformers-base - , mtl >= 2.0 - , monad-control - , hspec >= 1.8.2 - , split - , haskell-src-exts - , text - , djinn-ghc >= 0.0.2.2 - if impl(ghc >= 7.8) - Build-Depends: Cabal >= 1.18 - else - Build-Depends: convertible - , Cabal >= 1.10 && < 1.17 - if impl(ghc < 7.6) - Build-Depends: executable-path - CPP-Options: -DSPEC=1 - -Source-Repository head - Type: git - Location: git://github.com/kazu-yamamoto/ghc-mod.git diff --git a/hackage-metadata/ghc-mod-5.2.1.2.cabal b/hackage-metadata/ghc-mod-5.2.1.2.cabal deleted file mode 100644 index 3697e97..0000000 --- a/hackage-metadata/ghc-mod-5.2.1.2.cabal +++ /dev/null @@ -1,243 +0,0 @@ -Name: ghc-mod -Version: 5.2.1.2 -Author: Kazu Yamamoto - Daniel Gröber - Alejandro Serrano -Maintainer: Kazu Yamamoto -License: BSD3 -License-File: LICENSE -Homepage: http://www.mew.org/~kazu/proj/ghc-mod/ -Synopsis: Happy Haskell Programming -Description: The ghc-mod command is a backend command to enrich - Haskell programming on editors including - Emacs, Vim, and Sublime. - The ghc-mod command is based on ghc-mod library - which is a wrapper of GHC API. - This package includes the ghc-mod command, - the ghc-mod library, and Emacs front-end - (for historical reasons). - For more information, please see its home page. - -Category: Development -Cabal-Version: >= 1.10 -Build-Type: Simple -Data-Dir: elisp -Data-Files: Makefile ghc.el ghc-func.el ghc-doc.el ghc-comp.el - ghc-check.el ghc-process.el ghc-command.el ghc-info.el - ghc-ins-mod.el ghc-indent.el ghc-pkg.el ghc-rewrite.el -Extra-Source-Files: ChangeLog - test/data/*.cabal - test/data/*.hs - test/data/cabal.sandbox.config.in - test/data/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/Cabal-1.18.1.3-2b161c6bf77657aa17e1681d83cb051b.conf - test/data/broken-cabal/*.cabal - test/data/broken-cabal/cabal.sandbox.config.in - test/data/broken-sandbox/*.cabal - test/data/broken-sandbox/cabal.sandbox.config - test/data/case-split/*.hs - test/data/cabal-flags/*.cabal - test/data/check-test-subdir/*.cabal - test/data/check-test-subdir/src/Check/Test/*.hs - test/data/check-test-subdir/test/*.hs - test/data/check-test-subdir/test/Bar/*.hs - test/data/check-packageid/cabal.sandbox.config.in - test/data/check-packageid/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf - test/data/duplicate-pkgver/cabal.sandbox.config.in - test/data/duplicate-pkgver/duplicate-pkgver.cabal - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-1.0-7c59d13f32294d1ef6dc6233c24df961.conf - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-14e543bdae2da4d2aeff5386892c9112.conf - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf - test/data/pattern-synonyms/*.cabal - test/data/pattern-synonyms/*.hs - test/data/ghc-mod-check/*.cabal - test/data/ghc-mod-check/*.hs - test/data/ghc-mod-check/Data/*.hs - test/data/subdir1/subdir2/dummy - test/data/.cabal-sandbox/packages/00-index.tar - -Library - Default-Language: Haskell2010 - GHC-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - Exposed-Modules: Language.Haskell.GhcMod - Language.Haskell.GhcMod.Internal - Other-Modules: Language.Haskell.GhcMod.Boot - Language.Haskell.GhcMod.Browse - Language.Haskell.GhcMod.Cabal16 - Language.Haskell.GhcMod.Cabal18 - Language.Haskell.GhcMod.Cabal21 - Language.Haskell.GhcMod.CabalApi - Language.Haskell.GhcMod.CabalConfig - Language.Haskell.GhcMod.CaseSplit - Language.Haskell.GhcMod.Check - Language.Haskell.GhcMod.Convert - Language.Haskell.GhcMod.Cradle - Language.Haskell.GhcMod.Debug - Language.Haskell.GhcMod.Doc - Language.Haskell.GhcMod.DynFlags - Language.Haskell.GhcMod.Error - Language.Haskell.GhcMod.FillSig - Language.Haskell.GhcMod.Find - Language.Haskell.GhcMod.Flag - Language.Haskell.GhcMod.GHCApi - Language.Haskell.GhcMod.GHCChoice - Language.Haskell.GhcMod.Gap - Language.Haskell.GhcMod.GhcPkg - Language.Haskell.GhcMod.Info - Language.Haskell.GhcMod.Lang - Language.Haskell.GhcMod.Lint - Language.Haskell.GhcMod.Logger - Language.Haskell.GhcMod.Modules - Language.Haskell.GhcMod.Monad - Language.Haskell.GhcMod.PathsAndFiles - Language.Haskell.GhcMod.PkgDoc - Language.Haskell.GhcMod.Read - Language.Haskell.GhcMod.SrcUtils - Language.Haskell.GhcMod.Target - Language.Haskell.GhcMod.Types - Language.Haskell.GhcMod.Utils - Language.Haskell.GhcMod.World - Build-Depends: base >= 4.0 && < 5 - , containers - , deepseq - , directory - , filepath - , ghc - , ghc-paths - , ghc-syb-utils - , hlint >= 1.8.61 - , io-choice - , monad-journal >= 0.4 - , old-time - , pretty - , process - , syb - , temporary - , time - , transformers - , transformers-base - , mtl >= 2.0 - , monad-control - , split - , haskell-src-exts - , text - , djinn-ghc >= 0.0.2.2 - if impl(ghc >= 7.8) - Build-Depends: Cabal >= 1.18 - else - Build-Depends: convertible - , Cabal >= 1.10 && < 1.17 - if impl(ghc <= 7.4.2) - -- Only used to constrain random to a version that still works with GHC 7.4 - Build-Depends: random <= 1.0.1.1 - -Executable ghc-mod - Default-Language: Haskell2010 - Main-Is: GHCMod.hs - Other-Modules: Paths_ghc_mod - GHC-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src - Build-Depends: base >= 4.0 && < 5 - , async - , data-default - , directory - , filepath - , pretty - , process - , split - , mtl >= 2.0 - , ghc - , ghc-mod - -Executable ghc-modi - Default-Language: Haskell2010 - Main-Is: GHCModi.hs - Other-Modules: Paths_ghc_mod - Misc - Utils - GHC-Options: -Wall -threaded - if os(windows) - Cpp-Options: -DWINDOWS - Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src - Build-Depends: base >= 4.0 && < 5 - , async - , containers - , directory - , filepath - , old-time - , process - , split - , time - , ghc - , ghc-mod - -Test-Suite doctest - Type: exitcode-stdio-1.0 - Default-Language: Haskell2010 - HS-Source-Dirs: test - Ghc-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - Main-Is: doctests.hs - Build-Depends: base - , doctest >= 0.9.3 - -Test-Suite spec - Default-Language: Haskell2010 - Default-Extensions: ConstraintKinds, FlexibleContexts - Main-Is: Main.hs - Hs-Source-Dirs: test, . - Ghc-Options: -Wall - Type: exitcode-stdio-1.0 - Other-Modules: BrowseSpec - CabalApiSpec - CheckSpec - Dir - FlagSpec - InfoSpec - LangSpec - LintSpec - ListSpec - MonadSpec - PathsAndFilesSpec - Spec - TestUtils - Build-Depends: base >= 4.0 && < 5 - , containers - , deepseq - , directory - , filepath - , ghc - , ghc-paths - , ghc-syb-utils - , hlint >= 1.7.1 - , io-choice - , monad-journal >= 0.4 - , old-time - , pretty - , process - , syb - , temporary - , time - , transformers - , transformers-base - , mtl >= 2.0 - , monad-control - , hspec >= 1.8.2 - , split - , haskell-src-exts - , text - , djinn-ghc >= 0.0.2.2 - if impl(ghc >= 7.8) - Build-Depends: Cabal >= 1.18 - else - Build-Depends: convertible - , Cabal >= 1.10 && < 1.17 - if impl(ghc < 7.6) - Build-Depends: executable-path - CPP-Options: -DSPEC=1 - -Source-Repository head - Type: git - Location: git://github.com/kazu-yamamoto/ghc-mod.git diff --git a/hackage-metadata/ghc-mod-5.3.0.0.cabal b/hackage-metadata/ghc-mod-5.3.0.0.cabal deleted file mode 100644 index a9b7ac0..0000000 --- a/hackage-metadata/ghc-mod-5.3.0.0.cabal +++ /dev/null @@ -1,250 +0,0 @@ -X-Revision: 3 -Name: ghc-mod -Version: 5.3.0.0 -Author: Kazu Yamamoto , - Daniel Gröber , - Alejandro Serrano -Maintainer: Daniel Gröber -License: AGPL-3 -License-File: LICENSE -License-Files: COPYING.BSD3 COPYING.AGPL3 -Homepage: http://www.mew.org/~kazu/proj/ghc-mod/ -Synopsis: Happy Haskell Programming -Description: - ghc-mod is a backend program to enrich Haskell programming in editors. It - strives to offer most of the features one has come to expect from modern IDEs - in any editor. - - ghc-mod provides a library for other haskell programs to use as well as a - standalone program for easy editor integration. All of the fundamental - functionality of the frontend program can be accessed through the library - however many implementation details are hidden and if you want to - significantly extend ghc-mod you should submit these changes upstream instead - of implementing them on top of the library. - - For more information, please see its home page. - -Category: GHC, Development -Cabal-Version: >= 1.14 -Build-Type: Custom -Data-Files: elisp/Makefile - elisp/*.el -Data-Files: LICENSE COPYING.BSD3 COPYING.AGPL3 -Extra-Source-Files: ChangeLog - SetupCompat.hs - NotCPP/*.hs - test/data/annotations/*.hs - test/data/broken-cabal/*.cabal - test/data/broken-cabal/cabal.sandbox.config.in - test/data/broken-sandbox/cabal.sandbox.config - test/data/broken-sandbox/dummy.cabal - test/data/cabal-flags/cabal-flags.cabal - test/data/cabal-project/*.cabal - test/data/cabal-project/*.hs - test/data/cabal-project/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/Cabal-1.18.1.3-2b161c6bf77657aa17e1681d83cb051b.conf - test/data/cabal-project/cabal.sandbox.config.in - test/data/cabal-project/subdir1/subdir2/dummy - test/data/case-split/*.hs - test/data/check-packageid/cabal.sandbox.config.in - test/data/check-packageid/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf - test/data/check-test-subdir/*.cabal - test/data/check-test-subdir/src/Check/Test/*.hs - test/data/check-test-subdir/test/*.hs - test/data/check-test-subdir/test/Bar/*.hs - test/data/duplicate-pkgver/cabal.sandbox.config.in - test/data/duplicate-pkgver/duplicate-pkgver.cabal - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-1.0-7c59d13f32294d1ef6dc6233c24df961.conf - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-14e543bdae2da4d2aeff5386892c9112.conf - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf - test/data/foreign-export/*.hs - test/data/ghc-mod-check/*.cabal - test/data/ghc-mod-check/*.hs - test/data/ghc-mod-check/lib/Data/*.hs - test/data/hlint/*.hs - test/data/home-module-graph/cpp/*.hs - test/data/home-module-graph/cycle/*.hs - test/data/home-module-graph/errors/*.hs - test/data/home-module-graph/indirect/*.hs - test/data/home-module-graph/indirect-update/*.hs - test/data/import-cycle/*.hs - test/data/non-exported/*.hs - test/data/pattern-synonyms/*.cabal - test/data/pattern-synonyms/*.hs - test/data/quasi-quotes/*.hs - test/data/template-haskell/*.hs - test/data/target/*.hs - test/data/check-missing-warnings/*.hs - test/data/custom-cradle/custom-cradle.cabal - test/data/custom-cradle/ghc-mod.package-db-stack - test/data/custom-cradle/package-db-a/.gitkeep - test/data/custom-cradle/package-db-b/.gitkeep - test/data/custom-cradle/package-db-c/.gitkeep - test/data/cabal-preprocessors/*.cabal - test/data/cabal-preprocessors/*.hs - test/data/cabal-preprocessors/*.hsc - -Library - Default-Language: Haskell2010 - GHC-Options: -Wall -fno-warn-deprecations - Default-Extensions: ScopedTypeVariables, RecordWildCards, NamedFieldPuns, - ConstraintKinds, FlexibleContexts, - DataKinds, KindSignatures, TypeOperators - Exposed-Modules: Language.Haskell.GhcMod - Language.Haskell.GhcMod.Internal - Other-Modules: Paths_ghc_mod - Utils - Language.Haskell.GhcMod.Boot - Language.Haskell.GhcMod.Browse - Language.Haskell.GhcMod.CabalHelper - Language.Haskell.GhcMod.Caching - Language.Haskell.GhcMod.Caching.Types - Language.Haskell.GhcMod.CaseSplit - Language.Haskell.GhcMod.Check - Language.Haskell.GhcMod.Convert - Language.Haskell.GhcMod.Cradle - Language.Haskell.GhcMod.Debug - Language.Haskell.GhcMod.Doc - Language.Haskell.GhcMod.DynFlags - Language.Haskell.GhcMod.Error - Language.Haskell.GhcMod.FillSig - Language.Haskell.GhcMod.Find - Language.Haskell.GhcMod.Flag - Language.Haskell.GhcMod.Gap - Language.Haskell.GhcMod.GhcPkg - Language.Haskell.GhcMod.HomeModuleGraph - Language.Haskell.GhcMod.Info - Language.Haskell.GhcMod.Lang - Language.Haskell.GhcMod.Lint - Language.Haskell.GhcMod.Logger - Language.Haskell.GhcMod.Logging - Language.Haskell.GhcMod.Modules - Language.Haskell.GhcMod.Monad - Language.Haskell.GhcMod.Monad.Types - Language.Haskell.GhcMod.Output - Language.Haskell.GhcMod.PathsAndFiles - Language.Haskell.GhcMod.PkgDoc - Language.Haskell.GhcMod.Pretty - Language.Haskell.GhcMod.Read - Language.Haskell.GhcMod.SrcUtils - Language.Haskell.GhcMod.Target - Language.Haskell.GhcMod.Types - Language.Haskell.GhcMod.Utils - Language.Haskell.GhcMod.World - Build-Depends: base < 5 && >= 4.0 - , bytestring < 0.11 - , cereal < 0.5 && >= 0.4 - , containers < 0.6 - , cabal-helper < 0.6 && >= 0.5.1.0 - , deepseq < 1.5 - , directory < 1.3 - , filepath < 1.5 - , ghc < 7.11 - , ghc-paths < 0.2 - , ghc-syb-utils < 0.3 - , hlint < 1.10 && >= 1.8.61 - , monad-journal < 0.8 && >= 0.4 - , old-time < 1.2 - , pretty < 1.2 - , process < 1.3 - , syb < 0.7 - , temporary < 1.3 - , time < 1.6 - , transformers < 0.5 - , transformers-base < 0.5 - , mtl < 2.3 && >= 2.0 - , monad-control < 1.1 && >= 1 - , split < 0.3 - , haskell-src-exts < 1.17 - , text < 1.3 - , djinn-ghc < 0.1 && >= 0.0.2.2 - , fclabels == 2.0.* - if impl(ghc < 7.8) - Build-Depends: convertible - if impl(ghc < 7.5) - -- Only used to constrain random to a version that still works with GHC 7.4 - Build-Depends: random <= 1.0.1.1, - ghc-prim - -Executable ghc-mod - Default-Language: Haskell2010 - Main-Is: GHCMod.hs - Other-Modules: Paths_ghc_mod - GHC-Options: -Wall -fno-warn-deprecations - Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src - Build-Depends: base < 5 && >= 4.0 - , async < 2.1 - , directory < 1.3 - , filepath < 1.5 - , pretty < 1.2 - , process < 1.3 - , split < 0.3 - , mtl < 2.3 && >= 2.0 - , ghc < 7.11 - , ghc-mod - -Executable ghc-modi - Default-Language: Haskell2010 - Main-Is: GHCModi.hs - Other-Modules: Paths_ghc_mod - Misc - Utils - GHC-Options: -Wall -threaded -fno-warn-deprecations - if os(windows) - Cpp-Options: -DWINDOWS - Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src, . - Build-Depends: base < 5 && >= 4.0 - , directory < 1.3 - , filepath < 1.5 - , process < 1.3 - , old-time < 1.2 - , time < 1.6 - -Test-Suite doctest - Type: exitcode-stdio-1.0 - Default-Language: Haskell2010 - HS-Source-Dirs: test - Ghc-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - Main-Is: doctests.hs - if impl(ghc == 7.4.*) - Buildable: False - Build-Depends: base - , doctest >= 0.9.3 - -Test-Suite spec - Default-Language: Haskell2010 - Default-Extensions: ScopedTypeVariables, RecordWildCards, NamedFieldPuns, - ConstraintKinds, FlexibleContexts, - DataKinds, KindSignatures, TypeOperators - Main-Is: Main.hs - Hs-Source-Dirs: test, . - Ghc-Options: -Wall -fno-warn-deprecations - CPP-Options: -DSPEC=1 - Type: exitcode-stdio-1.0 - Other-Modules: Paths_ghc_mod - Dir - Spec - TestUtils - BrowseSpec - CheckSpec - FlagSpec - InfoSpec - LangSpec - LintSpec - ListSpec - MonadSpec - PathsAndFilesSpec - HomeModuleGraphSpec - - Build-Depends: hspec >= 2.0.0 - if impl(ghc == 7.4.*) - Build-Depends: executable-path - X-Build-Depends-Like: CLibName - - - -Source-Repository head - Type: git - Location: git://github.com/kazu-yamamoto/ghc-mod.git \ No newline at end of file diff --git a/hackage-metadata/ghc-mod-5.4.0.0.cabal b/hackage-metadata/ghc-mod-5.4.0.0.cabal deleted file mode 100644 index 438b311..0000000 --- a/hackage-metadata/ghc-mod-5.4.0.0.cabal +++ /dev/null @@ -1,271 +0,0 @@ -X-Revision: 4 -Name: ghc-mod -Version: 5.4.0.0 -Author: Kazu Yamamoto , - Daniel Gröber , - Alejandro Serrano -Maintainer: Daniel Gröber -License: AGPL-3 -License-File: LICENSE -License-Files: COPYING.BSD3 COPYING.AGPL3 -Homepage: http://www.mew.org/~kazu/proj/ghc-mod/ -Synopsis: Happy Haskell Programming -Description: - ghc-mod is a backend program to enrich Haskell programming in editors. It - strives to offer most of the features one has come to expect from modern IDEs - in any editor. - - ghc-mod provides a library for other haskell programs to use as well as a - standalone program for easy editor integration. All of the fundamental - functionality of the frontend program can be accessed through the library - however many implementation details are hidden and if you want to - significantly extend ghc-mod you should submit these changes upstream instead - of implementing them on top of the library. - - For more information, please see its home page. - -Category: GHC, Development -Cabal-Version: >= 1.14 -Build-Type: Custom -Data-Files: elisp/Makefile - elisp/*.el -Data-Files: LICENSE COPYING.BSD3 COPYING.AGPL3 -Extra-Source-Files: ChangeLog - SetupCompat.hs - NotCPP/*.hs - NotCPP/COPYING - test/data/annotations/*.hs - test/data/broken-cabal/*.cabal - test/data/broken-cabal/cabal.sandbox.config.in - test/data/broken-sandbox/cabal.sandbox.config - test/data/broken-sandbox/dummy.cabal - test/data/cabal-flags/cabal-flags.cabal - test/data/cabal-project/*.cabal - test/data/cabal-project/*.hs - test/data/cabal-project/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/Cabal-1.18.1.3-2b161c6bf77657aa17e1681d83cb051b.conf - test/data/cabal-project/cabal.sandbox.config.in - test/data/cabal-project/subdir1/subdir2/dummy - test/data/case-split/*.hs - test/data/check-packageid/cabal.sandbox.config.in - test/data/check-packageid/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf - test/data/check-test-subdir/*.cabal - test/data/check-test-subdir/src/Check/Test/*.hs - test/data/check-test-subdir/test/*.hs - test/data/check-test-subdir/test/Bar/*.hs - test/data/duplicate-pkgver/cabal.sandbox.config.in - test/data/duplicate-pkgver/duplicate-pkgver.cabal - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-1.0-7c59d13f32294d1ef6dc6233c24df961.conf - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-14e543bdae2da4d2aeff5386892c9112.conf - test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d/template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c.conf - test/data/foreign-export/*.hs - test/data/ghc-mod-check/*.cabal - test/data/ghc-mod-check/*.hs - test/data/ghc-mod-check/lib/Data/*.hs - test/data/hlint/*.hs - test/data/home-module-graph/cpp/*.hs - test/data/home-module-graph/cycle/*.hs - test/data/home-module-graph/errors/*.hs - test/data/home-module-graph/indirect/*.hs - test/data/home-module-graph/indirect-update/*.hs - test/data/import-cycle/*.hs - test/data/non-exported/*.hs - test/data/pattern-synonyms/*.cabal - test/data/pattern-synonyms/*.hs - test/data/quasi-quotes/*.hs - test/data/template-haskell/*.hs - test/data/target/*.hs - test/data/check-missing-warnings/*.hs - test/data/custom-cradle/custom-cradle.cabal - test/data/custom-cradle/ghc-mod.package-db-stack - test/data/custom-cradle/package-db-a/.gitkeep - test/data/custom-cradle/package-db-b/.gitkeep - test/data/custom-cradle/package-db-c/.gitkeep - test/data/cabal-preprocessors/*.cabal - test/data/cabal-preprocessors/*.hs - test/data/cabal-preprocessors/*.hsc - test/data/file-mapping/*.hs - test/data/file-mapping/preprocessor/*.hs - test/data/file-mapping/lhs/*.lhs - test/data/nice-qualification/*.hs - test/data/stack-project/stack.yaml - test/data/stack-project/new-template.cabal - test/data/stack-project/*.hs - test/data/stack-project/app/*.hs - test/data/stack-project/src/*.hs - test/data/stack-project/test/*.hs - -Library - Default-Language: Haskell2010 - GHC-Options: -Wall -fno-warn-deprecations - Default-Extensions: ScopedTypeVariables, RecordWildCards, NamedFieldPuns, - ConstraintKinds, FlexibleContexts, - DataKinds, KindSignatures, TypeOperators, ViewPatterns - Exposed-Modules: Language.Haskell.GhcMod - Language.Haskell.GhcMod.Internal - Language.Haskell.GhcMod.Boot - Language.Haskell.GhcMod.Browse - Language.Haskell.GhcMod.CabalHelper - Language.Haskell.GhcMod.Caching - Language.Haskell.GhcMod.Caching.Types - Language.Haskell.GhcMod.CaseSplit - Language.Haskell.GhcMod.Check - Language.Haskell.GhcMod.Convert - Language.Haskell.GhcMod.Cradle - Language.Haskell.GhcMod.CustomPackageDb - Language.Haskell.GhcMod.Debug - Language.Haskell.GhcMod.DebugLogger - Language.Haskell.GhcMod.Doc - Language.Haskell.GhcMod.DynFlags - Language.Haskell.GhcMod.Error - Language.Haskell.GhcMod.FileMapping - Language.Haskell.GhcMod.FillSig - Language.Haskell.GhcMod.Find - Language.Haskell.GhcMod.Flag - Language.Haskell.GhcMod.Gap - Language.Haskell.GhcMod.GhcPkg - Language.Haskell.GhcMod.HomeModuleGraph - Language.Haskell.GhcMod.Info - Language.Haskell.GhcMod.Lang - Language.Haskell.GhcMod.Lint - Language.Haskell.GhcMod.LightGhc - Language.Haskell.GhcMod.Logger - Language.Haskell.GhcMod.Logging - Language.Haskell.GhcMod.Modules - Language.Haskell.GhcMod.Monad - Language.Haskell.GhcMod.Monad.Types - Language.Haskell.GhcMod.Output - Language.Haskell.GhcMod.PathsAndFiles - Language.Haskell.GhcMod.PkgDoc - Language.Haskell.GhcMod.Pretty - Language.Haskell.GhcMod.Read - Language.Haskell.GhcMod.SrcUtils - Language.Haskell.GhcMod.Stack - Language.Haskell.GhcMod.Target - Language.Haskell.GhcMod.Types - Language.Haskell.GhcMod.Utils - Language.Haskell.GhcMod.World - Other-Modules: Paths_ghc_mod - Utils - Build-Depends: base < 5 && >= 4.0 - , bytestring < 0.11 - , cereal < 0.5 && >= 0.4 - , containers < 0.6 - , cabal-helper < 0.7 && >= 0.6.1.0 - , deepseq < 1.5 - , directory < 1.3 - , filepath < 1.5 - , ghc < 7.11 - , ghc-paths < 0.2 - , ghc-syb-utils < 0.3 - , hlint < 1.10 && >= 1.8.61 - , monad-journal < 0.8 && >= 0.4 - , old-time < 1.2 - , pretty < 1.2 - , process < 1.3 - , syb < 0.7 - , temporary < 1.3 - , time < 1.6 - , transformers < 0.5 - , transformers-base < 0.5 - , mtl < 2.3 && >= 2.0 - , monad-control < 1.1 && >= 1 - , split < 0.3 - , haskell-src-exts < 1.18 - , text < 1.3 - , djinn-ghc < 0.1 && >= 0.0.2.2 - , fclabels == 2.0.* - , extra == 1.4.* - , pipes == 4.1.* - if impl(ghc < 7.8) - Build-Depends: convertible - if impl(ghc < 7.5) - -- Only used to constrain random to a version that still works with GHC 7.4 - Build-Depends: random <= 1.0.1.1, - ghc-prim - -Executable ghc-mod - Default-Language: Haskell2010 - Main-Is: GHCMod.hs - Other-Modules: Paths_ghc_mod - GHC-Options: -Wall -fno-warn-deprecations -threaded - Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src - Build-Depends: base < 5 && >= 4.0 - , async < 2.1 - , directory < 1.3 - , filepath < 1.5 - , pretty < 1.2 - , process < 1.3 - , split < 0.3 - , mtl < 2.3 && >= 2.0 - , ghc < 7.11 - , fclabels == 2.0.* - , ghc-mod - -Executable ghc-modi - Default-Language: Haskell2010 - Main-Is: GHCModi.hs - Other-Modules: Paths_ghc_mod - Misc - Utils - GHC-Options: -Wall -threaded -fno-warn-deprecations - if os(windows) - Cpp-Options: -DWINDOWS - Default-Extensions: ConstraintKinds, FlexibleContexts - HS-Source-Dirs: src, . - Build-Depends: base < 5 && >= 4.0 - , directory < 1.3 - , filepath < 1.5 - , process < 1.3 - , old-time < 1.2 - , time < 1.6 - -Test-Suite doctest - Type: exitcode-stdio-1.0 - Default-Language: Haskell2010 - HS-Source-Dirs: test - Ghc-Options: -Wall - Default-Extensions: ConstraintKinds, FlexibleContexts - Main-Is: doctests.hs - if impl(ghc == 7.4.*) - Buildable: False - Build-Depends: base - , doctest < 0.11 && >= 0.9.3 - -Test-Suite spec - Default-Language: Haskell2010 - Default-Extensions: ScopedTypeVariables, RecordWildCards, NamedFieldPuns, - ConstraintKinds, FlexibleContexts, - DataKinds, KindSignatures, TypeOperators, ViewPatterns - Main-Is: Main.hs - Hs-Source-Dirs: test, . - Ghc-Options: -Wall -fno-warn-deprecations - CPP-Options: -DSPEC=1 - Type: exitcode-stdio-1.0 - Other-Modules: Paths_ghc_mod - Dir - Spec - TestUtils - BrowseSpec - CustomPackageDbSpec - CheckSpec - FlagSpec - InfoSpec - LangSpec - LintSpec - ListSpec - MonadSpec - PathsAndFilesSpec - HomeModuleGraphSpec - FileMappingSpec - - Build-Depends: hspec < 2.3 && >= 2.0.0 - if impl(ghc == 7.4.*) - Build-Depends: executable-path - X-Build-Depends-Like: CLibName - - - -Source-Repository head - Type: git - Location: https://github.com/kazu-yamamoto/ghc-mod.git \ No newline at end of file diff --git a/scripts/bounds.hs b/scripts/bounds.hs new file mode 100644 index 0000000..2af5d62 --- /dev/null +++ b/scripts/bounds.hs @@ -0,0 +1,117 @@ +{-# LANGUAGE LambdaCase #-} +import Control.Arrow +import Data.List +import Data.List.Split +import Data.Maybe +import Data.Function +import Data.Map (Map) +import qualified Data.Map as M +import System.Environment +import System.FilePath +import System.Directory + +import Distribution.Verbosity +import Distribution.PackageDescription.Parse (readPackageDescription) +import Distribution.PackageDescription.Configuration (flattenPackageDescription) +import Distribution.PackageDescription +import Distribution.Package +import Distribution.Version +import Distribution.Text +import Text.PrettyPrint +import System.Environment + + +datadir = "hackage-metadata" + +main = do + [pkg,v] <- getArgs + + let pkg_id = pkg ++ "-" ++ v + cabal_file = datadir pkg_id <.> "cabal" + + pkg_time <- getTime pkg v + + ps <- + mapMaybe (\case (p, "-any") -> Just p + _ -> Nothing) + + <$> getDeps cabal_file + vs <- mapM (getClosestVersion pkg_time) ps + print $ ps `zip` vs + return () + +check :: VersionRange -> Version -> Bool +check vr v = withinRange v vr + +getClosestVersion :: Integer -> String -> IO String +getClosestVersion pkg_time dep = do + vs <- getVersions dep + ts <- mapM (getTime dep) vs + let vtalist = sortBy (flip compare `on` snd) $ vs `zip` ts + ((v,_t):_) = filter (( IO [String] +getVersions p = do + fs <- listDirectory datadir + return $ nub + $ map snd + $ filter ((==p) . fst) + $ map (parsePkgId . dropExtension) + $ filter (p `isPrefixOf`) fs + +getTime :: String -> String -> IO Integer +getTime p v = do + let pkg_id = p ++ "-" ++ v + file = datadir pkg_id <.> "upload-date" + read <$> readFile file + +getDeps f = do + pd <- flattenPackageDescription <$> readPackageDescription silent f + return $ --nubBy ((==) `on` fst) $ + [ (unPackageName n, (render . disp) v) + | (Dependency n v) <- buildDepends pd + , not $ unPackageName n `elem` [ + "ghc-mod", + "ghc", + "array", + "base", + "bin-package-db", + "binary", + "bytestring", + "containers", + "deepseq", + "directory", + "filepath", + "ghc-binary", + "ghc-boot", + "ghc-boot-th", + "ghc-prim", + "ghci", + "haskelline", + "haskell2010", + "haskell98", + "haskell98", + "hoopl", + "hpc", + "integer-gmp", + "old-locale", + "old-time", + "pretty", + "process", + "random", + "rts", + "template-haskell", + "terminfo", + "time", + "transformers", + "unix", + "xhtml" + ] + ] + +parsePkgId pkg_id = let + v:pkgcs = reverse $ splitOn "-" pkg_id + in + (intercalate "-" $ reverse pkgcs, v) diff --git a/scripts/bump.sh b/scripts/bump.sh index 6b95d5e..07bc245 100755 --- a/scripts/bump.sh +++ b/scripts/bump.sh @@ -33,7 +33,7 @@ then fi git checkout release -#git merge master +#git merge release-VER branch into 'release' git merge -s recursive -X theirs release-$VERSION ( tac ChangeLog; echo "\n$(date '+%Y-%m-%d') v$VERSION" ) | tac \ @@ -46,4 +46,4 @@ emacs -q -nw ChangeLog git add ChangeLog git commit -m "ChangeLog" -git tag "v$VERSION" +git tag -f "v$VERSION" diff --git a/scripts/diff.hs b/scripts/diff.hs new file mode 100644 index 0000000..8619470 --- /dev/null +++ b/scripts/diff.hs @@ -0,0 +1,11 @@ +import Data.Tuple +import System.FilePath +import System.Environment +import System.Process + +main = do + vs <- lines <$> getContents + [pkg, dir] <- getArgs + mapM_ system $ map (\(v1, v2) -> "diff -u --color=always " ++ file pkg dir v1 ++ " " ++ file pkg dir v2 ++ "; echo; echo; echo") $ map swap $ drop 1 vs `zip` vs + where + file pkg dir v = dir (pkg ++ "-" ++ v) <.> "cabal" diff --git a/scripts/docker.sh b/scripts/docker.sh new file mode 100755 index 0000000..e04b513 --- /dev/null +++ b/scripts/docker.sh @@ -0,0 +1,84 @@ +#!/bin/sh + +namespace="registry.gitlab.com/dxld/ghc-mod" +target="$1" + +tmpdir=$(mktemp -p "${TMPDIR:-/tmp/}" -d ghc-mod-docker-XXXX) || exit 1 +trap 'rm -r '"$tmpdir" 0 2 15 + +while read ghc_rel ghc ghc_arch ghc_ext cabal image ghc_hash cabal_hash; do + [ -n "$target" -a x"$ghc_rel" != x"$target" ] && continue + + ghc_url="https://downloads.haskell.org/~ghc/${ghc_rel}/ghc-${ghc}-${ghc_arch}.tar.${ghc_ext}" + cabal_install_url="https://www.haskell.org/cabal/release/cabal-install-${cabal}/cabal-install-${cabal}.tar.gz" + + ADDITIONAL_COMMANDS="" + WGET_OPTIONS="" + + if [ x"$image" = x"debian:squeeze" ]; then + WGET_OPTIONS="--no-check-certificate" + GHC_VERIFY_COMMANDS="sha256sum -c ghc.sha256sum &&" + CABAL_VERIFY_COMMANDS="sha256sum -c cabal.sha256sum &&" + ADDITIONAL_PACKAGES=" libncursesw5" + ADDITIONAL_COMMANDS='COPY sources.list /etc/apt/ +COPY 10-no-check-valid-until /etc/apt/apt.conf.d/ +COPY *.sha256sum /root/ +' + + echo "$ghc_hash ghc-${ghc}-${ghc_arch}.tar.${ghc_ext}" \ + | cat > "$tmpdir"/ghc.sha256sum + echo "$cabal_hash cabal-install-${cabal}.tar.gz" \ + | cat > "$tmpdir"/cabal.sha256sum + + cat > "$tmpdir"/sources.list < "$tmpdir"/10-no-check-valid-until < "$tmpdir"/Dockerfile < readPackageDescription silent f + mapM_ putStrLn $ map (\(Dependency n v) -> unPackageName n ++ "\t" ++ render (disp v)) $ buildDepends pd diff --git a/scripts/extract-upload-date.sh b/scripts/extract-upload-date.sh new file mode 100755 index 0000000..936f969 --- /dev/null +++ b/scripts/extract-upload-date.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +PACKAGE=$1 +OUTDIR=$2 + +versions="$(wget -O - https://hackage.haskell.org/package/"$PACKAGE"/preferred.json | jq '(."normal-version" + ."deprecated-version")[]' -r)" + +mkdir -p "$OUTDIR" + +for v in $versions; do + date=$(wget -O - https://hackage.haskell.org/package/"$PACKAGE-$v" \ + | w3m -dump -T text/html \ + | grep Uploaded \ + | sed -r 's/^\s+Uploaded\s+(.*) by .*$/\1/') + + date --date="$date" '+%s' > "$OUTDIR"/"$PACKAGE-$v".upload-date +done diff --git a/scripts/upload-metadata.hs b/scripts/upload-metadata.hs index 84a89bf..2511984 100755 --- a/scripts/upload-metadata.hs +++ b/scripts/upload-metadata.hs @@ -25,30 +25,42 @@ set -e PACKAGE=$1 OUTDIR=$2 +VERSIONS="$@" read -p "Username: " user hidden_prompt "Password" pw +if [ -z "$VERSIONS" ]; then + VERSIONS="$(curl https://hackage.haskell.org/package/"$PACKAGE"/preferred.json | jq '."normal-version"[]' -r)" +#versions="$(curl https://hackage.haskell.org/package/"$PACKAGE"/preferred.json | jq '."deprecated-version"[]' -r)" +fi -versions="$(curl https://hackage.haskell.org/package/"$PACKAGE"/preferred.json | jq '."normal-version"[]' -r)" -for v in $versions; do + +echo "Versions: $VERSIONS" + +for v in $VERSIONS; do rev=$(cat $OUTDIR/$PACKAGE-$v.cabal | grep -i "^x-revision:" | tr -s '[:blank:]*' '\t' | cut -f 2) if [ -z "$rev" ]; then rev=0 fi + echo -n "$PACKAGE v$v rev:$rev..." + content=$( ( echo "X-Revision: $((rev + 1))"; cat $OUTDIR/$PACKAGE-$v.cabal | sed '/^X-Revision:/Id' ) ) - resp=$(curl --form-string "cabalfile=$content" -F "publish=Publish new revision" https://hackage.haskell.org/package/"${PACKAGE}-${v}"/"${PACKAGE}.cabal"/edit -u "$user:$pw") + resp=$(curl -s --form-string "cabalfile=$content" -F "publish=Publish new revision" https://hackage.haskell.org/package/"${PACKAGE}-${v}"/"${PACKAGE}.cabal"/edit -u "$user:$pw") changes=$(printf '%s\n' "$resp" | sed -n '/Changes in this revision/,/<\/ul>/p' | w3m -dump -T text/html) errors=$(printf '%s\n' "$resp" | sed -n '/Errors/,/<\/form>/p') - notpublished=$(printf '%s\n' "$resp" | grep "Cannot publish new revision") + if printf '%s\n' "$resp" | grep -q "Cannot publish new revision"; then + notpublished=1 + fi + printf 'Changes:\n%s\n' "$changes" if [ -z "$changes" -o -n "$notpublished" ]; then if printf '%s\n' "$errors" | grep -q "No changes"; then continue; diff --git a/System/Directory/ModTime.hs b/shared/System/Directory/ModTime.hs similarity index 97% rename from System/Directory/ModTime.hs rename to shared/System/Directory/ModTime.hs index 0e38eae..a9764de 100644 --- a/System/Directory/ModTime.hs +++ b/shared/System/Directory/ModTime.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015 Daniel Gröber -- -- This program is free software: you can redistribute it and/or modify diff --git a/Utils.hs b/shared/Utils.hs similarity index 100% rename from Utils.hs rename to shared/Utils.hs diff --git a/shelltest/ShellTest.hs b/shelltest/ShellTest.hs new file mode 100644 index 0000000..cbb4f79 --- /dev/null +++ b/shelltest/ShellTest.hs @@ -0,0 +1,23 @@ +#!/usr/bin/env runhaskell +-- ghc-mod: Happy Haskell Hacking +-- Copyright (C) 2017 Daniel Gröber +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU Affero General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU Affero General Public License for more details. +-- +-- You should have received a copy of the GNU Affero General Public License +-- along with this program. If not, see . + +module Main where + +import System.Exit +import System.Process + +main = exitWith =<< rawSystem "shelltest" [ "--execdir", "shelltest/" ] diff --git a/shelltest/browse.test b/shelltest/browse.test new file mode 100644 index 0000000..fb9409b --- /dev/null +++ b/shelltest/browse.test @@ -0,0 +1,11 @@ +cabal exec -- ghc-mod browse Data.Map +>>> /differenceWithKey/ +>>>= 0 + +cabal exec -- ghc-mod browse -d Data.Either +>>> /^either :: \(a -> c\) -> \(b -> c\) -> Either a b -> c$/ +>>>= 0 + +cabal exec -- ghc-mod browse -d Data.Either +>>> /^Left :: a -> Either a b$/ +>>>= 0 diff --git a/shelltest/browse/MyModule.hs b/shelltest/browse/MyModule.hs new file mode 100644 index 0000000..b2628eb --- /dev/null +++ b/shelltest/browse/MyModule.hs @@ -0,0 +1,11 @@ +module MyModule where + +data MyType = MyConstructor1 + | MyConstructor2 + +some_num = 0 +some_char = ' ' +some_string = "bar" + +($?>>/) :: Int -> Int -> Int +a $?>>/ b = a + b diff --git a/shelltest/browse/browse-project.testtpl b/shelltest/browse/browse-project.testtpl new file mode 100644 index 0000000..6026676 --- /dev/null +++ b/shelltest/browse/browse-project.testtpl @@ -0,0 +1,62 @@ + +cabal exec -- ghc-mod browse MyModule | sort +>>> +MyConstructor1 +MyConstructor2 +MyType +some_char +some_num +some_string +>>>= 0 + +cabal exec -- ghc-mod browse -q MyModule | sort +>>> +MyModule.MyConstructor1 +MyModule.MyConstructor2 +MyModule.MyType +MyModule.some_char +MyModule.some_num +MyModule.some_string +>>>= 0 + +cabal exec -- ghc-mod browse -d MyModule | sort +>>> +MyConstructor1 :: MyType +MyConstructor2 :: MyType +MyType :: data MyType +some_char :: Char +some_num :: Integer +some_string :: [Char] +>>>= 0 + +cabal exec -- ghc-mod browse -o MyModule | sort +>>> +($?>>/) +MyConstructor1 +MyConstructor2 +MyType +some_char +some_num +some_string +>>>= 0 + +cabal exec -- ghc-mod browse -p MyModule | sort +>>> +MyConstructor1 -- from:MyType +MyConstructor2 -- from:MyType +MyType +some_char +some_num +some_string +>>>= 0 + +cabal exec -- ghc-mod browse -odpq MyModule | sort +>>> +MyModule.($?>>/) :: Int -> Int -> Int +MyModule.MyConstructor1 :: MyType -- from:MyType +MyModule.MyConstructor2 :: MyType -- from:MyType +MyModule.MyType :: data MyType +MyModule.some_char :: Char +MyModule.some_num :: Integer +MyModule.some_string :: [Char] +>>>= 0 diff --git a/shelltest/browse/cabal/MyModule.hs b/shelltest/browse/cabal/MyModule.hs new file mode 120000 index 0000000..e0ba19a --- /dev/null +++ b/shelltest/browse/cabal/MyModule.hs @@ -0,0 +1 @@ +../MyModule.hs \ No newline at end of file diff --git a/shelltest/browse/cabal/browse-cabal.cabal b/shelltest/browse/cabal/browse-cabal.cabal new file mode 100644 index 0000000..f26aae4 --- /dev/null +++ b/shelltest/browse/cabal/browse-cabal.cabal @@ -0,0 +1,9 @@ +name: browse-cabal +version: 0 +build-type: Simple +cabal-version: >=1.2 + +library + hs-source-dirs: . + build-depends: base + exposed-modules: MyModule diff --git a/shelltest/browse/cabal/browse-cabal.test b/shelltest/browse/cabal/browse-cabal.test new file mode 120000 index 0000000..363e68b --- /dev/null +++ b/shelltest/browse/cabal/browse-cabal.test @@ -0,0 +1 @@ +../browse-project.testtpl \ No newline at end of file diff --git a/shelltest/browse/plain/MyModule.hs b/shelltest/browse/plain/MyModule.hs new file mode 120000 index 0000000..e0ba19a --- /dev/null +++ b/shelltest/browse/plain/MyModule.hs @@ -0,0 +1 @@ +../MyModule.hs \ No newline at end of file diff --git a/shelltest/browse/plain/browse-plain.test b/shelltest/browse/plain/browse-plain.test new file mode 100644 index 0000000..9a94a8a --- /dev/null +++ b/shelltest/browse/plain/browse-plain.test @@ -0,0 +1,4 @@ +# # TODO: make this work +# cabal exec -- ghc-mod browse MyModule +# >>> +# >>>= !0 diff --git a/shelltest/browse/sandbox/MyModule.hs b/shelltest/browse/sandbox/MyModule.hs new file mode 120000 index 0000000..e0ba19a --- /dev/null +++ b/shelltest/browse/sandbox/MyModule.hs @@ -0,0 +1 @@ +../MyModule.hs \ No newline at end of file diff --git a/shelltest/browse/sandbox/browse-sandbox.test b/shelltest/browse/sandbox/browse-sandbox.test new file mode 100644 index 0000000..9a94a8a --- /dev/null +++ b/shelltest/browse/sandbox/browse-sandbox.test @@ -0,0 +1,4 @@ +# # TODO: make this work +# cabal exec -- ghc-mod browse MyModule +# >>> +# >>>= !0 diff --git a/shelltest/browse/sandbox/test-setup.sh b/shelltest/browse/sandbox/test-setup.sh new file mode 100644 index 0000000..2721dd5 --- /dev/null +++ b/shelltest/browse/sandbox/test-setup.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +set -e + +rm cabal.sandbox.config +rm -r .cabal-sandbox + +cabal sandbox init diff --git a/shelltest/version.test b/shelltest/version.test new file mode 100644 index 0000000..04adc27 --- /dev/null +++ b/shelltest/version.test @@ -0,0 +1,7 @@ +cabal exec -- ghc-mod version +>>> /^ghc-mod version [0-9.]+ compiled by GHC [0-9.]+/ +>>>= 0 + +cabal exec -- ghc-mod --version +>>> /^ghc-mod version [0-9.]+ compiled by GHC [0-9.]+/ +>>>= 0 diff --git a/src/GHCMod/Options.hs b/src/GHCMod/Options.hs index c3cf263..8549fbd 100644 --- a/src/GHCMod/Options.hs +++ b/src/GHCMod/Options.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015 Nikolay Yakimov -- -- This program is free software: you can redistribute it and/or modify @@ -24,12 +24,13 @@ module GHCMod.Options ( import Options.Applicative import Options.Applicative.Types -import Language.Haskell.GhcMod.Types + import GHCMod.Options.Commands +import GHCMod.Options.ShellParse import GHCMod.Version import Language.Haskell.GhcMod.Options.DocUtils import Language.Haskell.GhcMod.Options.Options -import GHCMod.Options.ShellParse +import Language.Haskell.GhcMod.Types parseArgs :: IO (Options, GhcModCommands) parseArgs = @@ -37,7 +38,7 @@ parseArgs = where opts = info (argAndCmdSpec <**> helpVersion) $$ fullDesc - <=> header "ghc-mod: Happy Haskell Programming" + <=> header "ghc-mod: Happy Haskell Hacking" parseArgsInteractive :: String -> Either String GhcModCommands parseArgsInteractive args = @@ -69,4 +70,3 @@ helpVersion = argAndCmdSpec :: Parser (Options, GhcModCommands) argAndCmdSpec = (,) <$> globalArgSpec <*> commandsSpec - diff --git a/src/GHCMod/Options/Commands.hs b/src/GHCMod/Options/Commands.hs index 38c6c25..cc9f64f 100644 --- a/src/GHCMod/Options/Commands.hs +++ b/src/GHCMod/Options/Commands.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015 Nikolay Yakimov -- -- This program is free software: you can redistribute it and/or modify @@ -13,14 +13,12 @@ -- -- You should have received a copy of the GNU Affero General Public License -- along with this program. If not, see . -{-# LANGUAGE CPP, OverloadedStrings #-} +{-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-do-bind #-} module GHCMod.Options.Commands where -#if MIN_VERSION_optparse_applicative(0,13,0) import Data.Semigroup -#endif import Options.Applicative import Options.Applicative.Types import Options.Applicative.Builder.Internal @@ -158,7 +156,7 @@ commands = "f :: [a] -> a" "f [] = _body" "f (x:xs) = _body" - "(See https://github.com/kazu-yamamoto/ghc-mod/pull/274)" + "(See https://github.com/DanielG/ghc-mod/pull/274)" <> command "sig" $$ info sigArgSpec $$ progDesc "Generate initial code given a signature" @@ -168,7 +166,7 @@ commands = code "func :: [a] -> Maybe b -> (a -> b) -> (a,b)" "ghc-mod would add the following on the next line:" code "func x y z f = _func_body" - "(See: https://github.com/kazu-yamamoto/ghc-mod/pull/274)" + "(See: https://github.com/DanielG/ghc-mod/pull/274)" <> command "auto" $$ info autoArgSpec $$ progDesc "Try to automatically fill the contents of a hole" @@ -185,7 +183,7 @@ commands = "ghc-mod changes the code to get a value of type" \\ " `[a]', which results in:" code "filterNothing xs = filter _body_1 _body_2" - "(See also: https://github.com/kazu-yamamoto/ghc-mod/issues/311)" + "(See also: https://github.com/DanielG/ghc-mod/issues/311)" <> command "test" $$ info (CmdTest <$> strArg "FILE") $$ progDesc "" @@ -292,13 +290,8 @@ hsubparser' :: Mod CommandFields a -> Parser a hsubparser' m = mkParser d g rdr where Mod _ d g = m `mappend` metavar "" -#if MIN_VERSION_optparse_applicative(0,13,0) - (ms,cmds, subs) = mkCommand m + (ms, cmds, subs) = mkCommand m rdr = CmdReader ms cmds (fmap add_helper . subs) -#else - (cmds, subs) = mkCommand m - rdr = CmdReader cmds (fmap add_helper . subs) -#endif add_helper pinfo = pinfo { infoParser = infoParser pinfo <**> helper } diff --git a/src/GHCMod/Options/ShellParse.hs b/src/GHCMod/Options/ShellParse.hs index acd609b..6a74dc2 100644 --- a/src/GHCMod/Options/ShellParse.hs +++ b/src/GHCMod/Options/ShellParse.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015 Nikolay Yakimov -- -- This program is free software: you can redistribute it and/or modify diff --git a/src/GHCMod/Version.hs b/src/GHCMod/Version.hs index 2bf6db2..c151c04 100644 --- a/src/GHCMod/Version.hs +++ b/src/GHCMod/Version.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015 Nikolay Yakimov -- -- This program is free software: you can redistribute it and/or modify diff --git a/src/GHCMod.hs b/src/GHCModMain.hs similarity index 92% rename from src/GHCMod.hs rename to src/GHCModMain.hs index ed28d56..2e74b3d 100644 --- a/src/GHCMod.hs +++ b/src/GHCModMain.hs @@ -7,25 +7,22 @@ import Control.Monad import Data.Typeable (Typeable) import Data.List import Data.List.Split -import Exception -import Language.Haskell.GhcMod -import Language.Haskell.GhcMod.Internal hiding (MonadIO,liftIO) -import Language.Haskell.GhcMod.Types -import Language.Haskell.GhcMod.Monad -import Language.Haskell.GhcMod.Find (AsyncSymbolDb, newAsyncSymbolDb, getAsyncSymbolDb) +import Language.Haskell.GhcMod.Pretty import System.FilePath (()) import System.Directory (setCurrentDirectory, getAppUserDataDirectory, removeDirectoryRecursive) import System.IO import System.Exit -import Text.PrettyPrint hiding ((<>)) -import GHCMod.Options import Prelude -ghcModStyle :: Style -ghcModStyle = style { lineLength = 80, ribbonsPerLine = 1.2 } +import GHCMod.Options +import GhcMod +import GhcModExe.Find +import GhcModExe.Internal hiding (MonadIO,liftIO) +import Language.Haskell.GhcMod.Monad +import Language.Haskell.GhcMod.Types ----------------------------------------------------------------- +import Exception handler :: IOish m => GhcModT m a -> GhcModT m a handler = flip gcatches @@ -42,7 +39,7 @@ main = hSetEncoding stdin enc catches (progMain res) [ Handler $ \(e :: GhcModError) -> - runGmOutT globalOptions $ exitError $ renderStyle ghcModStyle (gmeDoc e) + runGmOutT globalOptions $ exitError $ renderGm (gmeDoc e) ] progMain :: (Options, GhcModCommands) -> IO () @@ -124,7 +121,7 @@ wrapGhcCommands opts cmd = Right _ -> return () Left ed -> - exitError $ renderStyle ghcModStyle (gmeDoc ed) + exitError $ renderGm (gmeDoc ed) loadMMappedFiles from (Just to) = loadMappedFile from to loadMMappedFiles from (Nothing) = do diff --git a/test/BrowseSpec.hs b/test/BrowseSpec.hs index e4bac0d..dfd320e 100644 --- a/test/BrowseSpec.hs +++ b/test/BrowseSpec.hs @@ -1,7 +1,7 @@ module BrowseSpec where import Control.Applicative -import Language.Haskell.GhcMod +import GhcMod import Test.Hspec import Prelude diff --git a/test/CaseSplitSpec.hs b/test/CaseSplitSpec.hs index 395b5c2..3daee1f 100644 --- a/test/CaseSplitSpec.hs +++ b/test/CaseSplitSpec.hs @@ -1,7 +1,7 @@ {-# LANGUAGE CPP #-} module CaseSplitSpec where -import Language.Haskell.GhcMod +import GhcMod import Test.Hspec import TestUtils import Dir diff --git a/test/CheckSpec.hs b/test/CheckSpec.hs index 9b1ea38..efe024c 100644 --- a/test/CheckSpec.hs +++ b/test/CheckSpec.hs @@ -1,7 +1,7 @@ {-# LANGUAGE CPP #-} module CheckSpec where -import Language.Haskell.GhcMod +import GhcMod import Data.List import System.Process diff --git a/test/FileMappingSpec.hs b/test/FileMappingSpec.hs index 47c2a83..5b50e6c 100644 --- a/test/FileMappingSpec.hs +++ b/test/FileMappingSpec.hs @@ -9,7 +9,7 @@ import Dir import System.IO.Temp import System.Directory -import Language.Haskell.GhcMod +import GhcMod spec :: Spec spec = do @@ -122,13 +122,13 @@ spec = do withDirectory_ "test/data/file-mapping" $ do res <- runD $ do loadMappedFile "File.hs" "File_Redir_Lint.hs" - lint defaultLintOpts "File.hs" + lint lintOpts "File.hs" res `shouldBe` "File.hs:4:1: Warning: Eta reduce\NULFound:\NUL func a b = (*) a b\NULWhy not:\NUL func = (*)\n" it "lints in-memory file if one is specified and outputs original filename" $ do withDirectory_ "test/data/file-mapping" $ do res <- runD $ do loadMappedFileSource "File.hs" "func a b = (++) a b\n" - lint defaultLintOpts "File.hs" + lint lintOpts "File.hs" res `shouldBe` "File.hs:1:1: Warning: Eta reduce\NULFound:\NUL func a b = (++) a b\NULWhy not:\NUL func = (++)\n" it "shows types of the expression for redirected files" $ do let tdir = "test/data/file-mapping" @@ -189,14 +189,14 @@ spec = do withDirectory_ "test/data/file-mapping/preprocessor" $ do res <- runD $ do loadMappedFile "File.hs" "File_Redir_Lint.hs" - lint defaultLintOpts "File.hs" + lint lintOpts "File.hs" res `shouldBe` "File.hs:6:1: Warning: Eta reduce\NULFound:\NUL func a b = (*) a b\NULWhy not:\NUL func = (*)\n" it "lints in-memory file if one is specified and outputs original filename" $ do withDirectory_ "test/data/file-mapping/preprocessor" $ do src <- readFile "File_Redir_Lint.hs" res <- runD $ do loadMappedFileSource "File.hs" src - lint defaultLintOpts "File.hs" + lint lintOpts "File.hs" res `shouldBe` "File.hs:6:1: Warning: Eta reduce\NULFound:\NUL func a b = (*) a b\NULWhy not:\NUL func = (*)\n" describe "literate haskell tests" $ do it "checks redirected file if one is specified and outputs original filename" $ do @@ -252,3 +252,8 @@ spec = do mapM_ (uncurry loadMappedFileSource) fm types False "Bar.hs" 5 1 res `shouldBe` unlines ["5 1 5 20 \"[Char]\""] + + +lintOpts :: LintOpts +lintOpts = + defaultLintOpts { optLintHlintOpts = ["--ignore=Use module export list"] } diff --git a/test/FindSpec.hs b/test/FindSpec.hs index 6f693aa..2ccf346 100644 --- a/test/FindSpec.hs +++ b/test/FindSpec.hs @@ -1,7 +1,7 @@ {-# LANGUAGE OverloadedStrings #-} module FindSpec where -import Language.Haskell.GhcMod.Find +import GhcModExe.Find import Test.Hspec import TestUtils diff --git a/test/FlagSpec.hs b/test/FlagSpec.hs index 60b624b..9d5f5a1 100644 --- a/test/FlagSpec.hs +++ b/test/FlagSpec.hs @@ -1,7 +1,7 @@ module FlagSpec where import Control.Applicative -import Language.Haskell.GhcMod +import GhcMod import Test.Hspec import TestUtils import Prelude diff --git a/test/HomeModuleGraphSpec.hs b/test/HomeModuleGraphSpec.hs index e8918cc..9e10987 100644 --- a/test/HomeModuleGraphSpec.hs +++ b/test/HomeModuleGraphSpec.hs @@ -1,4 +1,4 @@ --- ghc-mod: Making Haskell development *more* fun +-- ghc-mod: Happy Haskell Hacking -- Copyright (C) 2015 Daniel Gröber -- -- This program is free software: you can redistribute it and/or modify diff --git a/test/InfoSpec.hs b/test/InfoSpec.hs index de9f3e4..9f4b453 100644 --- a/test/InfoSpec.hs +++ b/test/InfoSpec.hs @@ -3,7 +3,7 @@ module InfoSpec where import Control.Applicative import Data.List (isPrefixOf) -import Language.Haskell.GhcMod +import GhcMod #if __GLASGOW_HASKELL__ < 706 import System.Environment.Executable (getExecutablePath) #else diff --git a/test/LangSpec.hs b/test/LangSpec.hs index 617ede5..5d6f119 100644 --- a/test/LangSpec.hs +++ b/test/LangSpec.hs @@ -1,7 +1,7 @@ module LangSpec where import Control.Applicative -import Language.Haskell.GhcMod +import GhcMod import Test.Hspec import TestUtils import Prelude diff --git a/test/LintSpec.hs b/test/LintSpec.hs index db668ae..b30055b 100644 --- a/test/LintSpec.hs +++ b/test/LintSpec.hs @@ -1,6 +1,6 @@ module LintSpec where -import Language.Haskell.GhcMod +import GhcMod import Test.Hspec import TestUtils @@ -8,10 +8,14 @@ spec :: Spec spec = do describe "lint" $ do it "can detect a redundant import" $ do - res <- runD $ lint defaultLintOpts "test/data/hlint/hlint.hs" + res <- runD $ lint lintOpts "test/data/hlint/hlint.hs" res `shouldBe` "test/data/hlint/hlint.hs:4:8: Warning: Redundant do\NULFound:\NUL do putStrLn \"Hello, world!\"\NULWhy not:\NUL putStrLn \"Hello, world!\"\n" context "when no suggestions are given" $ do it "doesn't output an empty line" $ do - res <- runD $ lint defaultLintOpts "test/data/ghc-mod-check/lib/Data/Foo.hs" + res <- runD $ lint lintOpts "test/data/ghc-mod-check/lib/Data/Foo.hs" res `shouldBe` "" + +lintOpts :: LintOpts +lintOpts = + defaultLintOpts { optLintHlintOpts = ["--ignore=Use module export list"] } diff --git a/test/ListSpec.hs b/test/ListSpec.hs index 166d3c2..775f1c1 100644 --- a/test/ListSpec.hs +++ b/test/ListSpec.hs @@ -1,7 +1,7 @@ module ListSpec where import Control.Applicative -import Language.Haskell.GhcMod +import GhcMod import Test.Hspec import TestUtils import Prelude diff --git a/test/Main.hs b/test/Main.hs index 2e9f558..4cce47f 100644 --- a/test/Main.hs +++ b/test/Main.hs @@ -1,58 +1,92 @@ {-# LANGUAGE CPP, ScopedTypeVariables #-} -import Spec import Dir import Control.Exception as E import Control.Monad (void) -import Data.List -import Language.Haskell.GhcMod (debugInfo) +import GhcMod (debugInfo) import System.Process +import System.Environment import Test.Hspec import TestUtils +import qualified BrowseSpec +import qualified CabalHelperSpec +import qualified CaseSplitSpec +import qualified CheckSpec +import qualified CradleSpec +import qualified CustomPackageDbSpec +import qualified FileMappingSpec +import qualified FindSpec +import qualified FlagSpec +import qualified GhcPkgSpec +import qualified HomeModuleGraphSpec +import qualified InfoSpec +import qualified LangSpec +import qualified LintSpec +import qualified ListSpec +import qualified MonadSpec +import qualified PathsAndFilesSpec +import qualified ShellParseSpec +import qualified TargetSpec + +spec :: Spec +spec = do + describe "Browse" BrowseSpec.spec + describe "CabalHelper" CabalHelperSpec.spec + describe "CaseSplit" CaseSplitSpec.spec + describe "Check" CheckSpec.spec + describe "Cradle" CradleSpec.spec + describe "CustomPackageDb" CustomPackageDbSpec.spec + describe "FileMapping" FileMappingSpec.spec + describe "Find" FindSpec.spec + describe "Flag" FlagSpec.spec + describe "GhcPkg" GhcPkgSpec.spec + describe "HomeModuleGraph" HomeModuleGraphSpec.spec + describe "Info" InfoSpec.spec + describe "Lang" LangSpec.spec + describe "Lint" LintSpec.spec + describe "List" ListSpec.spec + describe "Monad" MonadSpec.spec + describe "PathsAndFiles" PathsAndFilesSpec.spec + describe "ShellParse" ShellParseSpec.spec + describe "Target" TargetSpec.spec + main :: IO () main = do +#if __GLASGOW_HASKELL__ >= 708 + unsetEnv "GHC_PACKAGE_PATH" +#endif let sandboxes = [ "test/data/cabal-project" , "test/data/check-packageid" , "test/data/duplicate-pkgver/" , "test/data/broken-cabal/" ] genSandboxCfg dir = withDirectory dir $ \cwdir -> do - system ("sed 's|@CWD@|" ++ cwdir ++ "|g' cabal.sandbox.config.in > cabal.sandbox.config") + system ("rm cabal.sandbox.config; cabal sandbox init") pkgDirs = [ "test/data/cabal-project/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d" , "test/data/check-packageid/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d" , "test/data/duplicate-pkgver/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d"] genGhcPkgCache dir = system $ "ghc-pkg recache --force -f" ++ dir - genSandboxCfg `mapM_` sandboxes - genGhcPkgCache `mapM_` pkgDirs - - let caches = [ "setup-config" - , "setup-config.ghc-mod.cabal-helper" - , "setup-config.ghc-mod.cabal-components" - , "setup-config.ghc-mod.resolved-components" - , "setup-config.ghc-mod.package-options" - , "setup-config.ghc-mod.package-db-stack" - , "ghc-mod.cache" - ] - findExp = unwords $ intersperse "-o " $ concat [ - stackWorkFindExp, - cachesFindExp - ] - cachesFindExp = map ("-name "++) caches - stackWorkFindExp = ["-name .stack-work -type d"] - - cleanCmd = "find test \\( "++ findExp ++" \\) -exec rm -r {} \\;" - + let cleanCmd = "git clean -dXf test/data/" putStrLn $ "$ " ++ cleanCmd void $ system cleanCmd void $ system "cabal --version" void $ system "ghc --version" + genSandboxCfg `mapM_` sandboxes + genGhcPkgCache `mapM_` pkgDirs + let stackDir = "test/data/stack-project" void $ withDirectory_ stackDir $ do --- void $ system "stack init --force" + let ghcver = let gvn = show (__GLASGOW_HASKELL__ :: Int) + (major, minor') = splitAt (length gvn - 2) gvn + minor = case dropWhile (=='0') minor' of + "" -> "0" + x -> x + in major ++ "." ++ minor + void $ system $ "sed '$ a resolver: ghc-" ++ ghcver ++ "' stack.yaml.in > stack.yaml" void $ system "stack setup" void $ system "stack build" diff --git a/test/MonadSpec.hs b/test/MonadSpec.hs index 047f12e..1110e76 100644 --- a/test/MonadSpec.hs +++ b/test/MonadSpec.hs @@ -25,19 +25,6 @@ spec = do <- newEmptyMVar mv_startup_barrier :: MVar () <- newEmptyMVar - mv_startup_barrier :: MVar () <- newEmptyMVar - - _t1 <- forkOS $ do - putMVar mv_startup_barrier () - -- wait (inside GhcModT) for t2 to receive the exception - _ <- runD $ liftIO $ readMVar mv_ex - return () - - _t2 <- forkOS $ do - readMVar mv_startup_barrier -- wait for t1 to start up - res <- try $ runD $ return () - res' <- evaluate res - putMVar mv_ex res' _t1 <- forkOS $ do -- wait (inside GhcModT) for t2 to receive the exception diff --git a/test/Spec.hs b/test/Spec.hs deleted file mode 100644 index b4e92e7..0000000 --- a/test/Spec.hs +++ /dev/null @@ -1 +0,0 @@ -{-# OPTIONS_GHC -F -pgmF hspec-discover -optF --no-main #-} diff --git a/test/TargetSpec.hs b/test/TargetSpec.hs index fda45a2..f5ceef2 100644 --- a/test/TargetSpec.hs +++ b/test/TargetSpec.hs @@ -22,20 +22,20 @@ spec = do runLightGhc env (return ()) `shouldReturn` () it "has modules in scope" $ do - withLightHscEnv [] $ \env -> + (withLightHscEnv [] $ \env -> runLightGhc env $ do dflags <- getSessionDynFlags let i = intersect (listVisibleModuleNames dflags) ["Control.Applicative", "Control.Arrow" ,"Control.Exception", "GHC.Exts", "GHC.Float"] - liftIO $ i `shouldSatisfy` not . null + liftIO $ i `shouldSatisfy` not . null) :: IO () it "can get module info" $ do - withLightHscEnv [] $ \env -> + (withLightHscEnv [] $ \env -> runLightGhc env $ do mdl <- findModule "Data.List" Nothing mmi <- getModuleInfo mdl - liftIO $ isJust mmi `shouldBe` True + liftIO $ isJust mmi `shouldBe` True) :: IO () describe "resolveModule" $ do diff --git a/test/data/home-module-graph/errors/A1.hs b/test/data/home-module-graph/errors/A1.hs index 422e841..515d358 100644 --- a/test/data/home-module-graph/errors/A1.hs +++ b/test/data/home-module-graph/errors/A1.hs @@ -1,4 +1,4 @@ module A1 where -psogduapzsü9 +psogduapzs9 import B -lxäö,vLMCks +lx,vLMCks diff --git a/test/data/stack-project/stack.yaml b/test/data/stack-project/stack.yaml.in similarity index 68% rename from test/data/stack-project/stack.yaml rename to test/data/stack-project/stack.yaml.in index 6252712..170293a 100644 --- a/test/data/stack-project/stack.yaml +++ b/test/data/stack-project/stack.yaml.in @@ -2,4 +2,3 @@ flags: {} packages: - '.' extra-deps: [] -resolver: lts-2.17 diff --git a/test/doctests.hs b/test/doctests.hs index 6659d8c..a85e0ee 100644 --- a/test/doctests.hs +++ b/test/doctests.hs @@ -2,16 +2,22 @@ module Main where import Test.DocTest +import System.Environment +import Data.Maybe main :: IO () -main = doctest - [ "-package", "ghc-" ++ VERSION_ghc - , "-package", "transformers-" ++ VERSION_transformers - , "-package", "mtl-" ++ VERSION_mtl - , "-package", "directory-" ++ VERSION_directory - , "-XScopedTypeVariables", "-XRecordWildCards", "-XNamedFieldPuns", "-XConstraintKinds", "-XFlexibleContexts", "-XDataKinds", "-XKindSignatures", "-XTypeOperators", "-XViewPatterns" - , "-idist/build/autogen/" - , "-optP-include" - , "-optPdist/build/autogen/cabal_macros.h" - , "Language/Haskell/GhcMod.hs" - ] +main = do + distdir <- (fromMaybe "dist" . lookup "DOCTEST_DIST_DIR") `fmap` getEnvironment + doctest + [ "-package", "ghc-" ++ VERSION_ghc + , "-package", "transformers-" ++ VERSION_transformers + , "-package", "mtl-" ++ VERSION_mtl + , "-package", "directory-" ++ VERSION_directory + , "-XScopedTypeVariables", "-XRecordWildCards", "-XNamedFieldPuns", "-XConstraintKinds", "-XFlexibleContexts", "-XDataKinds", "-XKindSignatures", "-XTypeOperators", "-XViewPatterns" + , "-i" ++ distdir ++ "/build/autogen/" + , "-icore/" + , "-ishared" +-- , "-optP-include" +-- , "-optP" ++ distdir ++ "/build/autogen/cabal_macros.h" + , "GhcMod.hs" + ]