Skip to content

Commit

Permalink
Fix infinite loop in Reflex Profiled
Browse files Browse the repository at this point in the history
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 8d8ceec, 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.
  • Loading branch information
matthewbauer committed Feb 4, 2020
1 parent fc801a8 commit 85edd63
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Reflex/Profiled.hs
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ instance Reflex t => Reflex (ProfiledTimeline t) where
updated (Dynamic_Profiled d) = coerce $ profileEvent $ updated d
unsafeBuildDynamic (ProfiledM a0) (Event_Profiled a') = coerce $ unsafeBuildDynamic a0 a'
unsafeBuildIncremental (ProfiledM a0) (Event_Profiled a') = coerce $ unsafeBuildIncremental a0 a'
mergeIncrementalG nt = (Event_Profiled . coerce) #. mergeIncrementalG nt
mergeIncrementalWithMoveG nt = (Event_Profiled . coerce) #. mergeIncrementalWithMoveG nt
mergeIncrementalG nt res = Event_Profiled $ mergeIncrementalG (coerce nt) (coerce res)
mergeIncrementalWithMoveG nt res = Event_Profiled $ mergeIncrementalWithMoveG (coerce nt) (coerce res)
currentIncremental (Incremental_Profiled i) = coerce $ currentIncremental i
updatedIncremental (Incremental_Profiled i) = coerce $ profileEvent $ updatedIncremental i
incrementalToDynamic (Incremental_Profiled i) = coerce $ incrementalToDynamic i
Expand Down

0 comments on commit 85edd63

Please # to comment.