4 ms·
You can easily do this even in a language like C#, it's just that the syntactic overhead can be a bit much: interface Transducer<A,B> { Func<R,B,R>
by kvb 12y ago
You can easily do this even in a language like C#, it's just that the syntactic overhead can be a bit much:
interface Transducer<A,B> {
Func<R,B,R> Apply<R>(Func<R,A,R> f);
}
- tel 12y agoThat's awesome! I wasn't aware C# had them.
- kvb 12y agoYes, higher rank types are no problem for C# or Java generics. It's higher-kinder types that are unavailable.
- bmurphy1976 12y agoI took this as a challenge. I wasn't entirely confident with my understanding, so I created a fully realized version in C# available here: https://github.com/bmurphy1976/transducers-dotnet https://github.com/bmurphy1976/transducers-dotnet