5

is it possible in ML catch every possible exception? for example if I don't know what exception might be

BenMorel
  • 34,448
  • 50
  • 182
  • 322
rookie
  • 7,723
  • 15
  • 49
  • 59

1 Answers1

10

The handle statement lets you pattern match exceptions, so you can use something like handle _ to match anything, e.g.

hd [] handle _ => 0
Ismail Badawi
  • 36,054
  • 7
  • 85
  • 97