8 ms·
>Hmm, I think you could do something similar to QuickCheck using C# generics You can't do this. Quick check can generate type classes instances, for example, f
by solomatov 13y ago
>Hmm, I think you could do something similar to QuickCheck using C# generics
You can't do this. Quick check can generate type classes instances, for example, for tuples, functions, etc. This is impossible in language like C#.
- SamReidHughes 13y agoNo it's not. The feature C# calls reflection lets you inspect types and generate them automatically.
- solomatov 13y agoIf we use reflection, we might know about error only in runtime. What haskell does is guaranteed to work at compile time. That's why it's so cool.
- Locke1689 13y agoThere are certainly cases which aren't expressible(things which require kinding, for example) but your examples aren't a problem. Both tuples and functions can be represented using System F, and thus can be completely transposed into C# generics. I believe you don't understand C# generics and you should look closer at the fundamental type calculus.