Skip to content

Commit 68ca4bc

Browse files
committed
Simplify SMC2 instances
1 parent 3c2cd6d commit 68ca4bc

File tree

1 file changed

+2
-8
lines changed
  • src/Control/Monad/Bayes/Inference

1 file changed

+2
-8
lines changed

src/Control/Monad/Bayes/Inference/SMC2.hs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module Control.Monad.Bayes.Inference.SMC2
2020
where
2121

2222
import Control.Monad.Bayes.Class
23-
( MonadDistribution (random),
23+
( MonadDistribution,
2424
MonadFactor (..),
2525
MonadMeasure,
2626
)
@@ -35,20 +35,14 @@ import Numeric.Log (Log)
3535

3636
-- | Helper monad transformer for preprocessing the model for 'smc2'.
3737
newtype SMC2 m a = SMC2 (Sequential (Traced (Population m)) a)
38-
deriving newtype (Functor, Applicative, Monad)
38+
deriving newtype (Functor, Applicative, Monad, MonadDistribution, MonadFactor)
3939

4040
setup :: SMC2 m a -> Sequential (Traced (Population m)) a
4141
setup (SMC2 m) = m
4242

4343
instance MonadTrans SMC2 where
4444
lift = SMC2 . lift . lift . lift
4545

46-
instance MonadDistribution m => MonadDistribution (SMC2 m) where
47-
random = lift random
48-
49-
instance Monad m => MonadFactor (SMC2 m) where
50-
score = SMC2 . score
51-
5246
instance MonadDistribution m => MonadMeasure (SMC2 m)
5347

5448
-- | Sequential Monte Carlo squared.

0 commit comments

Comments
 (0)