sdzx-1 / typed-fsm

typed finite-state machine

Home Page:https://hackage.haskell.org/package/typed-fsm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

typed-fsm

typed finite-state machine

Advantages of type-fsm

  1. Focus on the right message

  2. Top-to-bottom design for easy refactoring

  3. Conducive to building complex state machine systems

  • Type guarantees will not produce incorrect function calls when written
  • With the help of the type system, we can define many state processing functions and then call each other recursively with confidence.
  1. There is a sanity check. If you miss some items for pattern matching, the compiler will issue a warning, and there will also be a warning for invalid items.

Detailed design explanation

详细设计解释

Run example

Install ghc 9.10.1

This library requires you to update the ghc version to 9.10.1.

Install ghc 9.10.1 using ghcup

ghcup install ghc 9.10.1

1. Mouse Motion Example

msg exmaple explanation

cabal run motion --flags="BuildExample"

2. ATM FSM Example

Original design: msg confidence-in-types

My design: atm-new

cabal run atm --flags="BuildExample"

result: atm-gui

About

typed finite-state machine

https://hackage.haskell.org/package/typed-fsm

License:MIT License


Languages

Language:Haskell 100.0%