-- 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.2

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 <a>Foldable</a>, returning a <a>Maybe</a>
--   which will |either contain the resulting signal, or <a>Nothing</a> if
--   the <a>Foldable</a> |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 <tt>false</tt>.
filter :: (a -> Bool) -> a -> Signal a -> Signal a

-- | Map a signal over a function which returns a <a>Maybe</a>, yielding
--   only the |values inside <a>Just</a>s, dropping the <a>Nothing</a>s.
filterMap :: (a -> Maybe b) -> b -> Signal a -> Signal b

-- | Flipped map operator
(~>) :: Signal a -> (a -> b) -> Signal b
infixl 4 ~>

-- | map operator
(<~) :: (a -> b) -> Signal a -> Signal b
infixl 4 <~

-- | Signal application. | Note that it is a double tilde, differing from |
--   purescript-signal, as a single tilde is used | in Haskell for lazy
--   evaluation.
(~~) :: Signal (a -> b) -> Signal a -> Signal b
infixl 4 ~~
map2 :: (a -> b -> c) -> Signal a -> Signal b -> Signal c
map3 :: (a -> b -> c -> d) -> Signal a -> Signal b -> Signal c -> Signal d
map4 :: (a -> b -> c -> d -> e) -> Signal a -> Signal b -> Signal c -> Signal d -> Signal e
map5 :: (a -> b -> c -> d -> e -> f) -> Signal a -> Signal b -> Signal c -> Signal d -> Signal e -> Signal f
instance GHC.Base.Functor Ramus.Internal.Signal
instance GHC.Base.Applicative Ramus.Internal.Signal
instance GHC.Base.Semigroup (Ramus.Internal.Signal a)

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

module Ramus.Time
type Time = Float
millisecond :: Time
second :: Time

-- | Creates a signal which yields the current time (according to
--   <a>now</a>) 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
--   <a>True</a> |when the input signal yields, then goes back to
--   <a>False</a> 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
