https://github.com/robrix/ui-effects
An experiment towards a UI programming model inspired by algebraic effects.
https://github.com/robrix/ui-effects
algebraic-effects
Last synced: about 1 year ago
JSON representation
An experiment towards a UI programming model inspired by algebraic effects.
- Host: GitHub
- URL: https://github.com/robrix/ui-effects
- Owner: robrix
- License: bsd-3-clause
- Created: 2016-09-03T22:50:19.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-05-15T03:52:17.000Z (about 9 years ago)
- Last Synced: 2025-03-30T20:04:05.906Z (about 1 year ago)
- Topics: algebraic-effects
- Language: Haskell
- Homepage:
- Size: 578 KB
- Stars: 30
- Watchers: 5
- Forks: 1
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# UI effects
An experiment exploring a UI programming model inspired by algebraic effects.
## Languages
An algebraic effect system such as [Oleg Kiselyov’s presentation](http://okmij.org/ftp/Haskell/extensible/) might model individual effects as the combination of a functor and a handler function which performs the actions represented in the datatype. In like fashion, the current work represents each aspect of UI programming—layouts, drawings, interactions, etc.—as a functor with an associated function to perform its actions.
Where we start to diverge is to think of these functors as being _languages_ instead of _effects_, and of their corresponding functions as _interpreters_ instead of _handlers_.
To be precise, each language is an embedded DSL. Each functor has associated “smart” constructors which wrap a single, nonrecursive value up into a recursive structure, and the result is an idiomatic Haskell API presenting the facilities offered by the language in question.