Can you emulate rust’s Fn trait using type classes? In Rust, there is no type for functions, but rather an Fn trait that looks something like this: