• KSP Atlas@sopuli.xyz
    link
    fedilink
    arrow-up
    2
    ·
    10 hours ago

    In haskell, any function with a name made entirely out of symbols (like + or >>=) works as an infix operator (you can turn any function into an infix operator using backticks)

    • palordrolap@fedia.io
      link
      fedilink
      arrow-up
      1
      ·
      8 hours ago

      Now that you mention it, I do remember the backticks and symbols thing for infix, so yeah that’d be something extra that Haskell did. One of the few things about Haskell that wasn’t on the fringes of my capability and understanding as I recall.

      I remember thinking that it would be cool if other, more procedural, languages allowed it, but then most other languages also don’t have the capability of setting the precedence of new operators relative to old ones on the fly. A lot of that stuff is hard-coded into those languages’ compilers.