Functional Programming

Functional Programming

Mar 23, 2022 FunctionalProgramming, Programming

Issues

What makes an approach better or worse is how easily it leads to a good implementation.[1]

One typical issue is that possible values of variables are larger/wider than the correct ones for states.[1] These needs to be tried to contrained and compilers can’t help with this at all.

Another issue may be how to implement constrains of state transitions, which also relies on implementations only.[1]

3rd, changing states in-place makes state-tracking a must[1].

Solutions

Making states as parameters to be passed in is a way to avoid tracking them within functions.[1]

Use types of parameters can avoid inconsistency of state transitions.[1]

Bibliography

[1]
“A typed purely-functional state machine | nVotes online voting system.” https://nvotes.com/a-typed-purely-functional-state-machine/.

No notes link to this note

comments powered by Disqus