Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/simre1/simple-events

An implementation for event networks in haskell.
https://github.com/simre1/simple-events

frp haskell

Last synced: 13 days ago
JSON representation

An implementation for event networks in haskell.

Awesome Lists containing this project

README

        

# SimpleEvents

**Status: Experimental**

SimpleEvents is a very lightweight library for defining event networks with the only dependencies being base and containers.

Here is a short example if one wishes to try out this library:

```haskell
import SimpleEvents

eventExample :: IO ()
eventExample = do
(inputEvent, inputTrigger) <- newEvent

reactimate (("You wrote: " ++) <$> inputEvent) $
simpleEventHandler putStrLn

putStrLn "Try to write something!"
putStrLn "PS: \"quit\" halts the example."

let gatherInput = do
t <- getLine
case t of
"quit" -> mempty
str -> triggerEvent inputTrigger str >> gatherInput

gatherInput
```