Commit a62ea2ef authored by Alexis Williams's avatar Alexis Williams

Default to Haskell2010

parent e7bbeafa
...@@ -82,7 +82,7 @@ import qualified Distribution.SPDX.License as SPDX ...@@ -82,7 +82,7 @@ import qualified Distribution.SPDX.License as SPDX
import Distribution.Solver.Types.SourcePackage as SP import Distribution.Solver.Types.SourcePackage as SP
( SourcePackage(..) ) ( SourcePackage(..) )
import Distribution.Types.BuildInfo import Distribution.Types.BuildInfo
( BuildInfo(targetBuildDepends) ) ( BuildInfo(..) )
import Distribution.Types.CondTree import Distribution.Types.CondTree
( CondTree(..) ) ( CondTree(..) )
import Distribution.Types.Executable import Distribution.Types.Executable
...@@ -95,6 +95,8 @@ import Distribution.Types.PackageId ...@@ -95,6 +95,8 @@ import Distribution.Types.PackageId
( PackageIdentifier(..) ) ( PackageIdentifier(..) )
import Distribution.Types.Version import Distribution.Types.Version
( mkVersion, version0 ) ( mkVersion, version0 )
import Language.Haskell.Extension
( Language(..) )
import qualified Data.ByteString.Char8 as BS import qualified Data.ByteString.Char8 as BS
import qualified Data.Map as Map import qualified Data.Map as Map
...@@ -347,12 +349,18 @@ handleScriptCase verbosity baseCtx tempDir scriptContents = do ...@@ -347,12 +349,18 @@ handleScriptCase verbosity baseCtx tempDir scriptContents = do
} }
genericPackageDescription = emptyGenericPackageDescription genericPackageDescription = emptyGenericPackageDescription
{ GPD.packageDescription = packageDescription { GPD.packageDescription = packageDescription
, condExecutables = [("script", CondNode executable' exeDeps [])] , condExecutables = [("script", CondNode executable' targetBuildDepends [])]
} }
executable' = executable executable' = executable
{ modulePath = "Main.hs" { modulePath = "Main.hs"
, buildInfo = binfo
{ defaultLanguage =
case defaultLanguage of
just@(Just _) -> just
Nothing -> Just Haskell2010
}
} }
exeDeps = targetBuildDepends (buildInfo executable') binfo@BuildInfo{..} = buildInfo executable
packageDescription = emptyPackageDescription packageDescription = emptyPackageDescription
{ package = pkgId { package = pkgId
, specVersionRaw = Left (mkVersion [2, 2]) , specVersionRaw = Left (mkVersion [2, 2])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment