Skip to content

Question: Free density monad vs. state density monad #263

Open
@turion

Description

In the docs we describe two density monads (https://github.com/tweag/monad-bayes/blob/master/docs/docs/usage.md#density):

Monad-bayes offers two implementations, in Control.Monad.Bayes.Density.State and Control.Monad.Bayes.Density.Free. The first is slow but easy to understand, the second is more sophisticated, but faster.

In the code we have both variants, but only the free density monad (supposedly faster) is used outside this part:

mhTrans :: MonadDistribution m => (Weighted (State.Density m)) a -> Trace a -> m (Trace a)

@reubenharry @idontgetoutmuch Is it fair to say that realistically, we will only ever use the free density monad, and the state density monad is only for didactic purposes? If so, I'd vote for removing the corresponding code and simplifying the leftovers, and keep the state density only in the docs, which would be slightly adapted.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions