Comment by antonvs

3 months ago

https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/or_p...

I'm confused about something. According to https://www.haskell.org/ghc/ version 9.10.3 was released on 2025-09-10. How is there a version 9.12.1 listed for the or-patterns feature? Are these versions for different things?

  • They're versions of the same thing, and 9.12.1 was chronologically before 9.10.3. It looks like you can find the entire chronology at https://www.haskell.org/ghc/blog.html

    • OK, side note, whoever decides the GHC release numbers should be pulled aside and given a quick talk about how version numbers are supposed to work.

      Anyway, looks like or-patterns just landed as a GHC extension:

          foo (Bar; Baz) = 0
      

      I still like OCaml's (built-in) syntax better:

          let foo (Bar | Baz) = 0
      

      Which I feel stems from its elegant decision to use the pipe character as the 'alternative pattern prefix':

          let foo = function
            | Bar
            | Baz -> 0

      3 replies →