RadicalZephyr / sodium-rust

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

Get rid of IsLambda* traits #4

Open RadicalZephyr opened 8 months ago

RadicalZephyr commented 8 months ago

These traits are only implemented for Lambda<FN> and anything that implements FnMut of the various arities.

First of all, to nudge users in the direction of maintaining functional purity, the bound should probably be Fn not FnMut.

I believe the purpose is to allow using either a FnMut with no dependency information, or a Lambda that contains a function and also has dependency information.

It's not clear to me that this is actually serving a useful purpose, are Lambdas actually supposed to be constructed by the user? Does internal code pass Lambdas to the public API functions that take IsLambda?