Ben Rudiak-Gould Benjamin.Rudiak-Gould at
Wed Feb 8 10:16:48 EST 2006

Marcin 'Qrczak' Kowalczyk wrote:
> Bulat Ziganshin <bulatz at> writes:
>> that i want to say is what the first variant allows to define type of
>> 'x' in such way that the only Show-specific operations are allowed,
> Why?

Parametricity, what else? I'd much rather pass my precious String to a 
function of type [a] -> [a] or Functor a => a Char -> a Char than to a 
function of type String -> String. Restricting an interface is a very good 
thing from a program verification standpoint. It's much the same in 
object-oriented languages, except that the existence of dynamic downcasting 
kind of spoils things. But then, Haskell has undefined and unsafePerformIO.

-- Ben

More information about the Haskell-prime mailing list