Hacker News new | ask | show | jobs
by jrockway 5285 days ago
Reading this a day later, there were a couple brainos in there. First, the second argument to step2 should be of type OneResult rather than Arg. Secondly, there is no need for return at the end of my_program, since step1 and step2 are both "in Reader":

    my_program = do
        x <- step1 42
        step2 x
or my_program = step2 =<< step1 42

(I use =<< instead of >>= so that nonadic composition reads like normal composition (.).)

Anyway, then do:

    runReader my_program config