on master help sign in
Merge remote-tracking branch 'upstream/master'
commitb1a5da4f07f183ee25256732d33e51798e6c0b2a authorDominic Mulligan <dominic.p.mulligan@googlemail.com> dateTue 21 Feb 2012, 10:27 (15 years ago) parentb2653137e75ead
5 files changed+46−30
CHANGELOG+1 Setup.hs+40−29 impl-paper/compiling.tex+2 impl-paper/intro.tex+2 src/Idris/Parser.hs+1−1
CHANGELOG+1
@@ -4,6 +4,7 @@ New in 0.9.2:
44User visible changes:
55
66* case expressions allowed in type signatures
7+* Library extensions in prelude.vect and prelude.algebra
78
89Internal changes:
910
Setup.hs+40−29
@@ -1,42 +1,53 @@
11import Distribution.Simple
22import Distribution.Simple.InstallDirs as I
33import Distribution.Simple.LocalBuildInfo as L
4+import qualified Distribution.Simple.Setup as S
5+import qualified Distribution.Simple.Program as P
46import Distribution.PackageDescription
57
68import System.Exit
9+import System.FilePath ((</>))
710import System.Process
811
912-- After Idris is built, we need to check and install the prelude and other libs
1013
11−system' cmd = do
12− exit <- system cmd
13− case exit of
14− ExitSuccess -> return ()
15− ExitFailure _ -> exitWith exit
16−
17−postCleanLib args flags desc _
18− = system' "make -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
14+make verbosity = P.runProgramInvocation verbosity . P.simpleProgramInvocation "make"
15+
16+cleanStdLib verbosity
17+ = make verbosity [ "-C", "lib", "clean" ]
3818
39−main = defaultMainWithHooks (simpleUserHooks { postInst = postInstLib,
40− postClean = postCleanLib })
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
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
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+ }
4152
4253
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.
2020\item What's the difference between a theorem prover and a practical systems programming
2121 language? Not much...
2222\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
926926 <|> do reserved "String"; return StrType
927927 <|> do reserved "Ptr"; return PtrType
928928 <|> 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)
930930 <|> try (do i <- natural; return $ I (fromInteger i))
931931 <|> try (do s <- strlit; return $ Str s)
932932 <|> try (do c <- chlit; return $ Ch c)