0 | module Control.Monad.Sample.Definition
 1 |
 2 | import Data.Fin
 3 |
 4 | import Data.Container.Base
 5 | import Data.Tensor
 6 | import Control.Monad.Distribution
 7 |
 8 | ||| Interface for sampling from a distribution
 9 | ||| Sampling is a costate/server for distributions
10 | ||| We require that there is at least one element in the distribution
11 | ||| We also require that we can fold over the elements, i.e. that positions 
12 | ||| are finite and have an order
13 | ||| TODO add temperature as a implicit parameter with a default value of 1.0
14 | public export
15 | interface Monad m => MonadSample m where
16 |   sample : {a : Axis} ->
17 |     (isNonEmpt : IsNonEmpty a.cont) =>
18 |     (isFoldable : IsFoldable a.cont) =>
19 |     Costate (m <!> Dist a)