
On 12/10/06, Alfonso Acosta
On 12/10/06, Taral
wrote: Sure it is. The type you gave (MyType Int Char -> MyType a b) can easily crash your program.
Ok I see. Why would that happen? I'm (maybe wrongly) taking as granted that the compiler/interpreter uses the same internal representation for both types. But that makes me think it shouldn't be that dangerous if nothing is later assumed about the type parameters "a" and "b".
1. The Haskell Report does not guarantee that these things have the
same representation.
2. Assuming that a polymorphic type will never be made monomorphic is
like running without a safety net. The typecheck will not save you,
and it'll be a pain to debug if it goes wrong. If you're not using
those type parameters, then wrap it up so they can't be used.
Why not post some code snippets so we can see what you're doing?
--
Taral