on master help sign in
Merge remote-tracking branch 'upstream/master' into improved-pretty-printing
commit7162b6e48343e92fb9ee718a34671930176553c6 authorDominic Mulligan <dominic.p.mulligan@googlemail.com> dateTue 28 Feb 2012, 10:24 (15 years ago) parent42dcbabf355c72
5 files changed+17−2
CHANGELOG+2 idris.cabal+1−1 lib/builtins.idr+6 src/Idris/Compiler.hs+7 tutorial/examples/interp.idr+1−1
CHANGELOG+2
@@ -6,11 +6,13 @@ User visible changes:
66* backtick notation added: x `foo` y ==> foo x y
77* case expressions allowed in type signatures
88* Library extensions in prelude.vect and prelude.algebra
9+* malloc/trace_malloc added to builtins.idr
910
1011Internal changes:
1112
1213* Some type class resolution fixes
1314* Several minor bug fixes
15+* Performance improvements in resolving overloading and type classes
1416
1517New in 0.9.1:
1618-------------
idris.cabal+1−1
@@ -67,7 +67,7 @@ Executable idris
6767
6868 Build-depends: base>=4 && <5, parsec, mtl, Cabal, haskeline,
6969 containers, process, transformers, filepath, directory,
70− binary, bytestring, epic>=0.9.2.1
70+ binary, bytestring, epic>=0.9.3
7171
7272 Extensions: MultiParamTypeClasses, FunctionalDependencies,
7373 FlexibleInstances, TemplateHaskell
lib/builtins.idr+6
@@ -21,6 +21,12 @@ sym refl = refl
2121lazy : a -> a
2222lazy x = x -- compiled specially
2323
24+malloc : Int -> a -> a
25+malloc size x = x -- compiled specially
26+
27+trace_malloc : a -> a
28+trace_malloc x = x -- compiled specially
29+
2430believe_me : a -> b -- compiled specially as id, use with care!
2531believe_me x = prim__believe_me _ _ x
2632
src/Idris/Compiler.hs+7
@@ -102,6 +102,13 @@ instance ToEpic (TT Name) where
102102 = do v' <- epic' env v
103103 k' <- epic' env k
104104 return (k' @@ (effect_ v'))
105+ | (P _ (UN "malloc") _, [_,size,t]) <- unApply tm
106+ = do size' <- epic' env size
107+ t' <- epic' env t
108+ return $ malloc_ size' t'
109+ | (P _ (UN "trace_malloc") _, [_,t]) <- unApply tm
110+ = do t' <- epic' env t
111+ return $ mallocTrace_ t'
105112 | (P (DCon t a) n _, args) <- unApply tm
106113 = epicCon env t a n args
107114 epic' env (P (DCon t a) n _) = return $ con_ t
tutorial/examples/interp.idr+1−1
@@ -58,7 +58,7 @@ using (G : Vect Ty n)
5858testFac : Int
5959testFac = interp [] fact 4
6060
61−unitTestFac : so (interp [] fact 4 == 25)
61+unitTestFac : so (interp [] fact 4 == 24)
6262unitTestFac = oh
6363
6464main : IO ()