This PR changes the compiler's specialization analysis to consider higher-order params that are rebundled in a way that only changes their `Prop` arguments to be fixed. This means that they get specialized with a mere `@[specialize]`, rather than the compiler having to opt-in to more aggressive parameter-specific specialization.
10 lines
381 B
Text
10 lines
381 B
Text
/--
|
||
trace: [Compiler.specialize.info] pmap [true, true, false, true]
|
||
[Compiler.specialize.info] pmap [N, N, O, H]
|
||
-/
|
||
#guard_msgs in
|
||
set_option trace.Compiler.specialize.info true in
|
||
@[specialize]
|
||
def pmap : (l : List α) → (f : (a : α) → a ∈ l → β) → List β
|
||
| [], _ => []
|
||
| a :: l, f => f a List.mem_cons_self :: pmap l (fun a h => f a (List.mem_cons_of_mem _ h))
|