Not signed in (Sign In)

Not signed in

Want to take part in these discussions? Sign in if you have an account, or apply for one below

  • Sign in using OpenID

Discussion Tag Cloud

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

Welcome to nForum
If you want to take part in these discussions either sign in now (if you have an account), apply for one now (if you don't).
    • CommentRowNumber1.
    • CommentAuthorUrs
    • CommentTimeFeb 12th 2014

    started a bare minimum at state monad

    • CommentRowNumber2.
    • CommentAuthoranqurvanillapy
    • CommentTimeMar 11th 2019

    Removed ’state monad’ in related concepts since it is unnecessary.

    diff, v7, current

    • CommentRowNumber3.
    • CommentAuthorUrs
    • CommentTimeOct 29th 2022
    • (edited Oct 29th 2022)

    added references:

    and in the generality of the local state monad:

    diff, v8, current

    • CommentRowNumber4.
    • CommentAuthorUrs
    • CommentTimeOct 29th 2022
    • (edited Oct 29th 2022)

    In the Idea-section, after the first occurrence of “mutable state”, I have added the following parenthetical:

    (e.g. the state of a “random access memory” device, cf. Yates (2019), p. 26 & Fig. 1.10)

    pointing to:

    diff, v9, current

    • CommentRowNumber5.
    • CommentAuthorUrs
    • CommentTimeNov 8th 2022

    A question:

    It should be possible to consider the state monad with respect to any strong monad \mathcal{E}, assigning

    State:D[Σ,(Σ)D] \mathcal{E}State \;\colon\; D \;\mapsto\; \big[ \Sigma ,\, \mathcal{E}(\Sigma) \otimes D \big]

    and with μ State\mu^{\mathcal{E}State} defined using \mathcal{E}-Kleisli compositon.

    Is this discussed anywhere?

    (I have a vague memory that I have seen this mentioned, but now I can’t find it.)

    • CommentRowNumber6.
    • CommentAuthorUrs
    • CommentTimeAug 4th 2023

    added (here) a more vivid illustration of the structure of a state-effectful program

    diff, v15, current

    • CommentRowNumber7.
    • CommentAuthorvarkor
    • CommentTimeAug 4th 2023

    Re #5. Perhaps this is related to the fact that every strong monad distributes over the reader monad (e.g. 1 or 2)?

    • CommentRowNumber8.
    • CommentAuthorUrs
    • CommentTimeAug 4th 2023

    Thanks, that’s useful.

    (Now I just need to remember what I wanted to do with this… :-/)

    • CommentRowNumber9.
    • CommentAuthorvarkor
    • CommentTimeAug 4th 2023

    Whoops, I had misread and thought the last two posts were recent…

    • CommentRowNumber10.
    • CommentAuthorUrs
    • CommentTimeAug 10th 2023

    added pointer to:

    diff, v16, current

    • CommentRowNumber11.
    • CommentAuthorUrs
    • CommentTimeAug 11th 2023

    added pointer (here and elsewhere) to Moggi’s Example 1.1

    diff, v17, current

    • CommentRowNumber12.
    • CommentAuthorUrs
    • CommentTimeAug 13th 2023

    added pointer to:

    diff, v18, current

    • CommentRowNumber13.
    • CommentAuthorUrs
    • CommentTimeAug 25th 2023
    • (edited Aug 25th 2023)

    Stateful endofunctions are the same as Mealy machines whose input-alphabet coincides with the output-alphabet.

    This is clear from inspection, and I see it is clear to programmers, such as at github.com/orakaro/MonadicMealyMachine. But I haven’t yet found a reference which would talk about this more explicitly.

    • CommentRowNumber14.
    • CommentAuthorUrs
    • CommentTimeAug 25th 2023

    added a pointer (here) to a new paragraph at Mealy machine

    diff, v20, current

    • CommentRowNumber15.
    • CommentAuthorUrs
    • CommentTimeAug 28th 2023

    I have spelled out (here) how to encode “read”- and “write”-operations for the state monad, and how from these all other stateful maps are obtained with Kleisli-composition/do-notation (essentially the example indicated in Benton, Hughes & Moggi 2002 p. 68 & 71).

    diff, v23, current