Skip to content

Instantly share code, notes, and snippets.

@philss
Created December 27, 2016 03:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philss/3dcdaed890d720b8e9fc632bae403bac to your computer and use it in GitHub Desktop.
Save philss/3dcdaed890d720b8e9fc632bae403bac to your computer and use it in GitHub Desktop.

Mutual recursion

Every finete state machine that does not need to hold state can be represented by a mutual recursive pair (or more) of functions.

ML specific

You can implement mutual recursion using the built-in and keyword between functions. It is also possible to implement it using a higher order function (a function that receives another function).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment