on master help sign in
Make sure all patterns are top level
c3f827fEdwin Brady
libs/prelude/IO.idr+4−2
@@ -50,8 +50,10 @@ applyEnv : (env : FEnv ffi xs) ->
50applyEnv [] f = f
50applyEnv [] f = f
51applyEnv (x@(_, _) :: xs) f = applyEnv xs (f x)
51applyEnv (x@(_, _) :: xs) f = applyEnv xs (f x)
52
52
53+mkForeignPrim : {xs : _} -> {ffi : _} -> {env : FEnv ffi xs} -> {t : Type} ->
53−mkForeignPrim : ForeignPrimType xs env t
54+ ForeignPrimType xs env t
54−-- compiled as primitive
55+-- compiled as primitive. Compiler assumes argument order, so make it
56+-- explicit here.
55
57
56%inline
58%inline
57foreign_prim : (f : FFI) ->
59foreign_prim : (f : FFI) ->
src/Idris/ElabTerm.hs+4−4
@@ -119,9 +119,9 @@ build ist info emode opts fn tm
119 if inf then return ()
119 if inf then return ()
120 else lift (Error e)
120 else lift (Error e)
121
121
122− when tydecl (do update_term orderPats
122+ when tydecl (do mkPat
123− mkPat)
124−-- update_term liftPats)
123+ update_term liftPats
124+ update_term orderPats)
125 EState is _ impls <- getAux
125 EState is _ impls <- getAux
126 tt <- get_term
126 tt <- get_term
127 let (tm, ds) = runState (collectDeferred (Just fn) tt) []
127 let (tm, ds) = runState (collectDeferred (Just fn) tt) []
@@ -475,7 +475,7 @@ elab ist info emode opts fn tm
475 _ -> True
475 _ -> True
476 -- this is to stop us resolve type classes recursively
476 -- this is to stop us resolve type classes recursively
477 -- trace (show (n, guarded)) $
477 -- trace (show (n, guarded)) $
478− if (tcname n && ina) then erun fc $ do patvar n; -- update_term liftPats
478+ if (tcname n && ina) then erun fc $ do patvar n; update_term liftPats
479 else if (defined && not guarded)
479 else if (defined && not guarded)
480 then do apply (Var n) []; solve
480 then do apply (Var n) []; solve
481 else try (do apply (Var n) []; solve)
481 else try (do apply (Var n) []; solve)