on master help sign in
Merge remote-tracking branch 'upstream/master'
b1a5da4Dominic Mulligan
CHANGELOG+1
@@ -4,6 +4,7 @@ New in 0.9.2:
4User visible changes:
4User visible changes:
5
5
6* case expressions allowed in type signatures
6* case expressions allowed in type signatures
7+* Library extensions in prelude.vect and prelude.algebra
7
8
8Internal changes:
9Internal changes:
9
10
Setup.hs+40−29
@@ -1,42 +1,53 @@
1import Distribution.Simple
1import Distribution.Simple
2import Distribution.Simple.InstallDirs as I
2import Distribution.Simple.InstallDirs as I
3import Distribution.Simple.LocalBuildInfo as L
3import Distribution.Simple.LocalBuildInfo as L
4+import qualified Distribution.Simple.Setup as S
5+import qualified Distribution.Simple.Program as P
4import Distribution.PackageDescription
6import Distribution.PackageDescription
5
7
6import System.Exit
8import System.Exit
9+import System.FilePath ((</>))
7import System.Process
10import System.Process
8
11
9-- After Idris is built, we need to check and install the prelude and other libs
12-- After Idris is built, we need to check and install the prelude and other libs
10
13
11−system' cmd = do
14+make verbosity = P.runProgramInvocation verbosity . P.simpleProgramInvocation "make"
12− exit <- system cmd
15+
13− case exit of
16+cleanStdLib verbosity
14− ExitSuccess -> return ()
15− ExitFailure _ -> exitWith exit
16−
17−postCleanLib args flags desc _
18− = system' "make -C lib clean"
17+ = make verbosity [ "-C", "lib", "clean" ]
19−
20−addPrefix pfx var c = "export " ++ var ++ "=" ++ show pfx ++ "/" ++ c ++ ":$" ++ var
21−
22−postInstLib args flags desc local
23− = do let pkg = localPkgDescr local
24− let penv = packageTemplateEnv (package pkg)
25− let cenv = compilerTemplateEnv (compilerId (compiler local))
26− let dirs_pkg = substituteInstallDirTemplates penv (installDirTemplates local)
27− let dirs = substituteInstallDirTemplates cenv dirs_pkg
28− let bind = fromPathTemplate (bindir dirs)
29− let progPart t = L.substPathTemplate (packageId desc) local (t local)
30− let progpfx = progPart progPrefix
31− let progsfx = progPart progSuffix
32− let PackageName pkgname = (packageName desc)
33− let icmd = bind ++ "/" ++ progpfx ++ pkgname ++ progsfx
34− let idir = fromPathTemplate (datadir dirs) ++ "/" ++
35− fromPathTemplate (datasubdir dirs)
36− putStrLn $ "Installing libraries in " ++ idir
37− system' $ "make -C lib install TARGET=" ++ idir ++ " IDRIS=" ++ icmd
38
18
19+installStdLib pkg local verbosity copy
20+ = do let dirs = L.absoluteInstallDirs pkg local copy
21+ let idir = datadir dirs
22+ let icmd = ".." </> buildDir local </> "idris" </> "idris"
23+ putStrLn $ "Installing libraries in " ++ idir
24+ make verbosity
25+ [ "-C", "lib", "install"
26+ , "TARGET=" ++ idir
27+ , "IDRIS=" ++ icmd
28+ ]
29+
30+checkStdLib local verbosity
31+ = do let icmd = ".." </> buildDir local </> "idris" </> "idris"
32+ putStrLn $ "Building libraries..."
33+ make verbosity
34+ [ "-C", "lib", "check"
35+ , "IDRIS=" ++ icmd
36+ ]
37+
38+-- Install libraries during both copy and install
39+-- See http://hackage.haskell.org/trac/hackage/ticket/718
39−main = defaultMainWithHooks (simpleUserHooks { postInst = postInstLib,
40+main = defaultMainWithHooks $ simpleUserHooks
41+ { postCopy = \ _ flags pkg lbi -> do
42+ installStdLib pkg lbi (S.fromFlag $ S.copyVerbosity flags)
43+ (S.fromFlag $ S.copyDest flags)
44+ , postInst = \ _ flags pkg lbi -> do
45+ installStdLib pkg lbi (S.fromFlag $ S.installVerbosity flags)
46+ NoCopyDest
40− postClean = postCleanLib })
47+ , postClean = \ _ flags _ _ -> do
48+ cleanStdLib (S.fromFlag $ S.cleanVerbosity flags)
49+ , postBuild = \ _ flags _ lbi -> do
50+ checkStdLib lbi (S.fromFlag $ S.buildVerbosity flags)
51+ }
41
52
42
53
impl-paper/compiling.texnew file+2
@@ -0,0 +1,2 @@
1+\section{Compiling}
2+
impl-paper/intro.tex+2
@@ -20,3 +20,5 @@ about making the language itself practical.
20\item What's the difference between a theorem prover and a practical systems programming
20\item What's the difference between a theorem prover and a practical systems programming
21 language? Not much...
21 language? Not much...
22\end{itemize}
22\end{itemize}
23+
24+Also note --- to be an expert user of a language requires good understanding of the internals.
src/Idris/Parser.hs+1−1
@@ -926,7 +926,7 @@ pConstant = do reserved "Integer";return BIType
926 <|> do reserved "String"; return StrType
926 <|> do reserved "String"; return StrType
927 <|> do reserved "Ptr"; return PtrType
927 <|> do reserved "Ptr"; return PtrType
928 <|> try (do f <- float; return $ Fl f)
928 <|> try (do f <- float; return $ Fl f)
929− <|> try (do i <- natural; lchar 'L'; return $ BI i)
929+-- <|> try (do i <- natural; lchar 'L'; return $ BI i)
930 <|> try (do i <- natural; return $ I (fromInteger i))
930 <|> try (do i <- natural; return $ I (fromInteger i))
931 <|> try (do s <- strlit; return $ Str s)
931 <|> try (do s <- strlit; return $ Str s)
932 <|> try (do c <- chlit; return $ Ch c)
932 <|> try (do c <- chlit; return $ Ch c)