rhine 0.5.0.1 → 0.5.1.0
raw patch · 25 files changed
+174/−50 lines, 25 filesdep +MonadRandomdep +randomdep ~basedep ~containersdep ~dunaiPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies added: MonadRandom, random
Dependency ranges changed: base, containers, dunai, vector-sized
API changes (from Hackage documentation)
- FRP.Rhine: MSF :: a -> m (b, MSF m a b) -> MSF a b
- FRP.Rhine: [unMSF] :: MSF a b -> a -> m (b, MSF m a b)
- FRP.Rhine: arrM_ :: Monad m => m b -> MSF m a b
- FRP.Rhine: delay :: Monad m => a -> MSF m a a
- FRP.Rhine: insert :: Monad m => MSF m m a a
- FRP.Rhine: liftMSFBase :: (Monad m2, MonadBase m1 m2) => MSF m1 a b -> MSF m2 a b
- FRP.Rhine: liftMSFPurer :: (Monad m2, Monad m1) => forall c. () => m1 c -> m2 c -> MSF m1 a b -> MSF m2 a b
- FRP.Rhine: liftMSFTrans :: (MonadTrans t, Monad m, Monad t m) => MSF m a b -> MSF t m a b
- FRP.Rhine: liftS :: (Monad m2, MonadBase m1 m2) => a -> m1 b -> MSF m2 a b
- FRP.Rhine: mapMSF :: Monad m => MSF m a b -> MSF m [a] [b]
- FRP.Rhine: switch :: Monad m => MSF m a (b, Maybe c) -> c -> MSF m a b -> MSF m a b
- FRP.Rhine.ClSF.Core: MSF :: a -> m (b, MSF m a b) -> MSF a b
- FRP.Rhine.ClSF.Core: [unMSF] :: MSF a b -> a -> m (b, MSF m a b)
- FRP.Rhine.ClSF.Core: arrM_ :: Monad m => m b -> MSF m a b
- FRP.Rhine.ClSF.Core: delay :: Monad m => a -> MSF m a a
- FRP.Rhine.ClSF.Core: insert :: Monad m => MSF m m a a
- FRP.Rhine.ClSF.Core: liftMSFBase :: (Monad m2, MonadBase m1 m2) => MSF m1 a b -> MSF m2 a b
- FRP.Rhine.ClSF.Core: liftMSFPurer :: (Monad m2, Monad m1) => forall c. () => m1 c -> m2 c -> MSF m1 a b -> MSF m2 a b
- FRP.Rhine.ClSF.Core: liftMSFTrans :: (MonadTrans t, Monad m, Monad t m) => MSF m a b -> MSF t m a b
- FRP.Rhine.ClSF.Core: liftS :: (Monad m2, MonadBase m1 m2) => a -> m1 b -> MSF m2 a b
- FRP.Rhine.ClSF.Core: mapMSF :: Monad m => MSF m a b -> MSF m [a] [b]
- FRP.Rhine.ClSF.Core: switch :: Monad m => MSF m a (b, Maybe c) -> c -> MSF m a b -> MSF m a b
- FRP.Rhine.Clock: MSF :: a -> m (b, MSF m a b) -> MSF a b
- FRP.Rhine.Clock: [unMSF] :: MSF a b -> a -> m (b, MSF m a b)
- FRP.Rhine.Clock: arrM_ :: Monad m => m b -> MSF m a b
- FRP.Rhine.Clock: delay :: Monad m => a -> MSF m a a
- FRP.Rhine.Clock: insert :: Monad m => MSF m m a a
- FRP.Rhine.Clock: liftMSFBase :: (Monad m2, MonadBase m1 m2) => MSF m1 a b -> MSF m2 a b
- FRP.Rhine.Clock: liftMSFPurer :: (Monad m2, Monad m1) => forall c. () => m1 c -> m2 c -> MSF m1 a b -> MSF m2 a b
- FRP.Rhine.Clock: liftMSFTrans :: (MonadTrans t, Monad m, Monad t m) => MSF m a b -> MSF t m a b
- FRP.Rhine.Clock: liftS :: (Monad m2, MonadBase m1 m2) => a -> m1 b -> MSF m2 a b
- FRP.Rhine.Clock: mapMSF :: Monad m => MSF m a b -> MSF m [a] [b]
- FRP.Rhine.Clock: switch :: Monad m => MSF m a (b, Maybe c) -> c -> MSF m a b -> MSF m a b
+ FRP.Rhine: -- a realtime promise was met, if an event occurred, if one of its
+ FRP.Rhine: -- subclocks (if any) ticked.
+ FRP.Rhine: -- | Additional information that the clock may output at each tick, e.g. if
+ FRP.Rhine: FractionalVectorSpace :: a -> FractionalVectorSpace a
+ FRP.Rhine: [getFractional] :: FractionalVectorSpace a -> a
+ FRP.Rhine: break3Tuple :: () => (a, b, c) -> ((a, b), c)
+ FRP.Rhine: break4Tuple :: () => (a, b, c, d) -> ((a, b), (c, d))
+ FRP.Rhine: break5Tuple :: () => (a, b, c, d, e) -> ((a, b), (c, d, e))
+ FRP.Rhine: constM :: Monad m => m b -> MSF m a b
+ FRP.Rhine: evalRandIOS :: Monad m => ClSF (RandT StdGen m) cl a b -> IO (ClSF m cl a b)
+ FRP.Rhine: evalRandIOS' :: MonadIO m => ClSF (RandT StdGen m) cl a b -> ClSF m cl a b
+ FRP.Rhine: evalRandS :: (RandomGen g, Monad m) => ClSF (RandT g m) cl a b -> g -> ClSF m cl a b
+ FRP.Rhine: execRandS :: (RandomGen g, Monad m) => ClSF (RandT g m) cl a b -> g -> ClSF m cl a g
+ FRP.Rhine: getRandomRS :: (MonadRandom m, Random a) => BehaviourF m time (a, a) a
+ FRP.Rhine: getRandomRS_ :: (MonadRandom m, Random a) => (a, a) -> Behaviour m time a
+ FRP.Rhine: getRandomS :: (MonadRandom m, Random a) => Behaviour m time a
+ FRP.Rhine: getRandomsRS :: (MonadRandom m, Random b) => (b, b) -> MSF m a [b]
+ FRP.Rhine: getRandomsRS_ :: (MonadRandom m, Random b) => MSF m (b, b) [b]
+ FRP.Rhine: getRandomsS :: (MonadRandom m, Random b) => MSF m a [b]
+ FRP.Rhine: infix 6 `dot`
+ FRP.Rhine: infixl 5 ^-^
+ FRP.Rhine: infixr 2 +++
+ FRP.Rhine: infixr 3 &&&
+ FRP.Rhine: infixr 5 <+>
+ FRP.Rhine: join3Tuple :: () => ((a, b), c) -> (a, b, c)
+ FRP.Rhine: join4Tuple :: () => ((a, b), (c, d)) -> (a, b, c, d)
+ FRP.Rhine: join5Tuple :: () => ((a, b), (c, d, e)) -> (a, b, c, d, e)
+ FRP.Rhine: liftBaseM :: (Monad m2, MonadBase m1 m2) => (a -> m1 b) -> MSF m2 a b
+ FRP.Rhine: liftBaseS :: (Monad m2, MonadBase m1 m2) => MSF m1 a b -> MSF m2 a b
+ FRP.Rhine: liftTransS :: (MonadTrans t, Monad m, Monad (t m)) => MSF m a b -> MSF (t m) a b
+ FRP.Rhine: mealy :: Monad m => (a -> s -> (b, s)) -> s -> MSF m a b
+ FRP.Rhine: morphGS :: Monad m2 => (forall c. () => (a1 -> m1 (b1, c)) -> a2 -> m2 (b2, c)) -> MSF m1 a1 b1 -> MSF m2 a2 b2
+ FRP.Rhine: morphS :: (Monad m2, Monad m1) => (forall c. () => m1 c -> m2 c) -> MSF m1 a b -> MSF m2 a b
+ FRP.Rhine: newtype FractionalVectorSpace a
+ FRP.Rhine: normalize :: (Eq (Groundfield v), NormedSpace v) => v -> v
+ FRP.Rhine: runRandS :: (RandomGen g, Monad m) => ClSF (RandT g m) cl a b -> g -> ClSF m cl a (g, b)
+ FRP.Rhine: type Groundfield v = Groundring v
+ FRP.Rhine.ClSF.Core: -- a realtime promise was met, if an event occurred, if one of its
+ FRP.Rhine.ClSF.Core: -- subclocks (if any) ticked.
+ FRP.Rhine.ClSF.Core: -- | Additional information that the clock may output at each tick, e.g. if
+ FRP.Rhine.ClSF.Core: constM :: Monad m => m b -> MSF m a b
+ FRP.Rhine.ClSF.Core: infixr 2 +++
+ FRP.Rhine.ClSF.Core: infixr 3 &&&
+ FRP.Rhine.ClSF.Core: infixr 5 <+>
+ FRP.Rhine.ClSF.Core: liftBaseM :: (Monad m2, MonadBase m1 m2) => (a -> m1 b) -> MSF m2 a b
+ FRP.Rhine.ClSF.Core: liftBaseS :: (Monad m2, MonadBase m1 m2) => MSF m1 a b -> MSF m2 a b
+ FRP.Rhine.ClSF.Core: liftTransS :: (MonadTrans t, Monad m, Monad (t m)) => MSF m a b -> MSF (t m) a b
+ FRP.Rhine.ClSF.Core: mealy :: Monad m => (a -> s -> (b, s)) -> s -> MSF m a b
+ FRP.Rhine.ClSF.Core: morphGS :: Monad m2 => (forall c. () => (a1 -> m1 (b1, c)) -> a2 -> m2 (b2, c)) -> MSF m1 a1 b1 -> MSF m2 a2 b2
+ FRP.Rhine.ClSF.Core: morphS :: (Monad m2, Monad m1) => (forall c. () => m1 c -> m2 c) -> MSF m1 a b -> MSF m2 a b
+ FRP.Rhine.ClSF.Random: evalRandIOS :: Monad m => ClSF (RandT StdGen m) cl a b -> IO (ClSF m cl a b)
+ FRP.Rhine.ClSF.Random: evalRandIOS' :: MonadIO m => ClSF (RandT StdGen m) cl a b -> ClSF m cl a b
+ FRP.Rhine.ClSF.Random: evalRandS :: (RandomGen g, Monad m) => ClSF (RandT g m) cl a b -> g -> ClSF m cl a b
+ FRP.Rhine.ClSF.Random: execRandS :: (RandomGen g, Monad m) => ClSF (RandT g m) cl a b -> g -> ClSF m cl a g
+ FRP.Rhine.ClSF.Random: getRandomRS :: (MonadRandom m, Random a) => BehaviourF m time (a, a) a
+ FRP.Rhine.ClSF.Random: getRandomRS_ :: (MonadRandom m, Random a) => (a, a) -> Behaviour m time a
+ FRP.Rhine.ClSF.Random: getRandomS :: (MonadRandom m, Random a) => Behaviour m time a
+ FRP.Rhine.ClSF.Random: getRandomsRS :: (MonadRandom m, Random b) => (b, b) -> MSF m a [b]
+ FRP.Rhine.ClSF.Random: getRandomsRS_ :: (MonadRandom m, Random b) => MSF m (b, b) [b]
+ FRP.Rhine.ClSF.Random: getRandomsS :: (MonadRandom m, Random b) => MSF m a [b]
+ FRP.Rhine.ClSF.Random: runRandS :: (RandomGen g, Monad m) => ClSF (RandT g m) cl a b -> g -> ClSF m cl a (g, b)
+ FRP.Rhine.Clock: -- a realtime promise was met, if an event occurred, if one of its
+ FRP.Rhine.Clock: -- subclocks (if any) ticked.
+ FRP.Rhine.Clock: -- | Additional information that the clock may output at each tick, e.g. if
+ FRP.Rhine.Clock: constM :: Monad m => m b -> MSF m a b
+ FRP.Rhine.Clock: infixr 2 +++
+ FRP.Rhine.Clock: infixr 3 &&&
+ FRP.Rhine.Clock: infixr 5 <+>
+ FRP.Rhine.Clock: liftBaseM :: (Monad m2, MonadBase m1 m2) => (a -> m1 b) -> MSF m2 a b
+ FRP.Rhine.Clock: liftBaseS :: (Monad m2, MonadBase m1 m2) => MSF m1 a b -> MSF m2 a b
+ FRP.Rhine.Clock: liftTransS :: (MonadTrans t, Monad m, Monad (t m)) => MSF m a b -> MSF (t m) a b
+ FRP.Rhine.Clock: mealy :: Monad m => (a -> s -> (b, s)) -> s -> MSF m a b
+ FRP.Rhine.Clock: morphGS :: Monad m2 => (forall c. () => (a1 -> m1 (b1, c)) -> a2 -> m2 (b2, c)) -> MSF m1 a1 b1 -> MSF m2 a2 b2
+ FRP.Rhine.Clock: morphS :: (Monad m2, Monad m1) => (forall c. () => m1 c -> m2 c) -> MSF m1 a b -> MSF m2 a b
+ FRP.Rhine.Schedule: type family Out cl
- FRP.Rhine: (+++) :: ArrowChoice a => a b c -> a b' c' -> a Either b b' Either c c'
+ FRP.Rhine: (+++) :: ArrowChoice a => a b c -> a b' c' -> a (Either b b') (Either c c')
- FRP.Rhine: (<<^) :: Arrow a => a c d -> b -> c -> a b d
+ FRP.Rhine: (<<^) :: Arrow a => a c d -> (b -> c) -> a b d
- FRP.Rhine: (>>^) :: Arrow a => a b c -> c -> d -> a b d
+ FRP.Rhine: (>>^) :: Arrow a => a b c -> (c -> d) -> a b d
- FRP.Rhine: (^<<) :: Arrow a => c -> d -> a b c -> a b d
+ FRP.Rhine: (^<<) :: Arrow a => (c -> d) -> a b c -> a b d
- FRP.Rhine: (^>>) :: Arrow a => b -> c -> a c d -> a b d
+ FRP.Rhine: (^>>) :: Arrow a => (b -> c) -> a c d -> a b d
- FRP.Rhine: (|||) :: ArrowChoice a => a b d -> a c d -> a Either b c d
+ FRP.Rhine: (|||) :: ArrowChoice a => a b d -> a c d -> a (Either b c) d
- FRP.Rhine: AsyncMealy :: s -> a -> m s -> s -> m (b, s) -> AsyncMealy m s a b
+ FRP.Rhine: AsyncMealy :: (s -> a -> m s) -> (s -> m (b, s)) -> AsyncMealy m s a b
- FRP.Rhine: ExceptT :: m Either e a -> ExceptT e a
+ FRP.Rhine: ExceptT :: m (Either e a) -> ExceptT e a
- FRP.Rhine: HoistClock :: cl -> forall a. m1 a -> m2 a -> HoistClock m1 m2 cl
+ FRP.Rhine: HoistClock :: cl -> (forall a. m1 a -> m2 a) -> HoistClock m1 m2 cl
- FRP.Rhine: Kleisli :: a -> m b -> Kleisli a b
+ FRP.Rhine: Kleisli :: (a -> m b) -> Kleisli a b
- FRP.Rhine: Millisecond :: (RescaledClockS IO (FixedStep n) UTCTime Bool) -> Millisecond
+ FRP.Rhine: Millisecond :: RescaledClockS IO (FixedStep n) UTCTime Bool -> Millisecond
- FRP.Rhine: ResamplingBuffer :: TimeInfo cla -> a -> m (ResamplingBuffer m cla clb a b) -> TimeInfo clb -> m (b, ResamplingBuffer m cla clb a b) -> ResamplingBuffer m cla clb a b
+ FRP.Rhine: ResamplingBuffer :: (TimeInfo cla -> a -> m (ResamplingBuffer m cla clb a b)) -> (TimeInfo clb -> m (b, ResamplingBuffer m cla clb a b)) -> ResamplingBuffer m cla clb a b
- FRP.Rhine: ResamplingPoint :: (ResamplingBuffer m (Out cla) (In clb) a b) -> (Schedule m cla clb) -> ResamplingPoint m cla clb a b
+ FRP.Rhine: ResamplingPoint :: ResamplingBuffer m (Out cla) (In clb) a b -> Schedule m cla clb -> ResamplingPoint m cla clb a b
- FRP.Rhine: RhineAndResamplingPoint :: (Rhine m cl1 a b) -> (ResamplingPoint m cl1 cl2 b c) -> RhineAndResamplingPoint m cl1 cl2 a c
+ FRP.Rhine: RhineAndResamplingPoint :: Rhine m cl1 a b -> ResamplingPoint m cl1 cl2 b c -> RhineAndResamplingPoint m cl1 cl2 a c
- FRP.Rhine: RhineParallelAndSchedule :: (Rhine m clL a b) -> (Schedule m clL clR) -> RhineParallelAndSchedule m clL clR a b
+ FRP.Rhine: RhineParallelAndSchedule :: Rhine m clL a b -> Schedule m clL clR -> RhineParallelAndSchedule m clL clR a b
- FRP.Rhine: Schedule :: cl1 -> cl2 -> RunningClockInit m (Time cl1) (Either (Tag cl1) (Tag cl2)) -> Schedule m cl1 cl2
+ FRP.Rhine: Schedule :: (cl1 -> cl2 -> RunningClockInit m (Time cl1) (Either (Tag cl1) (Tag cl2))) -> Schedule m cl1 cl2
- FRP.Rhine: SelectClock :: cl -> Tag cl -> Maybe a -> SelectClock cl a
+ FRP.Rhine: SelectClock :: cl -> (Tag cl -> Maybe a) -> SelectClock cl a
- FRP.Rhine: accumulateWith :: Monad m => a -> s -> s -> s -> MSF m a s
+ FRP.Rhine: accumulateWith :: Monad m => (a -> s -> s) -> s -> MSF m a s
- FRP.Rhine: arr :: Arrow a => b -> c -> a b c
+ FRP.Rhine: arr :: Arrow a => (b -> c) -> a b c
- FRP.Rhine: arrM :: Monad m => a -> m b -> MSF m a b
+ FRP.Rhine: arrM :: Monad m => (a -> m b) -> MSF m a b
- FRP.Rhine: catchE :: Monad m => ExceptT e m a -> e -> ExceptT e' m a -> ExceptT e' m a
+ FRP.Rhine: catchE :: Monad m => ExceptT e m a -> (e -> ExceptT e' m a) -> ExceptT e' m a
- FRP.Rhine: class Category a => Arrow (a :: * -> * -> *)
+ FRP.Rhine: class Category a => Arrow (a :: Type -> Type -> Type)
- FRP.Rhine: class Arrow a => ArrowApply (a :: * -> * -> *)
+ FRP.Rhine: class Arrow a => ArrowApply (a :: Type -> Type -> Type)
- FRP.Rhine: class Arrow a => ArrowChoice (a :: * -> * -> *)
+ FRP.Rhine: class Arrow a => ArrowChoice (a :: Type -> Type -> Type)
- FRP.Rhine: class Arrow a => ArrowLoop (a :: * -> * -> *)
+ FRP.Rhine: class Arrow a => ArrowLoop (a :: Type -> Type -> Type)
- FRP.Rhine: class ArrowZero a => ArrowPlus (a :: * -> * -> *)
+ FRP.Rhine: class ArrowZero a => ArrowPlus (a :: Type -> Type -> Type)
- FRP.Rhine: class Arrow a => ArrowZero (a :: * -> * -> *)
+ FRP.Rhine: class Arrow a => ArrowZero (a :: Type -> Type -> Type)
- FRP.Rhine: class Monad m => MonadIO (m :: * -> *)
+ FRP.Rhine: class Monad m => MonadIO (m :: Type -> Type)
- FRP.Rhine: class RModule v => NormedSpace v
+ FRP.Rhine: class (Floating Groundfield v, InnerProductSpace v, VectorSpace v) => NormedSpace v
- FRP.Rhine: data MSF (m :: * -> *) a b
+ FRP.Rhine: data MSF (m :: Type -> Type) a b
- FRP.Rhine: exceptS :: Monad m => MSF ExceptT e m a b -> MSF m a Either e b
+ FRP.Rhine: exceptS :: (Functor m, Monad m) => MSF (ExceptT e m) a b -> MSF m a (Either e b)
- FRP.Rhine: fifo :: Monad m => MSF m [a] Maybe a
+ FRP.Rhine: fifo :: Monad m => MSF m [a] (Maybe a)
- FRP.Rhine: left :: ArrowChoice a => a b c -> a Either b d Either c d
+ FRP.Rhine: left :: ArrowChoice a => a b c -> a (Either b d) (Either c d)
- FRP.Rhine: leftApp :: ArrowApply a => a b c -> a Either b d Either c d
+ FRP.Rhine: leftApp :: ArrowApply a => a b c -> a (Either b d) (Either c d)
- FRP.Rhine: liftCallCC :: () => CallCC m Either e a Either e b -> CallCC ExceptT e m a b
+ FRP.Rhine: liftCallCC :: () => CallCC m (Either e a) (Either e b) -> CallCC (ExceptT e m) a b
- FRP.Rhine: liftListen :: Monad m => Listen w m Either e a -> Listen w ExceptT e m a
+ FRP.Rhine: liftListen :: Monad m => Listen w m (Either e a) -> Listen w (ExceptT e m) a
- FRP.Rhine: liftPass :: Monad m => Pass w m Either e a -> Pass w ExceptT e m a
+ FRP.Rhine: liftPass :: Monad m => Pass w m (Either e a) -> Pass w (ExceptT e m) a
- FRP.Rhine: mapExcept :: () => Either e a -> Either e' b -> Except e a -> Except e' b
+ FRP.Rhine: mapExcept :: () => (Either e a -> Either e' b) -> Except e a -> Except e' b
- FRP.Rhine: mapExceptT :: () => m Either e a -> n Either e' b -> ExceptT e m a -> ExceptT e' n b
+ FRP.Rhine: mapExceptT :: () => (m (Either e a) -> n (Either e' b)) -> ExceptT e m a -> ExceptT e' n b
- FRP.Rhine: mapMaybeS :: Monad m => MSF m a b -> MSF m Maybe a Maybe b
+ FRP.Rhine: mapMaybeS :: Monad m => MSF m a b -> MSF m (Maybe a) (Maybe b)
- FRP.Rhine: newChan :: () => IO Chan a
+ FRP.Rhine: newChan :: () => IO (Chan a)
- FRP.Rhine: newtype ArrowMonad (a :: * -> * -> *) b
+ FRP.Rhine: newtype ArrowMonad (a :: Type -> Type -> Type) b
- FRP.Rhine: newtype ExceptT e (m :: * -> *) a
+ FRP.Rhine: newtype ExceptT e (m :: Type -> Type) a
- FRP.Rhine: newtype Kleisli (m :: * -> *) a b
+ FRP.Rhine: newtype Kleisli (m :: Type -> Type) a b
- FRP.Rhine: pauseOn :: Show a => a -> Bool -> String -> MSF IO a a
+ FRP.Rhine: pauseOn :: Show a => (a -> Bool) -> String -> MSF IO a a
- FRP.Rhine: repeatedly :: Monad m => a -> a -> a -> MSF m () a
+ FRP.Rhine: repeatedly :: Monad m => (a -> a) -> a -> MSF m () a
- FRP.Rhine: retag :: (Time cl1 ~ Time cl2) => (Tag cl1 -> Tag cl2) -> TimeInfo cl1 -> TimeInfo cl2
+ FRP.Rhine: retag :: Time cl1 ~ Time cl2 => (Tag cl1 -> Tag cl2) -> TimeInfo cl1 -> TimeInfo cl2
- FRP.Rhine: right :: ArrowChoice a => a b c -> a Either d b Either d c
+ FRP.Rhine: right :: ArrowChoice a => a b c -> a (Either d b) (Either d c)
- FRP.Rhine: runExceptT :: () => ExceptT e m a -> m Either e a
+ FRP.Rhine: runExceptT :: () => ExceptT e m a -> m (Either e a)
- FRP.Rhine: runMSFExcept :: MSFExcept m a b e -> MSF ExceptT e m a b
+ FRP.Rhine: runMSFExcept :: MSFExcept m a b e -> MSF (ExceptT e m) a b
- FRP.Rhine: traceWhen :: (Monad m, Show a) => a -> Bool -> String -> m () -> String -> MSF m a a
+ FRP.Rhine: traceWhen :: (Monad m, Show a) => (a -> Bool) -> (String -> m ()) -> String -> MSF m a a
- FRP.Rhine: traceWith :: (Monad m, Show a) => String -> m () -> String -> MSF m a a
+ FRP.Rhine: traceWith :: (Monad m, Show a) => (String -> m ()) -> String -> MSF m a a
- FRP.Rhine: type MSink (m :: * -> *) a = MSF m a ()
+ FRP.Rhine: type MSink (m :: Type -> Type) a = MSF m a ()
- FRP.Rhine: type MStream (m :: * -> *) a = MSF m () a
+ FRP.Rhine: type MStream (m :: Type -> Type) a = MSF m () a
- FRP.Rhine: type family Tag cl;
+ FRP.Rhine: type family In cl
- FRP.Rhine: unfold :: Monad m => a -> (b, a) -> a -> MSF m () b
+ FRP.Rhine: unfold :: Monad m => (a -> (b, a)) -> a -> MSF m () b
- FRP.Rhine: withExcept :: () => e -> e' -> Except e a -> Except e' a
+ FRP.Rhine: withExcept :: () => (e -> e') -> Except e a -> Except e' a
- FRP.Rhine: withExceptT :: Functor m => e -> e' -> ExceptT e m a -> ExceptT e' m a
+ FRP.Rhine: withExceptT :: Functor m => (e -> e') -> ExceptT e m a -> ExceptT e' m a
- FRP.Rhine: withSideEffect :: Monad m => a -> m b -> MSF m a a
+ FRP.Rhine: withSideEffect :: Monad m => (a -> m b) -> MSF m a a
- FRP.Rhine.ClSF.Core: (+++) :: ArrowChoice a => a b c -> a b' c' -> a Either b b' Either c c'
+ FRP.Rhine.ClSF.Core: (+++) :: ArrowChoice a => a b c -> a b' c' -> a (Either b b') (Either c c')
- FRP.Rhine.ClSF.Core: (<<^) :: Arrow a => a c d -> b -> c -> a b d
+ FRP.Rhine.ClSF.Core: (<<^) :: Arrow a => a c d -> (b -> c) -> a b d
- FRP.Rhine.ClSF.Core: (>>^) :: Arrow a => a b c -> c -> d -> a b d
+ FRP.Rhine.ClSF.Core: (>>^) :: Arrow a => a b c -> (c -> d) -> a b d
- FRP.Rhine.ClSF.Core: (^<<) :: Arrow a => c -> d -> a b c -> a b d
+ FRP.Rhine.ClSF.Core: (^<<) :: Arrow a => (c -> d) -> a b c -> a b d
- FRP.Rhine.ClSF.Core: (^>>) :: Arrow a => b -> c -> a c d -> a b d
+ FRP.Rhine.ClSF.Core: (^>>) :: Arrow a => (b -> c) -> a c d -> a b d
- FRP.Rhine.ClSF.Core: (|||) :: ArrowChoice a => a b d -> a c d -> a Either b c d
+ FRP.Rhine.ClSF.Core: (|||) :: ArrowChoice a => a b d -> a c d -> a (Either b c) d
- FRP.Rhine.ClSF.Core: HoistClock :: cl -> forall a. m1 a -> m2 a -> HoistClock m1 m2 cl
+ FRP.Rhine.ClSF.Core: HoistClock :: cl -> (forall a. m1 a -> m2 a) -> HoistClock m1 m2 cl
- FRP.Rhine.ClSF.Core: Kleisli :: a -> m b -> Kleisli a b
+ FRP.Rhine.ClSF.Core: Kleisli :: (a -> m b) -> Kleisli a b
- FRP.Rhine.ClSF.Core: accumulateWith :: Monad m => a -> s -> s -> s -> MSF m a s
+ FRP.Rhine.ClSF.Core: accumulateWith :: Monad m => (a -> s -> s) -> s -> MSF m a s
- FRP.Rhine.ClSF.Core: arr :: Arrow a => b -> c -> a b c
+ FRP.Rhine.ClSF.Core: arr :: Arrow a => (b -> c) -> a b c
- FRP.Rhine.ClSF.Core: arrM :: Monad m => a -> m b -> MSF m a b
+ FRP.Rhine.ClSF.Core: arrM :: Monad m => (a -> m b) -> MSF m a b
- FRP.Rhine.ClSF.Core: class Category a => Arrow (a :: * -> * -> *)
+ FRP.Rhine.ClSF.Core: class Category a => Arrow (a :: Type -> Type -> Type)
- FRP.Rhine.ClSF.Core: class Arrow a => ArrowApply (a :: * -> * -> *)
+ FRP.Rhine.ClSF.Core: class Arrow a => ArrowApply (a :: Type -> Type -> Type)
- FRP.Rhine.ClSF.Core: class Arrow a => ArrowChoice (a :: * -> * -> *)
+ FRP.Rhine.ClSF.Core: class Arrow a => ArrowChoice (a :: Type -> Type -> Type)
- FRP.Rhine.ClSF.Core: class Arrow a => ArrowLoop (a :: * -> * -> *)
+ FRP.Rhine.ClSF.Core: class Arrow a => ArrowLoop (a :: Type -> Type -> Type)
- FRP.Rhine.ClSF.Core: class ArrowZero a => ArrowPlus (a :: * -> * -> *)
+ FRP.Rhine.ClSF.Core: class ArrowZero a => ArrowPlus (a :: Type -> Type -> Type)
- FRP.Rhine.ClSF.Core: class Arrow a => ArrowZero (a :: * -> * -> *)
+ FRP.Rhine.ClSF.Core: class Arrow a => ArrowZero (a :: Type -> Type -> Type)
- FRP.Rhine.ClSF.Core: data MSF (m :: * -> *) a b
+ FRP.Rhine.ClSF.Core: data MSF (m :: Type -> Type) a b
- FRP.Rhine.ClSF.Core: fifo :: Monad m => MSF m [a] Maybe a
+ FRP.Rhine.ClSF.Core: fifo :: Monad m => MSF m [a] (Maybe a)
- FRP.Rhine.ClSF.Core: left :: ArrowChoice a => a b c -> a Either b d Either c d
+ FRP.Rhine.ClSF.Core: left :: ArrowChoice a => a b c -> a (Either b d) (Either c d)
- FRP.Rhine.ClSF.Core: leftApp :: ArrowApply a => a b c -> a Either b d Either c d
+ FRP.Rhine.ClSF.Core: leftApp :: ArrowApply a => a b c -> a (Either b d) (Either c d)
- FRP.Rhine.ClSF.Core: mapMaybeS :: Monad m => MSF m a b -> MSF m Maybe a Maybe b
+ FRP.Rhine.ClSF.Core: mapMaybeS :: Monad m => MSF m a b -> MSF m (Maybe a) (Maybe b)
- FRP.Rhine.ClSF.Core: newtype ArrowMonad (a :: * -> * -> *) b
+ FRP.Rhine.ClSF.Core: newtype ArrowMonad (a :: Type -> Type -> Type) b
- FRP.Rhine.ClSF.Core: newtype Kleisli (m :: * -> *) a b
+ FRP.Rhine.ClSF.Core: newtype Kleisli (m :: Type -> Type) a b
- FRP.Rhine.ClSF.Core: pauseOn :: Show a => a -> Bool -> String -> MSF IO a a
+ FRP.Rhine.ClSF.Core: pauseOn :: Show a => (a -> Bool) -> String -> MSF IO a a
- FRP.Rhine.ClSF.Core: repeatedly :: Monad m => a -> a -> a -> MSF m () a
+ FRP.Rhine.ClSF.Core: repeatedly :: Monad m => (a -> a) -> a -> MSF m () a
- FRP.Rhine.ClSF.Core: retag :: (Time cl1 ~ Time cl2) => (Tag cl1 -> Tag cl2) -> TimeInfo cl1 -> TimeInfo cl2
+ FRP.Rhine.ClSF.Core: retag :: Time cl1 ~ Time cl2 => (Tag cl1 -> Tag cl2) -> TimeInfo cl1 -> TimeInfo cl2
- FRP.Rhine.ClSF.Core: right :: ArrowChoice a => a b c -> a Either d b Either d c
+ FRP.Rhine.ClSF.Core: right :: ArrowChoice a => a b c -> a (Either d b) (Either d c)
- FRP.Rhine.ClSF.Core: traceWhen :: (Monad m, Show a) => a -> Bool -> String -> m () -> String -> MSF m a a
+ FRP.Rhine.ClSF.Core: traceWhen :: (Monad m, Show a) => (a -> Bool) -> (String -> m ()) -> String -> MSF m a a
- FRP.Rhine.ClSF.Core: traceWith :: (Monad m, Show a) => String -> m () -> String -> MSF m a a
+ FRP.Rhine.ClSF.Core: traceWith :: (Monad m, Show a) => (String -> m ()) -> String -> MSF m a a
- FRP.Rhine.ClSF.Core: type MSink (m :: * -> *) a = MSF m a ()
+ FRP.Rhine.ClSF.Core: type MSink (m :: Type -> Type) a = MSF m a ()
- FRP.Rhine.ClSF.Core: type MStream (m :: * -> *) a = MSF m () a
+ FRP.Rhine.ClSF.Core: type MStream (m :: Type -> Type) a = MSF m () a
- FRP.Rhine.ClSF.Core: unfold :: Monad m => a -> (b, a) -> a -> MSF m () b
+ FRP.Rhine.ClSF.Core: unfold :: Monad m => (a -> (b, a)) -> a -> MSF m () b
- FRP.Rhine.ClSF.Core: withSideEffect :: Monad m => a -> m b -> MSF m a a
+ FRP.Rhine.ClSF.Core: withSideEffect :: Monad m => (a -> m b) -> MSF m a a
- FRP.Rhine.ClSF.Except: exceptS :: Monad m => MSF ExceptT e m a b -> MSF m a Either e b
+ FRP.Rhine.ClSF.Except: exceptS :: (Functor m, Monad m) => MSF (ExceptT e m) a b -> MSF m a (Either e b)
- FRP.Rhine.ClSF.Except: runMSFExcept :: MSFExcept m a b e -> MSF ExceptT e m a b
+ FRP.Rhine.ClSF.Except: runMSFExcept :: MSFExcept m a b e -> MSF (ExceptT e m) a b
- FRP.Rhine.Clock: (+++) :: ArrowChoice a => a b c -> a b' c' -> a Either b b' Either c c'
+ FRP.Rhine.Clock: (+++) :: ArrowChoice a => a b c -> a b' c' -> a (Either b b') (Either c c')
- FRP.Rhine.Clock: (<<^) :: Arrow a => a c d -> b -> c -> a b d
+ FRP.Rhine.Clock: (<<^) :: Arrow a => a c d -> (b -> c) -> a b d
- FRP.Rhine.Clock: (>>^) :: Arrow a => a b c -> c -> d -> a b d
+ FRP.Rhine.Clock: (>>^) :: Arrow a => a b c -> (c -> d) -> a b d
- FRP.Rhine.Clock: (^<<) :: Arrow a => c -> d -> a b c -> a b d
+ FRP.Rhine.Clock: (^<<) :: Arrow a => (c -> d) -> a b c -> a b d
- FRP.Rhine.Clock: (^>>) :: Arrow a => b -> c -> a c d -> a b d
+ FRP.Rhine.Clock: (^>>) :: Arrow a => (b -> c) -> a c d -> a b d
- FRP.Rhine.Clock: (|||) :: ArrowChoice a => a b d -> a c d -> a Either b c d
+ FRP.Rhine.Clock: (|||) :: ArrowChoice a => a b d -> a c d -> a (Either b c) d
- FRP.Rhine.Clock: HoistClock :: cl -> forall a. m1 a -> m2 a -> HoistClock m1 m2 cl
+ FRP.Rhine.Clock: HoistClock :: cl -> (forall a. m1 a -> m2 a) -> HoistClock m1 m2 cl
- FRP.Rhine.Clock: Kleisli :: a -> m b -> Kleisli a b
+ FRP.Rhine.Clock: Kleisli :: (a -> m b) -> Kleisli a b
- FRP.Rhine.Clock: accumulateWith :: Monad m => a -> s -> s -> s -> MSF m a s
+ FRP.Rhine.Clock: accumulateWith :: Monad m => (a -> s -> s) -> s -> MSF m a s
- FRP.Rhine.Clock: arr :: Arrow a => b -> c -> a b c
+ FRP.Rhine.Clock: arr :: Arrow a => (b -> c) -> a b c
- FRP.Rhine.Clock: arrM :: Monad m => a -> m b -> MSF m a b
+ FRP.Rhine.Clock: arrM :: Monad m => (a -> m b) -> MSF m a b
- FRP.Rhine.Clock: class Category a => Arrow (a :: * -> * -> *)
+ FRP.Rhine.Clock: class Category a => Arrow (a :: Type -> Type -> Type)
- FRP.Rhine.Clock: class Arrow a => ArrowApply (a :: * -> * -> *)
+ FRP.Rhine.Clock: class Arrow a => ArrowApply (a :: Type -> Type -> Type)
- FRP.Rhine.Clock: class Arrow a => ArrowChoice (a :: * -> * -> *)
+ FRP.Rhine.Clock: class Arrow a => ArrowChoice (a :: Type -> Type -> Type)
- FRP.Rhine.Clock: class Arrow a => ArrowLoop (a :: * -> * -> *)
+ FRP.Rhine.Clock: class Arrow a => ArrowLoop (a :: Type -> Type -> Type)
- FRP.Rhine.Clock: class ArrowZero a => ArrowPlus (a :: * -> * -> *)
+ FRP.Rhine.Clock: class ArrowZero a => ArrowPlus (a :: Type -> Type -> Type)
- FRP.Rhine.Clock: class Arrow a => ArrowZero (a :: * -> * -> *)
+ FRP.Rhine.Clock: class Arrow a => ArrowZero (a :: Type -> Type -> Type)
- FRP.Rhine.Clock: data MSF (m :: * -> *) a b
+ FRP.Rhine.Clock: data MSF (m :: Type -> Type) a b
- FRP.Rhine.Clock: fifo :: Monad m => MSF m [a] Maybe a
+ FRP.Rhine.Clock: fifo :: Monad m => MSF m [a] (Maybe a)
- FRP.Rhine.Clock: left :: ArrowChoice a => a b c -> a Either b d Either c d
+ FRP.Rhine.Clock: left :: ArrowChoice a => a b c -> a (Either b d) (Either c d)
- FRP.Rhine.Clock: leftApp :: ArrowApply a => a b c -> a Either b d Either c d
+ FRP.Rhine.Clock: leftApp :: ArrowApply a => a b c -> a (Either b d) (Either c d)
- FRP.Rhine.Clock: mapMaybeS :: Monad m => MSF m a b -> MSF m Maybe a Maybe b
+ FRP.Rhine.Clock: mapMaybeS :: Monad m => MSF m a b -> MSF m (Maybe a) (Maybe b)
- FRP.Rhine.Clock: newtype ArrowMonad (a :: * -> * -> *) b
+ FRP.Rhine.Clock: newtype ArrowMonad (a :: Type -> Type -> Type) b
- FRP.Rhine.Clock: newtype Kleisli (m :: * -> *) a b
+ FRP.Rhine.Clock: newtype Kleisli (m :: Type -> Type) a b
- FRP.Rhine.Clock: pauseOn :: Show a => a -> Bool -> String -> MSF IO a a
+ FRP.Rhine.Clock: pauseOn :: Show a => (a -> Bool) -> String -> MSF IO a a
- FRP.Rhine.Clock: repeatedly :: Monad m => a -> a -> a -> MSF m () a
+ FRP.Rhine.Clock: repeatedly :: Monad m => (a -> a) -> a -> MSF m () a
- FRP.Rhine.Clock: retag :: (Time cl1 ~ Time cl2) => (Tag cl1 -> Tag cl2) -> TimeInfo cl1 -> TimeInfo cl2
+ FRP.Rhine.Clock: retag :: Time cl1 ~ Time cl2 => (Tag cl1 -> Tag cl2) -> TimeInfo cl1 -> TimeInfo cl2
- FRP.Rhine.Clock: right :: ArrowChoice a => a b c -> a Either d b Either d c
+ FRP.Rhine.Clock: right :: ArrowChoice a => a b c -> a (Either d b) (Either d c)
- FRP.Rhine.Clock: traceWhen :: (Monad m, Show a) => a -> Bool -> String -> m () -> String -> MSF m a a
+ FRP.Rhine.Clock: traceWhen :: (Monad m, Show a) => (a -> Bool) -> (String -> m ()) -> String -> MSF m a a
- FRP.Rhine.Clock: traceWith :: (Monad m, Show a) => String -> m () -> String -> MSF m a a
+ FRP.Rhine.Clock: traceWith :: (Monad m, Show a) => (String -> m ()) -> String -> MSF m a a
- FRP.Rhine.Clock: type MSink (m :: * -> *) a = MSF m a ()
+ FRP.Rhine.Clock: type MSink (m :: Type -> Type) a = MSF m a ()
- FRP.Rhine.Clock: type MStream (m :: * -> *) a = MSF m () a
+ FRP.Rhine.Clock: type MStream (m :: Type -> Type) a = MSF m () a
- FRP.Rhine.Clock: unfold :: Monad m => a -> (b, a) -> a -> MSF m () b
+ FRP.Rhine.Clock: unfold :: Monad m => (a -> (b, a)) -> a -> MSF m () b
- FRP.Rhine.Clock: withSideEffect :: Monad m => a -> m b -> MSF m a a
+ FRP.Rhine.Clock: withSideEffect :: Monad m => (a -> m b) -> MSF m a a
- FRP.Rhine.Clock.Realtime.Event: newChan :: () => IO Chan a
+ FRP.Rhine.Clock.Realtime.Event: newChan :: () => IO (Chan a)
- FRP.Rhine.Clock.Realtime.Millisecond: Millisecond :: (RescaledClockS IO (FixedStep n) UTCTime Bool) -> Millisecond
+ FRP.Rhine.Clock.Realtime.Millisecond: Millisecond :: RescaledClockS IO (FixedStep n) UTCTime Bool -> Millisecond
- FRP.Rhine.Clock.Select: SelectClock :: cl -> Tag cl -> Maybe a -> SelectClock cl a
+ FRP.Rhine.Clock.Select: SelectClock :: cl -> (Tag cl -> Maybe a) -> SelectClock cl a
- FRP.Rhine.Reactimation.Combinators: ResamplingPoint :: (ResamplingBuffer m (Out cla) (In clb) a b) -> (Schedule m cla clb) -> ResamplingPoint m cla clb a b
+ FRP.Rhine.Reactimation.Combinators: ResamplingPoint :: ResamplingBuffer m (Out cla) (In clb) a b -> Schedule m cla clb -> ResamplingPoint m cla clb a b
- FRP.Rhine.Reactimation.Combinators: RhineAndResamplingPoint :: (Rhine m cl1 a b) -> (ResamplingPoint m cl1 cl2 b c) -> RhineAndResamplingPoint m cl1 cl2 a c
+ FRP.Rhine.Reactimation.Combinators: RhineAndResamplingPoint :: Rhine m cl1 a b -> ResamplingPoint m cl1 cl2 b c -> RhineAndResamplingPoint m cl1 cl2 a c
- FRP.Rhine.Reactimation.Combinators: RhineParallelAndSchedule :: (Rhine m clL a b) -> (Schedule m clL clR) -> RhineParallelAndSchedule m clL clR a b
+ FRP.Rhine.Reactimation.Combinators: RhineParallelAndSchedule :: Rhine m clL a b -> Schedule m clL clR -> RhineParallelAndSchedule m clL clR a b
- FRP.Rhine.ResamplingBuffer: ResamplingBuffer :: TimeInfo cla -> a -> m (ResamplingBuffer m cla clb a b) -> TimeInfo clb -> m (b, ResamplingBuffer m cla clb a b) -> ResamplingBuffer m cla clb a b
+ FRP.Rhine.ResamplingBuffer: ResamplingBuffer :: (TimeInfo cla -> a -> m (ResamplingBuffer m cla clb a b)) -> (TimeInfo clb -> m (b, ResamplingBuffer m cla clb a b)) -> ResamplingBuffer m cla clb a b
- FRP.Rhine.ResamplingBuffer.Timeless: AsyncMealy :: s -> a -> m s -> s -> m (b, s) -> AsyncMealy m s a b
+ FRP.Rhine.ResamplingBuffer.Timeless: AsyncMealy :: (s -> a -> m s) -> (s -> m (b, s)) -> AsyncMealy m s a b
- FRP.Rhine.Schedule: Schedule :: cl1 -> cl2 -> RunningClockInit m (Time cl1) (Either (Tag cl1) (Tag cl2)) -> Schedule m cl1 cl2
+ FRP.Rhine.Schedule: Schedule :: (cl1 -> cl2 -> RunningClockInit m (Time cl1) (Either (Tag cl1) (Tag cl2))) -> Schedule m cl1 cl2
Files
- ChangeLog.md +7/−0
- README.md +1/−1
- rhine.cabal +13/−6
- src/FRP/Rhine.hs +0/−3
- src/FRP/Rhine/ClSF.hs +1/−0
- src/FRP/Rhine/ClSF/Core.hs +5/−5
- src/FRP/Rhine/ClSF/Except.hs +3/−3
- src/FRP/Rhine/ClSF/Random.hs +97/−0
- src/FRP/Rhine/ClSF/Random/Util.hs +13/−0
- src/FRP/Rhine/ClSF/Reader.hs +2/−2
- src/FRP/Rhine/ClSF/Util.hs +5/−5
- src/FRP/Rhine/Clock.hs +1/−1
- src/FRP/Rhine/Clock/Periodic.hs +0/−2
- src/FRP/Rhine/Clock/Realtime/Busy.hs +1/−1
- src/FRP/Rhine/Clock/Realtime/Event.hs +2/−3
- src/FRP/Rhine/Clock/Realtime/Stdin.hs +1/−1
- src/FRP/Rhine/Reactimation.hs +1/−1
- src/FRP/Rhine/Reactimation/Tick.hs +1/−0
- src/FRP/Rhine/ResamplingBuffer/Interpolation.hs +2/−3
- src/FRP/Rhine/ResamplingBuffer/MSF.hs +3/−0
- src/FRP/Rhine/ResamplingBuffer/Util.hs +3/−0
- src/FRP/Rhine/Schedule.hs +2/−2
- src/FRP/Rhine/Schedule/Concurrently.hs +7/−7
- src/FRP/Rhine/Schedule/Trans.hs +3/−0
- src/FRP/Rhine/TimeDomain.hs +0/−4
ChangeLog.md view
@@ -4,6 +4,13 @@ Since `rhine` reexports modules from `dunai`, every major version in `dunai` triggers a major version in `rhine`. ++## 0.5.1.0++* Synced with `dunai` version numbers+* Supported GHC 8.6+* Added support for randomness with `RandT` in `ClSF`s+ ## 0.5.0.0 * Deprecated GHC 7.*
README.md view
@@ -2,4 +2,4 @@ -------- This is the main library.-For details, visit [[https://github.com/turion/rhine]].+For details, visit [https://github.com/turion/rhine](https://github.com/turion/rhine).
rhine.cabal view
@@ -1,6 +1,6 @@ name: rhine -version: 0.5.0.1+version: 0.5.1.0 synopsis: Functional Reactive Programming with type-level clocks @@ -46,7 +46,7 @@ source-repository this type: git location: git@github.com:turion/rhine.git- tag: v0.5.0.1+ tag: v0.5.1.0 library@@ -65,6 +65,7 @@ FRP.Rhine.ClSF FRP.Rhine.ClSF.Core FRP.Rhine.ClSF.Except+ FRP.Rhine.ClSF.Random FRP.Rhine.ClSF.Reader FRP.Rhine.ClSF.Upsample FRP.Rhine.ClSF.Util@@ -89,6 +90,7 @@ FRP.Rhine.Type other-modules:+ FRP.Rhine.ClSF.Random.Util FRP.Rhine.ClSF.Except.Util FRP.Rhine.Schedule.Util @@ -96,14 +98,16 @@ -- other-extensions: -- Other library packages from which modules are imported.- build-depends: base >= 4.9 && < 4.12- , dunai == 0.4.0.*+ build-depends: base >= 4.9 && < 4.13+ , dunai == 0.5.1.* , transformers == 0.5.* , time == 1.8.* , free == 5.1.*- , containers == 0.5.*- , vector-sized >= 0.6 && < 1.1+ , containers == 0.6.*+ , vector-sized == 1.2.* , deepseq == 1.4.*+ , random == 1.1.*+ , MonadRandom == 0.5.* -- Directories containing source files. hs-source-dirs: src@@ -111,6 +115,9 @@ ghc-options: -Wall -Wno-unticked-promoted-constructors -Wno-type-defaults++ if impl(ghc >= 8.6)+ default-extensions: NoStarIsType -- Base language which the package is written in. default-language: Haskell2010
src/FRP/Rhine.hs view
@@ -17,8 +17,6 @@ -- dunai import Data.MonadicStreamFunction as X hiding ((>>>^), (^>>>)) import Data.VectorSpace as X-import Data.VectorSpace.Specific ()-import Data.VectorSpace.Tuples () -- rhine import FRP.Rhine.Clock as X@@ -49,7 +47,6 @@ import FRP.Rhine.ResamplingBuffer.Collect as X import FRP.Rhine.ResamplingBuffer.Timeless as X import FRP.Rhine.ResamplingBuffer.KeepLast as X-import FRP.Rhine.ResamplingBuffer.Util as X import FRP.Rhine.Schedule.Trans as X import FRP.Rhine.Schedule.Concurrently as X
src/FRP/Rhine/ClSF.hs view
@@ -14,5 +14,6 @@ -- rhine import FRP.Rhine.ClSF.Core as X import FRP.Rhine.ClSF.Except as X+import FRP.Rhine.ClSF.Random as X import FRP.Rhine.ClSF.Reader as X import FRP.Rhine.ClSF.Util as X
src/FRP/Rhine/ClSF/Core.hs view
@@ -23,7 +23,7 @@ import Control.Monad.Trans.Reader (ReaderT, mapReaderT, withReaderT) -- dunai-import Data.MonadicStreamFunction (MSF, arrM, arrM_, liftMSFPurer, liftMSFTrans)+import Data.MonadicStreamFunction (MSF, arrM, constM, morphS, liftTransS) import Data.MonadicStreamFunction as X hiding ((>>>^), (^>>>)) -- rhine@@ -65,7 +65,7 @@ => (forall c. m1 c -> m2 c) -> ClSF m1 cl a b -> ClSF m2 cl a b-hoistClSF hoist = liftMSFPurer $ mapReaderT hoist+hoistClSF hoist = morphS $ mapReaderT hoist -- | Hoist a 'ClSF' and its clock along a monad morphism. hoistClSFAndClock@@ -74,7 +74,7 @@ -> ClSF m1 cl a b -> ClSF m2 (HoistClock m1 m2 cl) a b hoistClSFAndClock hoist- = liftMSFPurer $ withReaderT (retag id) . mapReaderT hoist+ = morphS $ withReaderT (retag id) . mapReaderT hoist -- | Lift a 'ClSF' into a monad transformer. liftClSF@@ -93,7 +93,7 @@ -- | A monadic stream function without dependency on time -- is a 'ClSF' for any clock. timeless :: Monad m => MSF m a b -> ClSF m cl a b-timeless = liftMSFTrans+timeless = liftTransS -- | Utility to lift Kleisli arrows directly to 'ClSF's. arrMCl :: Monad m => (a -> m b) -> ClSF m cl a b@@ -101,7 +101,7 @@ -- | Version without input. constMCl :: Monad m => m b -> ClSF m cl a b-constMCl = timeless . arrM_+constMCl = timeless . constM {- | Call a 'ClSF' every time the input is 'Just a'.
src/FRP/Rhine/ClSF/Except.hs view
@@ -43,7 +43,7 @@ -- | Immediately throw the given exception. throw :: Monad m => e -> MSF (ExceptT e m) a b-throw = arrM_ . throwE+throw = constM . throwE -- | Do not throw an exception. pass :: Monad m => MSF (ExceptT e m) a a@@ -110,13 +110,13 @@ -- | Leave the monad context, to use the 'ClSFExcept' as an 'Arrow'. runClSFExcept :: Monad m => ClSFExcept m cl a b e -> ClSF (ExceptT e m) cl a b-runClSFExcept = liftMSFPurer commuteExceptReader . runMSFExcept+runClSFExcept = morphS commuteExceptReader . runMSFExcept -- | Enter the monad context in the exception -- for 'ClSF's in the 'ExceptT' monad. -- The 'ClSF' will be run until it encounters an exception. try :: Monad m => ClSF (ExceptT e m) cl a b -> ClSFExcept m cl a b e-try = MSFE.try . liftMSFPurer commuteReaderExcept+try = MSFE.try . morphS commuteReaderExcept -- | Within the same tick, perform a monadic action, -- and immediately throw the value as an exception.
+ src/FRP/Rhine/ClSF/Random.hs view
@@ -0,0 +1,97 @@+{-# LANGUAGE RankNTypes #-}+{-# LANGUAGE TypeFamilies #-}+-- | Create 'ClSF's with randomness without 'IO'.+-- Uses the @MonadRandom@ package.+-- This module copies the API from @dunai@'s+-- 'Control.Monad.Trans.MSF.Random'.++module FRP.Rhine.ClSF.Random+ ( module FRP.Rhine.ClSF.Random+ , module X+ )+ where+++-- transformers+import Control.Monad.IO.Class++-- random+import System.Random (newStdGen)++-- MonadRandom+import Control.Monad.Random++-- dunai+import Control.Monad.Trans.MSF.Except (performOnFirstSample)+import qualified Control.Monad.Trans.MSF.Random as MSF+import Control.Monad.Trans.MSF.Random as X hiding (runRandS, evalRandS, getRandomS, getRandomRS, getRandomRS_)++-- rhine+import FRP.Rhine.ClSF.Core+import FRP.Rhine.ClSF.Random.Util++-- * Generating random values from the 'RandT' transformer++-- | Generates random values, updating the generator on every step.+runRandS+ :: (RandomGen g, Monad m)+ => ClSF (RandT g m) cl a b+ -> g -- ^ The initial random seed+ -> ClSF m cl a (g, b)+runRandS clsf g = MSF.runRandS (morphS commuteReaderRand clsf) g++-- | Updates the generator every step but discards the generator.+evalRandS+ :: (RandomGen g, Monad m)+ => ClSF (RandT g m) cl a b+ -> g+ -> ClSF m cl a b+evalRandS clsf g = runRandS clsf g >>> arr snd++-- | Updates the generator every step but discards the value,+-- only outputting the generator.+execRandS+ :: (RandomGen g, Monad m)+ => ClSF (RandT g m) cl a b+ -> g+ -> ClSF m cl a g+execRandS clsf g = runRandS clsf g >>> arr fst++-- | Evaluates the random computation by using the global random generator.+evalRandIOS+ :: Monad m+ => ClSF (RandT StdGen m) cl a b+ -> IO (ClSF m cl a b)+evalRandIOS clsf = do+ g <- newStdGen+ return $ evalRandS clsf g++-- | Evaluates the random computation by using the global random generator on the first tick.+evalRandIOS'+ :: MonadIO m+ => ClSF (RandT StdGen m) cl a b+ -> ClSF m cl a b+evalRandIOS' = performOnFirstSample . liftIO . evalRandIOS++-- * Creating random behaviours++-- | Produce a random value at every tick.+getRandomS+ :: (MonadRandom m, Random a)+ => Behaviour m time a+getRandomS = constMCl getRandom++-- | Produce a random value at every tick,+-- within a range given per tick.+getRandomRS+ :: (MonadRandom m, Random a)+ => BehaviourF m time (a, a) a+getRandomRS = arrMCl getRandomR++-- | Produce a random value at every tick,+-- within a range given once.+getRandomRS_+ :: (MonadRandom m, Random a)+ => (a, a)+ -> Behaviour m time a+getRandomRS_ = constMCl . getRandomR
+ src/FRP/Rhine/ClSF/Random/Util.hs view
@@ -0,0 +1,13 @@+module FRP.Rhine.ClSF.Random.Util where+++-- transformers+import Control.Monad.Trans.Reader++-- MonadRandom+import Control.Monad.Random++-- | Commute one 'ReaderT' layer past a 'RandT' layer.+commuteReaderRand :: ReaderT r (RandT g m) a -> RandT g (ReaderT r m) a+commuteReaderRand (ReaderT f) = liftRandT $ \g -> ReaderT $ \r -> runRandT (f r) g+
src/FRP/Rhine/ClSF/Reader.hs view
@@ -32,7 +32,7 @@ :: Monad m => ClSF m cl (a, r) b -> ClSF (ReaderT r m) cl a b readerS behaviour- = liftMSFPurer commuteReaders $ MSF.readerS $ arr swap >>> behaviour+ = morphS commuteReaders $ MSF.readerS $ arr swap >>> behaviour -- | Remove ("run") a 'ReaderT' layer from the monad stack -- by making it an explicit input to the behaviour.@@ -40,7 +40,7 @@ :: Monad m => ClSF (ReaderT r m) cl a b -> ClSF m cl (a, r) b runReaderS behaviour- = arr swap >>> (MSF.runReaderS $ liftMSFPurer commuteReaders behaviour)+ = arr swap >>> (MSF.runReaderS $ morphS commuteReaders behaviour) -- | Remove a 'ReaderT' layer by passing the readonly environment explicitly. runReaderS_
src/FRP/Rhine/ClSF/Util.hs view
@@ -29,7 +29,7 @@ -- dunai import Control.Monad.Trans.MSF.Reader (readerS)-import Data.MonadicStreamFunction (arrM_, sumFrom, delay, feedback)+import Data.MonadicStreamFunction (constM, sumFrom, iPre, feedback) import Data.MonadicStreamFunction.Instances.VectorSpace () import Data.VectorSpace @@ -42,7 +42,7 @@ -- | Read the environment variable, i.e. the 'TimeInfo'. timeInfo :: Monad m => ClSF m cl a (TimeInfo cl)-timeInfo = arrM_ ask+timeInfo = constM ask {- | Utility to apply functions to the current 'TimeInfo', such as record selectors:@@ -52,7 +52,7 @@ @ -} timeInfoOf :: Monad m => (TimeInfo cl -> b) -> ClSF m cl a b-timeInfoOf f = arrM_ $ asks f+timeInfoOf f = constM $ asks f -- | Continuously return the time difference since the last tick. sinceLastS :: Monad m => ClSF m cl a (Diff (Time cl))@@ -166,7 +166,7 @@ , Groundfield v ~ Diff td) => v -> BehaviorF m td v v derivativeFrom v0 = proc v -> do- vLast <- delay v0 -< v+ vLast <- iPre v0 -< v TimeInfo {..} <- timeInfo -< () returnA -< (v ^-^ vLast) ^/ sinceLast @@ -186,7 +186,7 @@ -> BehaviorF m td v v threePointDerivativeFrom v0 = proc v -> do dv <- derivativeFrom v0 -< v- dv' <- delay zeroVector -< dv+ dv' <- iPre zeroVector -< dv returnA -< (dv ^+^ dv') ^/ 2 -- | Like 'threePointDerivativeFrom',
src/FRP/Rhine/Clock.hs view
@@ -235,7 +235,7 @@ type Tag (HoistClock m1 m2 cl) = Tag cl initClock HoistClock {..} = do (runningClock, initialTime) <- monadMorphism $ initClock unhoistedClock- let hoistMSF = liftMSFPurer+ let hoistMSF = morphS -- TODO Look out for API changes in dunai here return ( hoistMSF monadMorphism runningClock
src/FRP/Rhine/Clock/Periodic.hs view
@@ -23,8 +23,6 @@ import GHC.TypeLits (Nat, KnownNat, natVal) -- dunai-import Control.Monad.Trans.MSF.Except-import Control.Monad.Trans.MSF.Maybe (listToMaybeS, runMaybeT) import Data.MonadicStreamFunction -- rhine
src/FRP/Rhine/Clock/Realtime/Busy.hs view
@@ -24,7 +24,7 @@ initClock _ = do initialTime <- getCurrentTime return- ( arrM_ getCurrentTime+ ( constM getCurrentTime &&& arr (const ()) , initialTime )
src/FRP/Rhine/Clock/Realtime/Event.hs view
@@ -44,7 +44,6 @@ -- rhine import FRP.Rhine.ClSF-import FRP.Rhine.Clock import FRP.Rhine.Schedule import FRP.Rhine.Schedule.Concurrently @@ -68,7 +67,7 @@ e.g. @runEventChanT $ flow myRhine@. This way, exactly one channel is created. -Caution: Don't use this with 'liftMSFPurer',+Caution: Don't use this with 'morphS', since it would create a new channel every tick. Instead, create one @chan :: Chan c@, e.g. with 'newChan', and then use 'withChanS'.@@ -154,7 +153,7 @@ initClock _ = do initialTime <- liftIO getCurrentTime return- ( arrM_ $ do+ ( constM $ do chan <- ask event <- liftIO $ readChan chan time <- liftIO $ getCurrentTime
src/FRP/Rhine/Clock/Realtime/Stdin.hs view
@@ -33,7 +33,7 @@ initClock _ = do initialTime <- liftIO getCurrentTime return- ( arrM_ $ liftIO $ do+ ( constM $ liftIO $ do line <- getLine time <- getCurrentTime return (time, line)
src/FRP/Rhine/Reactimation.hs view
@@ -9,7 +9,7 @@ -- dunai-import Data.MonadicStreamFunction+import Data.MonadicStreamFunction.InternalCore -- rhine import FRP.Rhine.Clock
src/FRP/Rhine/Reactimation/Tick.hs view
@@ -13,6 +13,7 @@ -- dunai import Data.MonadicStreamFunction+import Data.MonadicStreamFunction.InternalCore -- rhine import FRP.Rhine.Clock
src/FRP/Rhine/ResamplingBuffer/Interpolation.hs view
@@ -13,7 +13,6 @@ -- dunai import Data.VectorSpace-import Data.VectorSpace.Tuples -- rhine import FRP.Rhine.ClSF@@ -86,8 +85,8 @@ , Groundfield v ~ Diff (Time cl2) ) => ResamplingBuffer m cl1 cl2 v v-cubic = ((delay zeroVector &&& threePointDerivative) &&& (sinceInitS >-> delay 0))- >-> (clId &&& delay (zeroVector, 0))+cubic = ((iPre zeroVector &&& threePointDerivative) &&& (sinceInitS >-> iPre 0))+ >-> (clId &&& iPre (zeroVector, 0)) ^->> keepLast ((zeroVector, 0), (zeroVector, 0)) >>-^ proc (((dv, v), t1), ((dv', v'), t1')) -> do t2 <- sinceInitS -< ()
src/FRP/Rhine/ResamplingBuffer/MSF.hs view
@@ -5,6 +5,9 @@ {-# LANGUAGE RecordWildCards #-} module FRP.Rhine.ResamplingBuffer.MSF where +-- dunai+import Data.MonadicStreamFunction.InternalCore+ -- rhine import FRP.Rhine.ResamplingBuffer
src/FRP/Rhine/ResamplingBuffer/Util.hs view
@@ -8,6 +8,9 @@ -- transformers import Control.Monad.Trans.Reader (runReaderT) +-- dunai+import Data.MonadicStreamFunction.InternalCore+ -- rhine import FRP.Rhine.Clock import FRP.Rhine.ClSF
src/FRP/Rhine/Schedule.hs view
@@ -64,7 +64,7 @@ where initSchedule' cl1 cl2 = hoist $ first (hoistMSF hoist) <$> initSchedule cl1 cl2- hoistMSF = liftMSFPurer+ hoistMSF = morphS -- TODO This should be a dunai issue -- | Swaps the clocks for a given schedule.@@ -123,7 +123,7 @@ (HoistClock (ReaderT r m) m cl1) (HoistClock (ReaderT r m) m cl2) -> Schedule (ReaderT r m) cl1 cl2 readerSchedule Schedule {..}- = Schedule $ \cl1 cl2 -> ReaderT $ \r -> first liftMSFTrans+ = Schedule $ \cl1 cl2 -> ReaderT $ \r -> first liftTransS <$> initSchedule (HoistClock cl1 $ flip runReaderT r) (HoistClock cl2 $ flip runReaderT r)
src/FRP/Rhine/Schedule/Concurrently.hs view
@@ -46,7 +46,7 @@ _ <- launchSubthread cl2 Right iMVar mvar initTime <- takeMVar iMVar -- The first clock to be initialised sets the first time stamp _ <- takeMVar iMVar -- Initialise the second clock- return (arrM_ $ takeMVar mvar, initTime)+ return (constM $ takeMVar mvar, initTime) where launchSubthread cl leftright iMVar mvar = forkIO $ do (runningClock, initTime) <- initClock cl@@ -78,7 +78,7 @@ (_ , w2) <- lift $ takeMVar iMVar tell w1 tell w2- return (arrM_ (WriterT $ takeMVar mvar), initTime)+ return (constM (WriterT $ takeMVar mvar), initTime) where launchSubthread cl leftright iMVar mvar = lift $ forkIO $ do ((runningClock, initTime), w) <- runWriterT $ initClock cl@@ -107,7 +107,7 @@ catchAndDrain mvar $ do initTime <- ExceptT $ takeMVar iMVar -- The first clock to be initialised sets the first time stamp _ <- ExceptT $ takeMVar iMVar -- Initialise the second clock- let runningSchedule = arrM_ $ do+ let runningSchedule = constM $ do eTick <- lift $ takeMVar mvar case eTick of Right tick -> return tick@@ -122,14 +122,14 @@ Right (runningClock, initTime) -> do putMVar iMVar $ Right initTime Left e <- runExceptT $ reactimate $ runningClock >>> proc (td, tag2) -> do- arrM (lift . putMVar mvar) -< Right (td, leftright tag2)- me <- arrM_ (lift $ readIORef errorref) -< ()- _ <- throwMaybe -< me+ arrM (lift . putMVar mvar) -< Right (td, leftright tag2)+ me <- constM (lift $ readIORef errorref) -< ()+ _ <- throwMaybe -< me returnA -< () putMVar mvar $ Left e -- Either throw own exception or acknowledge the exception from the other clock Left e -> void $ putMVar iMVar $ Left e catchAndDrain mvar initScheduleAction = catchE initScheduleAction $ \e -> do- _ <- reactimate $ (arrM_ $ ExceptT $ takeMVar mvar) >>> arr (const ()) -- Drain the mvar until the other clock acknowledges the exception+ _ <- reactimate $ (constM $ ExceptT $ takeMVar mvar) >>> arr (const ()) -- Drain the mvar until the other clock acknowledges the exception throwE e -- | As 'concurrentlyExcept', with a single possible exception value.
src/FRP/Rhine/Schedule/Trans.hs view
@@ -8,6 +8,9 @@ {-# LANGUAGE TypeFamilies #-} module FRP.Rhine.Schedule.Trans where +-- dunai+import Data.MonadicStreamFunction.InternalCore+ -- rhine import Control.Monad.Schedule import FRP.Rhine.Clock
src/FRP/Rhine/TimeDomain.hs view
@@ -16,10 +16,6 @@ -- time import Data.Time.Clock (UTCTime, diffUTCTime) --- dunai-import Data.VectorSpace.Specific ()-- -- | A time domain is an affine space representing a notion of time, -- such as real time, simulated time, steps, or a completely different notion. class TimeDomain time where