RadicalZephyr / sodium-rust

FRP implementation in Rust
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Type boilerplate makes it look like Java #14

Open RadicalZephyr opened 8 months ago

RadicalZephyr commented 8 months ago

There is quite a lot of syntactic overhead in writing Sodium code, especially when compared to the very small amounts of actual working code.

One of the major contributors to this is needing to annotate the types on the closures passed to all the combinator methods.

In an ideal world, it wouldn't be necessary to include these type annotations everywhere. Something about the current design is significantly impeding the type inference engine's ability to correctly infer types, and in some cases the error messages when you have incorrect types are actually quite bad (this might be worth reporting to the Rust compiler).

RadicalZephyr commented 8 months ago

My current suspicion about what is causing the type inference to fail is the IsLambda* traits. I haven't been able to successfully replace them in order to prove this tho.