Created
May 28, 2020 12:24
-
-
Save turion/ad1dc77f53b0729929403c3313f3810c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data ProbT m a where | |
ProbT :: m [(Double, a)] -> ProbT m a -- sum double = 1 | |
| GaussianDist | |
:: Double -- | Mean | |
-> Double -- | Width | |
-> ProbT m Double | |
| ... | |
return a = [(1, a)] | |
-- Real system | |
system :: MSF IO cmd sense | |
-- Simulation | |
sim :: Monad m => MSF (ProbT m) cmd (sense, state) | |
bayesFilter :: MSF (ProbT IO) cmd state | |
bayesFilter = proc cmd -> do | |
realSense <- liftTransS system -< cmd | |
(simSense, state) <- sim -< cmd | |
arrM guard -< simSense == realSense | |
returnA -< state | |
data ContT m r a = ContT ((a -> m r) -> m r) | |
data LogicT m r a = LogicT ((a -> m r -> m r) -> m r -> m r) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment