News for hackers. Stuff that matters.
Re:Are Monads a Waste of Time? by tathougies on Tuesday February 20, 2018 @05:35PM (#16424898)
But TardisT is sequenced in the monadic value. It is not sequenced in its inner backwards-traveling state, but that is not part of the monadic structure.

Have you used TardisT? In order to use the backwards traveling state, you need to bind the state syntactically before you use it, just as you have to do with the forwards traveling state.

For example, a typical setup for TardisT is fixing up jump offsets for an assembler. To write this, you do something like

    assembler (Label l) = do
       fixup <- getFuture
       (curOps, offset) <- getPast
       modifyBackwards (M.insert l offset)

       let ops = curOps ++ [ Jump (M.lookup l fixup) ]
       sendFuture (ops, offset + 1)
    assembler ... = ...
Note that both the forwards and backwards traveling state needed to be bound before they were used. There is an inherent 'forwards-traveling' sequencing due to the monadic structure.

If tardist were not monadically sequenced, you ought to be able to do

    assembler (Label l) = do
       (curOps, offset) <- getPast

       let ops = curOps ++ [ Jump (M.lookup l fixup) ]
       sendFuture (ops, offset + 1)

       fixup <- getFuture
       modifyBackwards (M.insert l offset)
In this sense, the forwards traveling state is privileged (and indeed if you write anything sufficiently complicated, you'll note that you'll need to add a lot of lazy pattern matches on the backwards traveling state, but not the forwards traveling one, again indicating a notion of sequencing, despite what it may seem).
Re:Are Monads a Waste of Time? by tome on Wednesday February 21, 2018 @02:40AM (#16427656)
Good explanation of Tardis, but would you really describe that as "forc[ing] sequencing by creating a data dependency"?
Re:Are Monads a Waste of Time? by tathougies on Wednesday February 21, 2018 @10:38AM (#16430181)
I would get rid of the forcing part, but I think my example shows it does cause a sequential dependency ?