bodil/purescript-signal
{ "createdAt": "2014-09-19T20:27:49Z", "defaultBranch": "master", "description": "Elm style FRP library for PureScript", "fullName": "bodil/purescript-signal", "homepage": null, "language": "PureScript", "name": "purescript-signal", "pushedAt": "2022-04-30T07:51:12Z", "stargazersCount": 259, "topics": [], "updatedAt": "2025-08-20T13:19:15Z", "url": "https://github.com/bodil/purescript-signal"}purescript-signal
Section titled “purescript-signal”Signal is a lightweight FRP-like library heavily inspired by the Elm Signal implementation. Where possible and sensible, it tries to maintain API equivalence with Elm.
See the Elm documentation for details on usage and principles.
PureScript Usage Patterns
Section titled “PureScript Usage Patterns”PureScript depends on effects (specifically, the Effect monad) to manage side effects, where Elm’s runtime generally manages them for you. purescript-signal provides the Signal.runSignal function for running effectful signals.
module Main where
import Effect.Consoleimport Effect (Effect)import Preludeimport Signal
hello :: Signal Stringhello = constant "Hello Joe!"
helloEffect :: Signal (Effect Unit)helloEffect = hello ~> log
main = runSignal helloEffectThis simple example takes a constant signal which contains the string "Hello Joe!" and maps it over the Effect.Console.log function, which has the type String -> Effect Unit, 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 (Effect Unit). 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
Section titled “API Documentation”Usage Examples
Section titled “Usage Examples”- The canonical Elm Mario: https://github.com/michaelficarra/purescript-demo-mario
- Ponies: https://github.com/bodil/purescript-is-magic