Generalizing over Generics in Rust (Part 1) - AKA Higher Kinded Types in Rust

This page summarizes the projects mentioned and recommended in the original post on /r/rust

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • rust

    Empowering everyone to build reliable and efficient software.

  • The most important family to abstract over with HKT is function pointers. Rust currently has massive problems with deriving Debug, Copy, Clone, ... for function pointers, even though they are just a usize internally. And if a struct contains a function pointer, you can't derive Debug, Copy, Clone, ... for that struct, no, you have to implement it manually. You'd either need to hack a special case into the compiler or solve the problem via HKT cleanly.

  • parser

    A parsing library, focused on simplicity and great error messages (by elm)

  • I was thinking of porting elm/parser to rust and I needed something like apply in order to implement the mechanism needed for the pipeline.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • Kategory

    Λrrow - Functional companion to Kotlin's Standard Library (by arrow-kt)

  • It's similar to how Arrow-KT implemented HKTs on top of Kotlin's type system. You have to pass concrete witnesses around there, though, which you don't have to in Rust. Rust's compiler can use traits to figure out which function to call (Kotlin lacked traits, but they're implementing generic interfaces now, something that might end up being quite similar) so you can forgo witnesses.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts