on master help sign in
Merge remote-tracking branch 'upstream/master' into improved-pretty-printing
7162b6eDominic Mulligan
CHANGELOG+2
@@ -6,11 +6,13 @@ User visible changes:
6* backtick notation added: x `foo` y ==> foo x y
6* backtick notation added: x `foo` y ==> foo x y
7* case expressions allowed in type signatures
7* case expressions allowed in type signatures
8* Library extensions in prelude.vect and prelude.algebra
8* Library extensions in prelude.vect and prelude.algebra
9+* malloc/trace_malloc added to builtins.idr
9
10
10Internal changes:
11Internal changes:
11
12
12* Some type class resolution fixes
13* Some type class resolution fixes
13* Several minor bug fixes
14* Several minor bug fixes
15+* Performance improvements in resolving overloading and type classes
14
16
15New in 0.9.1:
17New in 0.9.1:
16-------------
18-------------
idris.cabal+1−1
@@ -67,7 +67,7 @@ Executable idris
67
67
68 Build-depends: base>=4 && <5, parsec, mtl, Cabal, haskeline,
68 Build-depends: base>=4 && <5, parsec, mtl, Cabal, haskeline,
69 containers, process, transformers, filepath, directory,
69 containers, process, transformers, filepath, directory,
70− binary, bytestring, epic>=0.9.2.1
70+ binary, bytestring, epic>=0.9.3
71
71
72 Extensions: MultiParamTypeClasses, FunctionalDependencies,
72 Extensions: MultiParamTypeClasses, FunctionalDependencies,
73 FlexibleInstances, TemplateHaskell
73 FlexibleInstances, TemplateHaskell
lib/builtins.idr+6
@@ -21,6 +21,12 @@ sym refl = refl
21lazy : a -> a
21lazy : a -> a
22lazy x = x -- compiled specially
22lazy x = x -- compiled specially
23
23
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+
24believe_me : a -> b -- compiled specially as id, use with care!
30believe_me : a -> b -- compiled specially as id, use with care!
25believe_me x = prim__believe_me _ _ x
31believe_me x = prim__believe_me _ _ x
26
32
src/Idris/Compiler.hs+7
@@ -102,6 +102,13 @@ instance ToEpic (TT Name) where
102 = do v' <- epic' env v
102 = do v' <- epic' env v
103 k' <- epic' env k
103 k' <- epic' env k
104 return (k' @@ (effect_ v'))
104 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'
105 | (P (DCon t a) n _, args) <- unApply tm
112 | (P (DCon t a) n _, args) <- unApply tm
106 = epicCon env t a n args
113 = epicCon env t a n args
107 epic' env (P (DCon t a) n _) = return $ con_ t
114 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)
58testFac : Int
58testFac : Int
59testFac = interp [] fact 4
59testFac = interp [] fact 4
60
60
61−unitTestFac : so (interp [] fact 4 == 25)
61+unitTestFac : so (interp [] fact 4 == 24)
62unitTestFac = oh
62unitTestFac = oh
63
63
64main : IO ()
64main : IO ()