If we were to create a Rust version of this page for Haskell, what cool programming techniques would you add to it?

  • @[email protected]OP
    link
    fedilink
    English
    16 hours ago

    Yea it’s like when we writeSome(2). It’s not a function call but a variant of the Option enum.

    • @[email protected]
      link
      fedilink
      25 hours ago

      Enum constructors are functions, this typechecks:

      fn foo<T>() {
          let f: fn(T) -> Option<T> = Some;
      }
      

      I was a bit apprehensive because rust has like a gazillion different function types but here it seems to work like just any other language with a HM type system.