ramus: Elm signal system for Haskell

[ library, mit, other ] [ Propose Tags ] [ Report a vulnerability ]

Ramus is a direct port of purescript-signal into Haskell, offering the Elm signal system for Haskell.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.0.1, 0.1.0, 0.1.1, 0.1.2
Dependencies base (>=4 && <5) [details]
License MIT
Author
Maintainer Nikita Tchayka
Category Other
Home page https://github.com/NickSeagull/ramus#readme
Bug tracker https://github.com/NickSeagull/ramus/issues
Source repo head: git clone https://github.com/NickSeagull/ramus
Uploaded by NickSeagull at 2017-02-07T21:23:26Z
Distributions LTSHaskell:0.1.2, NixOS:0.1.2, Stackage:0.1.2
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 3199 total (12 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for ramus-0.1.2

[back to package description]

Ramus

Ramus is a lightweight FRP-like library heavily inspired by the Elm Signal implementation, in fact, it's a direct port of the purescript-signal library, in Haskell. Where possible and sensible, it tries to maintain API equivalence with Elm.

See the Elm documentation for details on usage and principles.

Haskell Usage Patterns

Haskell depends on IO to manage side effects, where Elm's runtime generally manages them for you. ramus provides the Signal.runSignal function for running effectful signals.

module Main where

import Signal

hello :: Signal String
hello = constant "Hello Joe!"

helloEffect :: Signal (IO ())
helloEffect = hello ~> print

main :: IO ()
main = runSignal helloEffect

This simple example takes a constant signal which contains the string "Hello Joe!" and maps it over the print function, which has the type (Show a) => a -> IO(), thus taking the String content of the signal and turning it into an effect which logs the provided string to the user's console.

This gives us a Signal (IO ()). We use runSignal to take the signal of effects and run each effect in turn—in our case, just the one effect which prints "Hello Joe!" to the console.

API Documentation

Usage Examples

  • TODO