on develop help sign in
Fix infinite loop in Reflex Profiled

The Reflex Profiled transformer had an incorrect definition for Reflex.Class.mergeIncrementalG and Reflex.Class.mergeIncrementalWithMoveG. Instead of calling the transformed inner Reflex timeline, it called itself, leading to an infinite recursion. This is fixed by coercing the type before running mergeIncremental*. This was introduced in 8d8ceecd548f3d4f6e0b8db00a57659511d241a5, and effects Reflex v0.6.2.1, v0.6.2.2, v0.6.2.3, v0.6.2.4, v0.6.3, and v0.6.4.

commit85edd63dfdca1224d4b11cda331228b6f4fd06fc authorMatthew Bauer <mjbauer95@gmail.com> dateTue 4 Feb 2020, 14:01 (7 years ago) parentfc801a8
1 file changed+2−2
src/Reflex/Profiled.hs+2−2
src/Reflex/Profiled.hs+2−2
@@ -147,8 +147,8 @@ instance Reflex t => Reflex (ProfiledTimeline t) where
147147 updated (Dynamic_Profiled d) = coerce $ profileEvent $ updated d
148148 unsafeBuildDynamic (ProfiledM a0) (Event_Profiled a') = coerce $ unsafeBuildDynamic a0 a'
149149 unsafeBuildIncremental (ProfiledM a0) (Event_Profiled a') = coerce $ unsafeBuildIncremental a0 a'
150− mergeIncrementalG nt = (Event_Profiled . coerce) #. mergeIncrementalG nt
151− mergeIncrementalWithMoveG nt = (Event_Profiled . coerce) #. mergeIncrementalWithMoveG nt
150+ mergeIncrementalG nt res = Event_Profiled $ mergeIncrementalG (coerce nt) (coerce res)
151+ mergeIncrementalWithMoveG nt res = Event_Profiled $ mergeIncrementalWithMoveG (coerce nt) (coerce res)
152152 currentIncremental (Incremental_Profiled i) = coerce $ currentIncremental i
153153 updatedIncremental (Incremental_Profiled i) = coerce $ profileEvent $ updatedIncremental i
154154 incrementalToDynamic (Incremental_Profiled i) = coerce $ incrementalToDynamic i