Hack subset

Functional Hack assumes a subset of Hack, wherein all of the following restrictions apply:

  • no partial mode;
  • no instanceof, is_string, etc;
  • no side-effects1;
  • no exceptions;
  • no use of operators on generic types or mixed.

Specifically, Functional Hack:

  • treats mixed as if it has exactly one value;
  • may call a passed-in function many times under the assumption that it's pure;
  • will take Eq, Ord, and Semigroup instances to perform comparisons and arithmetic.

    1. Except the very last expression in the main script, which calls IO#unsafePerform.