Hoogle Search

Within LTS Haskell 9.9 (ghc-8.0.2)

  1. goingBack :: MonadState (MFlowState view) m => m Bool

    MFlow MFlow.Forms

    True if the flow is going back (as a result of the back button pressed in the web browser). Usually this check is nos necessary unless conditional code make it necessary

    menu= do
    mop <- getGoStraighTo
    case mop of
    Just goop -> goop
    Nothing -> do
    r <- ask option1 <|> option2
    case r of
    op1 -> setGoStraighTo (Just goop1) >> goop1
    op2 -> setGoStraighTo (Just goop2) >> goop2
    
    This pseudocode below would execute the ask of the menu once. But the user will never have the possibility to see the menu again. To let him choose other option, the code has to be change to
    menu= do
    mop <- getGoStraighTo
    back <- goingBack
    case (mop,back) of
    (Just goop,False) -> goop
    _ -> do
    r <- ask option1 <|> option2
    case r of
    op1 -> setGoStraighTo (Just goop1) >> goop1
    op2 -> setGoStraighTo (Just goop2) >> goop2
    
    However this is very specialized. Normally the back button detection is not necessary. In a persistent flow (with step) even this default entry option would be completely automatic, since the process would restart at the last page visited.

  2. goingBack :: MonadState (MFlowState view) m => m Bool

    MFlow MFlow.Forms.Internals

    True if the flow is going back (as a result of the back button pressed in the web browser). Usually this check is nos necessary unless conditional code make it necessary

    menu= do
    mop <- getGoStraighTo
    case mop of
    Just goop -> goop
    Nothing -> do
    r <- ask option1 <|> option2
    case r of
    op1 -> setGoStraighTo (Just goop1) >> goop1
    op2 -> setGoStraighTo (Just goop2) >> goop2
    
    This pseudocode below would execute the ask of the menu once. But the user will never have the possibility to see the menu again. To let him choose other option, the code has to be change to
    menu= do
    mop <- getGoStraighTo
    back <- goingBack
    case (mop,back) of
    (Just goop,False) -> goop
    _ -> do
    r <- ask option1 <|> option2
    case r of
    op1 -> setGoStraighTo (Just goop1) >> goop1
    op2 -> setGoStraighTo (Just goop2) >> goop2
    
    However this is very specialized. Normally the back button detection is not necessary. In a persistent flow (with step) even this default entry option would be completely automatic, since the process would restart at the last page visited.

  3. preventGoingBack :: (Functor m, MonadIO m, FormInput v) => FlowM v m () -> FlowM v m ()

    MFlow MFlow.Forms

    Will prevent the Suprack beyond the point where preventGoingBack is located. If the user press the back button beyond that point, the flow parameter is executed, usually it is an ask statement with a message. If the flow is not going back, it does nothing. It is a cut in Supracking It is useful when an undoable transaction has been commited. For example, after a payment. This example show a message when the user go back and press again to pay

    ask $ wlink () << b << "press here to pay 100000 $ "
    payIt
    preventGoingBack . ask $   b << "You  paid 10000 $ one time"
    ++> wlink () << b << " Please press here to complete the proccess"
    ask $ wlink () << b << "OK, press here to go to the menu or press the back button to verify that you can not pay again"
    where
    payIt= liftIO $ print "paying"
    

  4. preventGoingBack :: (Functor m, MonadIO m, FormInput v) => FlowM v m () -> FlowM v m ()

    MFlow MFlow.Forms.Internals

    Will prevent the Suprack beyond the point where preventGoingBack is located. If the user press the back button beyond that point, the flow parameter is executed, usually it is an ask statement with a message. If the flow is not going back, it does nothing. It is a cut in Supracking It is useful when an undoable transaction has been commited. For example, after a payment. This example show a message when the user go back and press again to pay

    ask $ wlink () << b << "press here to pay 100000 $ "
    payIt
    preventGoingBack . ask $   b << "You  paid 10000 $ one time"
    ++> wlink () << b << " Please press here to complete the proccess"
    ask $ wlink () << b << "OK, press here to go to the menu or press the back button to verify that you can not pay again"
    where
    payIt= liftIO $ print "paying"
    

Page 1 of 1