This demo implements control of simplified ATM. ATM consists of four resources:
Supported operations:
- Checking account balance
- Cash withdrawal
Currently there are two alternative implementations of the program:
-
[sequentional (step by step) computatition](https://github.com/oofp/beseder-demo-apps/blob/master/atm-demo/src/Beseder/Atm/AtmApp.hs
The demo are using Beseder feature of deriving resource declaration from type class that describe resource behavior. As a bonus, it also creates state diagram that provides visual presentation of resource behavior.
AtmLoopApp.hs
This implementation is similar to traditional loop with state defined as ADT. Just that with Beseder state variants are inferred. All possible resource state combinations are shown and state transitions are shown below:
- The users enters its own phone number abd destination number
- First call reaches the caller's phone and then call is placed to destination.
- During call setup, user is listening to the ringback tone.
- Once destination answered the call, both parties are connected.
- At any time user can cancel or hang up.
- Once parties are connected, the user can mute herself.
- Web UI will be implemented using Server Driven UI Beseder binding