Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
kim-em committed Nov 4, 2024
2 parents ae1c764 + d6ae727 commit 2adf619
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Qq/ForLean/ReduceEval.lean
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def throwFailedToEval (e : Expr) : MetaM α :=

private partial def evalList [ReduceEval α] (e : Expr) : MetaM (List α) := do
let e ← whnf e
let .const c _ ← pure e.getAppFn | throwFailedToEval e
let .const c _ := e.getAppFn | throwFailedToEval e
let nargs := e.getAppNumArgs
match c, nargs with
| ``List.nil, 1 => pure []
Expand All @@ -17,11 +17,11 @@ private partial def evalList [ReduceEval α] (e : Expr) : MetaM (List α) := do

instance [ReduceEval α] : ReduceEval (List α) := ⟨evalList⟩

instance : ReduceEval (Fin (n+1)) where
instance [NeZero n] : ReduceEval (Fin n) where
reduceEval := fun e => do
let e ← whnf e
if e.isAppOfArity ``Fin.mk 3 then
return Fin.ofNat (← reduceEval (e.getArg! 1))
return Fin.ofNat' _ (← reduceEval (e.getArg! 1))
else
throwFailedToEval e

Expand Down
2 changes: 1 addition & 1 deletion Qq/Macro.lean
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ partial def unquoteExpr (e : Expr) : UnquoteM Expr := do
}
return fv
let e ← whnf e
let .const c _ ← pure e.getAppFn | throwError "unquoteExpr: {e} : {eTy}"
let .const c _ := e.getAppFn | throwError "unquoteExpr: {e} : {eTy}"
let nargs := e.getAppNumArgs
match c, nargs with
| ``betaRev', 2 => return betaRev' (← unquoteExpr (e.getArg! 0)) (← unquoteExprList (e.getArg! 1))
Expand Down

0 comments on commit 2adf619

Please sign in to comment.