Finit state machine writen in typescript
Do-notation implemented with generators for fp-ts ecosystem.