Skip to content

Commit 8ace872

Browse files
committed
io-sim-por: added haddocks & notes
1 parent 362fa0e commit 8ace872

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

io-sim/src/Control/Monad/IOSim/Types.hs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,8 +745,17 @@ data StmStack s b a where
745745
---
746746

747747
data ScheduleControl = ControlDefault
748+
-- ^ default scheduling mode
748749
| ControlAwait [ScheduleMod]
750+
-- ^ if the current control is 'ControlAwait', the normal
751+
-- scheduling will proceed, until the thread found in the
752+
-- first 'ScheduleMod' reaches the given step. At this
753+
-- point the thread is put to sleep, until after all the
754+
-- steps are followed.
749755
| ControlFollow [StepId] [ScheduleMod]
756+
-- ^ follow the steps then continue with schedule
757+
-- modifications. This control is set by 'followControl'
758+
-- when 'controlTargets' returns true.
750759
deriving (Eq, Ord, Show)
751760

752761
data ScheduleMod = ScheduleMod{

io-sim/src/Control/Monad/IOSimPOR/Internal.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1577,7 +1577,11 @@ extendScheduleControl' (ControlAwait mods) m =
15771577
if isUndo
15781578
then ControlAwait mods -- reject this mod... it's undoing a previous one
15791579
else ControlAwait (take common mods++[m''])
1580-
extendScheduleControl' ControlFollow{} ScheduleMod{} = error "Impossible: extendScheduleControl' ControlFollow{} ScheduleMod{}"
1580+
extendScheduleControl' ControlFollow{} ScheduleMod{} =
1581+
-- note: this case is impossible, since `extendScheduleControl'` first
1582+
-- argument is either the initial `ControlDefault` or a result of calling
1583+
-- `extendScheduleControl'` itself.
1584+
error "Impossible: extendScheduleControl' ControlFollow{} ScheduleMod{}"
15811585

15821586
extendScheduleControl :: ScheduleControl -> ScheduleMod -> ScheduleControl
15831587
extendScheduleControl control m =

0 commit comments

Comments
 (0)