haskell - The reverse state monad in OCaml -


How do you implement in OCaml ? (Since it relies heavily on laziness, I think someone has to use lazy modules from the standard library).

I put one.

This is a bit difficult:

  type 'sl =' s Lazy.t type ('A, s) 'S - & gt; ('A') SL (Bond) (MX: ('A' s) St.) (F: ('A - A' (B, S) St.)) (S: SL): ('B') * 'SL ) = (* Conceptually, we want that RE (lazy (y, s' ')) = lazy (mx)' and (lazy (z, s')) = lazy (fis) (js in force, s' '), But that is not legal, so we take away the lazy couple types (' A * '), and we freely prepare pieces that we need. *) Remember' lazy ' MX (Alcittels) ( Vaccines (Force) () (lazy force (lazy force), as I mentioned in the comment, it is somewhat difficult that you do not want to accidentally apply the state calculation too soon. Unfortunately for getting mutual recursive rights, if you are forced to temporarily slip the answer to the calculation (which are moving) then the basic rule of thumb is as follows:  
    < Li> What do you do
  1. .t Lazy.t - & gt; 'A shame. not be:
      let's join xll = lazy. The force xll will start the external problem very quickly because instead it should be:  
      Let's feel like grab, but in reality , Xll = lazy (lazy force (lazy force xll))   

    All calculations are delayed correctly.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -