You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The specialization optimization in Core assumes that all type variables come first.
This assumption is not true, e.g., for for and rfor here:
instance
foldableRangeI {N} {{Ord N}} {{Natural N}} : Foldable (Range N) N :=
mkFoldable@{
for {B : Type} (f : B -> N -> B) (ini : B) : Range N -> B
| (mkRange low high step) :=
let
{-# specialize-by: [f] #-}
terminating
go (acc : B) (next : N) : B :=
if
| next > high := acc
| else := go (f acc next) (next + step);
in go ini low;
rfor {B : Type} (g : B -> N -> B) (ini : B) : Range N -> B
| (mkRange low high step) :=
let
{-# specialize-by: [g] #-}
terminating
go (base : B) (next : N) : B :=
if
| next <= high := g (go base (next + step)) next
| else := base;
in go ini low
};
The text was updated successfully, but these errors were encountered:
lukaszcz
changed the title
Various parts of the pipeline assume that all type variables are at the front
Specialization optimization assumes that all type variables are at the front
Aug 8, 2024
The specialization optimization in Core assumes that all type variables come first.
This assumption is not true, e.g., for
for
andrfor
here:The text was updated successfully, but these errors were encountered: