-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Elm signal system for Haskell -- -- Ramus is a direct port of purescript-signal into Haskell, offering the -- Elm signal system for Haskell. @package ramus @version 0.1.1 module Ramus.Internal data Signal a Signal :: a -> (a -> IO ()) -> ((a -> IO ()) -> IO ()) -> Signal a [get] :: Signal a -> a [set] :: Signal a -> a -> IO () [subscribe] :: Signal a -> (a -> IO ()) -> IO () unsafeRef :: a -> IORef a unsafeRead :: IORef a -> a make :: a -> Signal a module Ramus.Signal data Signal a -- | Creates a signal with a constant value. constant :: a -> Signal a -- | Merge two signals, returning a new signal which will yield a value -- |whenever either of the input signals yield. Its initial value will be -- |that of the first signal. merge :: Signal a -> Signal a -> Signal a -- | Merge all signals inside a Foldable, returning a Maybe -- which will |either contain the resulting signal, or Nothing if -- the Foldable |was empty. mergeMany :: (Functor f, Foldable f) => f (Signal a) -> Maybe (Signal a) -- | Creates a past dependent signal. The function argument takes the value -- of |the input signal, and the previous value of the output signal, to -- produce |the new value of the output signal. foldp :: (a -> b -> b) -> b -> Signal a -> Signal b -- | Creates a signal which yields the current value of the second signal -- every |time the first signal yields. sampleOn :: Signal a -> Signal b -> Signal b -- | Create a signal which only yields values which aren't equal to the -- previous |value of the input signal. dropRepeats :: (Eq a) => Signal a -> Signal a -- | Given a signal of effects with no return value, run each effect as it -- |comes in. runSignal :: Signal (IO ()) -> IO () -- | Takes a signal and filters out yielded values for which the provided -- |predicate function returns false. filter :: (a -> Bool) -> a -> Signal a -> Signal a -- | Map a signal over a function which returns a Maybe, yielding -- only the |values inside Justs, dropping the Nothings. filterMap :: (a -> Maybe b) -> b -> Signal a -> Signal b instance GHC.Base.Functor Ramus.Internal.Signal instance GHC.Base.Applicative Ramus.Internal.Signal instance Data.Semigroup.Semigroup (Ramus.Internal.Signal a) module Ramus.Time type Time = Float millisecond :: Time second :: Time -- | Creates a signal which yields the current time (according to -- now) every |given number of milliseconds. every :: Time -> Signal Time -- | Returns the number of milliseconds since an arbitrary, but constant, -- time |in the past. now :: IO Time -- | Takes a signal and delays its yielded values by a given number of -- |milliseconds. delay :: Time -> Signal a -> Signal a -- | Takes a signal and a time value, and creates a signal which yields -- True |when the input signal yields, then goes back to -- False after the given |number of milliseconds have elapsed, -- unless the input signal yields again |in the interim. since :: Time -> Signal a -> Signal Bool -- | Takes a signal and a time value, and creates a signal which waits to -- yield |the next result until the specified amount of time has elapsed. -- It then |yields only the newest value from that period. New events -- during the debounce |period reset the delay. debounce :: Time -> Signal a -> Signal a module Ramus.DOM module Ramus.Channel newtype Channel a Channel :: (Signal a) -> Channel a -- | Creates a channel, which allows you to feed arbitrary values into a -- signal. channel :: a -> IO (Channel a) -- | Sends a value to a given channel. send :: Channel a -> a -> IO () -- | Takes a channel and returns a signal of the values sent to it. subscribe :: Channel a -> Signal a