by evanpw · 11y ago · 0 comments
I'm not an expert in Rust or Haskell, though, so I welcome corrections.
I'm not sure exactly what you mean, but my naive interpretation is that you can:
Prelude> :t map show
map show :: Show a => [a] -> [String]The difference being that in your code you can only put in a single type at a time, eg [Int] or [String], but not both Int and String under the common Show interface type.
data Showable = forall a. Show a => Showable a
This allows for [Showable 1, Showable "foo", Showable 'x']
(It requires the ExistentialQuantification language feature.)Which seems to me to be effectively the same as `Barrable` in this case, although it's more generic.