Zulip Chat Archive

Stream: general

Topic: instance alternative exceptional


Jannis Limperg (Jan 30 2020 at 14:25):

I noticed that there's no instance of alternative for the exceptional from init.meta.exceptional. Should this instance be added? Two reasons I can think of not to do it:

  • failure would rarely be useful since it doesn't give an informative error message (but then we could still have an instance has_orelse exceptional).
  • orelse doesn't short-circuit like in Haskell, so can give unintuitive (if you come from Haskell) performance characteristics.

Last updated: Dec 20 2023 at 11:08 UTC