Re:Having a Go - first time experience with Golang
by Peaker on Monday July 09, 2012 @03:06PM
(#4219821)
Well, if List<T> is invariant on the T, then you cannot usefully have lists parameterized on interfaces, which is losing a useful ability. I'd say that classifies as a thorny edge case.
In Haskell, I can represent the type:
(Show a, Ord a) => [a]
It seems like the same is impossible in C# due to generics' interaction with inheritance.
In Haskell, I can represent the type:
It seems like the same is impossible in C# due to generics' interaction with inheritance.