mirror of
https://github.com/edwinb/Idris2-boot.git
synced 2024-12-29 15:52:29 +03:00
Merge branch 'master' of https://github.com/edwinb/Idris2 into better-ide-mode
This commit is contained in:
commit
c385a2a9cc
@ -44,11 +44,18 @@ insertImpLam {vars} env tm (Just ty) = bindLam tm ty
|
||||
bindLamTm : RawImp -> Term vs -> Core (Maybe RawImp)
|
||||
bindLamTm tm@(ILam _ _ Implicit _ _ _) (Bind fc n (Pi _ Implicit _) sc)
|
||||
= pure (Just tm)
|
||||
bindLamTm tm@(ILam _ _ AutoImplicit _ _ _) (Bind fc n (Pi _ AutoImplicit _) sc)
|
||||
= pure (Just tm)
|
||||
bindLamTm tm (Bind fc n (Pi c Implicit ty) sc)
|
||||
= do n' <- genVarName (nameRoot n)
|
||||
Just sc' <- bindLamTm tm sc
|
||||
| Nothing => pure Nothing
|
||||
pure $ Just (ILam fc c Implicit (Just n') (Implicit fc False) sc')
|
||||
bindLamTm tm (Bind fc n (Pi c AutoImplicit ty) sc)
|
||||
= do n' <- genVarName (nameRoot n)
|
||||
Just sc' <- bindLamTm tm sc
|
||||
| Nothing => pure Nothing
|
||||
pure $ Just (ILam fc c AutoImplicit (Just n') (Implicit fc False) sc')
|
||||
bindLamTm tm exp
|
||||
= case getFn exp of
|
||||
Ref _ Func _ => pure Nothing -- might still be implicit
|
||||
@ -59,12 +66,20 @@ insertImpLam {vars} env tm (Just ty) = bindLam tm ty
|
||||
bindLamNF : RawImp -> NF vars -> Core RawImp
|
||||
bindLamNF tm@(ILam _ _ Implicit _ _ _) (NBind fc n (Pi _ Implicit _) sc)
|
||||
= pure tm
|
||||
bindLamNF tm@(ILam _ _ AutoImplicit _ _ _) (NBind fc n (Pi _ AutoImplicit _) sc)
|
||||
= pure tm
|
||||
bindLamNF tm (NBind fc n (Pi c Implicit ty) sc)
|
||||
= do defs <- get Ctxt
|
||||
n' <- genVarName (nameRoot n)
|
||||
sctm <- sc defs (toClosure defaultOpts env (Ref fc Bound n'))
|
||||
sc' <- bindLamNF tm sctm
|
||||
pure $ ILam fc c Implicit (Just n') (Implicit fc False) sc'
|
||||
bindLamNF tm (NBind fc n (Pi c AutoImplicit ty) sc)
|
||||
= do defs <- get Ctxt
|
||||
n' <- genVarName (nameRoot n)
|
||||
sctm <- sc defs (toClosure defaultOpts env (Ref fc Bound n'))
|
||||
sc' <- bindLamNF tm sctm
|
||||
pure $ ILam fc c AutoImplicit (Just n') (Implicit fc False) sc'
|
||||
bindLamNF tm sc = pure tm
|
||||
|
||||
bindLam : RawImp -> Glued vars -> Core RawImp
|
||||
|
Loading…
Reference in New Issue
Block a user