47
submitted 15 hours ago* (last edited 13 hours ago) by little_ferris@programming.dev to c/rust@programming.dev

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

you are viewing a single comment's thread
view the rest of the comments
[-] barsoap@lemm.ee 2 points 5 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.

[-] little_ferris@programming.dev 1 points 4 hours ago

Woah. That's quite interesting. I didn't know that.

this post was submitted on 16 Oct 2024
47 points (96.1% liked)

Rust

5867 readers
90 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 1 year ago
MODERATORS