|
|
|
|
|
by still_grokking
662 days ago
|
|
I didn't watch any other talks of this conference, but it looks to me as part of the issue here was that the presenter didn't explain basic (ML) types upfront. Maybe they did in other talks earlier, IDK. If you never seen such types before it may look intimidating. But if you ever seen any ML style language the type of said function looks actually very ordinary. It does not use any really more complex concepts, it's just regular nested generic types. Pretty standard stuff. In Rust you could also have things like: fn foo<'a, T, U, V, W>(a: &'a T, b: U, c: V, d: W)
where
T: MyTrait<U> + Debug + 'a,
U: Debug + Hash,
V: SomeOtherTrait<V> + Debug + std::marker::Copy,
W: Box<dyn Fn(V) -> U> + Debug,
{
todo!("Just a demo");
}
That's indeed much more involved, even it doesn't use any deeply nested wrapper types.But I think nobody would force such complex signatures on API end-users. (Even there is of course also no magic going on. It's just the quite quite expressive type language in Rust). |
|