Apanatshka/elm-signal-extra/2.1.1

NOTE: this package is not compatible with Elm 0.19.1

Signal.Extra

Utility functions that aren't in the Signal module from elm-lang/core.

Flipped fancy map

(~>) : Signal a -> (a -> b) -> Signal b

The (<~) operator, but flipped. Doesn't play well with the other two!

Mouse.x ~> toFloat >> sqrt >> round
        >> isEven >> not
        >> asText

Zipping and unzipping

For those too lazy to write a record or ADT.

zip : Signal a -> Signal b -> Signal ( a, b )

zip two signals

zip Mouse.x Mouse.y == Mouse.position
zip3 : Signal a -> Signal b -> Signal c -> Signal ( a, b, c )

zip three signals

zip4 : Signal a -> Signal b -> Signal c -> Signal d -> Signal ( a, b, c, d )

zip four signals

unzip : Signal ( a, b ) -> ( Signal a, Signal b )

unzip a zipped pair of signals

unzip Mouse.position == (Mouse.x, Mouse.y)
unzip3 : Signal ( a, b, c ) -> ( Signal a, Signal b, Signal c )

unzip three signals

Signal ( a, b, c, d )
-> ( Signal a, Signal b, Signal c, Signal d )

unzip four signals

Stateful

foldp' : (a -> b -> b) -> (a -> b) -> Signal a -> Signal b
foldps : (a -> s -> ( b, s )) -> ( b, s ) -> Signal a -> Signal b

Like foldp, but with a hidden state

foldp f b i ==
  let d a = (a,a) -- doubling function
  in foldps (\a b -> f a b |> d) (d b) i
foldps' : (a -> s -> ( b, s )) -> (a -> ( b, s )) -> Signal a -> Signal b

Like foldp', but with a hidden state

It seems that last does not have any docs. The module's documentation names it in an @docs line, but the package does not expose it.
delayRound : b -> Signal b -> Signal b

Instead of delaying for some amount of time, delay for one round, where a round is initiated by outside event to the Elm program. Also known to delay in E-FRP.

Old filters

The way they used to work, with weird value propagation.

It seems that keepWhenS does not have any docs. The module's documentation names it in an @docs line, but the package does not expose it.It seems that dropWhenS does not have any docs. The module's documentation names it in an @docs line, but the package does not expose it.