[Haskell-cafe] Polymorphic algebraic type constructors

John Meacham john at repetae.net
Wed Jun 23 18:11:32 EDT 2004


There is a fundamental problem with assuming all []'s are equal even if
they are empty lists of different things. mainly, that they arn't! 
see

; ghci
Prelude> print ([]::[Int])
[]
Prelude> print ([]::[Char])
""

Remember, in haskell, values may depend on types. Just because the type
is not explicitly expressed in the pattern, it doesn't mean it isn't
there and passed around behind the scenes.
        John

-- 
John Meacham - ⑆repetae.net⑆john⑈ 


More information about the Haskell-Cafe mailing list