3 ms·
I respectfully disagree. The "right membrane" around any untyped value is a Variant type. A static type system would then stop you making any assumptions withou
by willtim 9y ago
I respectfully disagree. The "right membrane" around any untyped value is a Variant type. A static type system would then stop you making any assumptions without unpacking and asserting its type. If we don't want variants and just want to defer type errors until runtime, then this is possible too (GHC Haskell can do this).
- ufo 9y agoGHC's Dynamic type can only contain monomorphic values, it can't handle polymorphic stuff. GHC also considers Dynamic->Dynamic and Int->Int to be incompatible types, which is not quite what one would want in a gradualy typed setting. Haskell also sidesteps the difficulties that come with mutability in a gradualyly typed setting.
- willtim 9y agoI did not mention GHC's Dynamic type. I mentioned GHC's deferred-type errors as an alternative technique to "gradual typing". I believe there were plans to implement a polymorphic version of Dynamic, but it obviously wasn't a high priority. Note that GHC does not require any special type-system extensions to support Dynamic.
- tome 9y ago> GHC's Dynamic type can only contain monomorphic values, it can't handle polymorphic stuff. Sort of. If you wrap a polymorphic type inside a monomorphic one then it can handle it fine, for example data Mono = Mono (forall a b. a -> b -> a) (But perhaps you know this)