Home>

You can see the functions named run ○, app ○, get ○○ in the function that seems to take the value as it is (mainly newtype field name), but there are some differences and they are divided Is not it?
If Identity, Kleisli, etc., run is used, Endo is app, and Any, All is get.
I often see others.
Comonad extract is used in a similar way, but it would be easier if it could be shared like this ...
In short, if the form f a->a, it can be extracted. Identity is Comonad.
What does this run mean in the first place? I don't know that the identity is run.
I don't know what the app stands for. Isn't it apply?

  • Answer # 1

    Hello.
    It's not a well-founded answer, but I will write what I think.

    I think that certain data types (usually those that are Monad) are often marked with runOO.
    Perhaps it was recognized that Monad was a huge function that was built with functor synthesis and used the name "run" to expand when it "runs" .
    I thinkStateis the most obvious example, but it is defined asState sa = s->(a, s)andrunState

    let myState =? :: State s a
    let (result, finalState) = runState myState initialState
    Because it is written as

    , it looks just like "executing" State.

    Any,Allis a data type as Monoid, so it can be regarded as having a single synthesized "value", so when retrieving it Expects to beget.

    Endois a data type that is composed of countless combinations of endomorphism, so the contents are "functions". It seems natural to useapplyto "apply" this to the initial value.

    I'm sorry for the unfounded story, but personally, it seems to be determined by the above atmosphere and customs.