0

I've in mind something akin to the F# mechanism described here. In looking into it, I've found nothing explicitly saying it does nor that it doesn't.

1 Answers1

3

Neither the Definition of Standard ML from 1990 nor the Definition of Standard ML (Revised) from 1997 defines pattern guards.

There have been some proposals to support them — see https://github.com/SMLFamily/Successor-ML/wiki/Summary-of-proposed-changes — but I think the only implementation that does so is 'HaMLeT S'. In particular, neither MLton nor SMLNJ seems to support them (see http://mlton.org/SuccessorML and https://smlnj.org/doc/features.html, respectively).

ruakh
  • 175,680
  • 26
  • 273
  • 307
  • There is a paper and prototype for sml/nj given at last years ML workshop https://github.com/JohnReppy/compiling-pattern-guards which the paper says "We plan to incorporate it in a upcoming reimplementation of pattern matching in the Standard ML of New Jersey system" – matt Feb 06 '20 at 08:33