3 ms·
If you really want it, you can get safe dynamic typing in Haskell using the Data.Dynamic module. However, since you don't really want it, it's a library that is
by tikhonj 13y ago
If you really want it, you can get safe dynamic typing in Haskell using the Data.Dynamic module. However, since you don't really want it, it's a library that isn't introduced in basic tutorials.
This gives you a pragmatic equivalent to no-check, but is almost never used in practice because it turns out to be unnecessary.
- tel 13y agoEvery now and then I reinvent Data.Dynamic. By this point I'm pretty far into the realm of "probably not worth it", but hitting Data.Dynamic is usually an unignorable indication that I'm going to regret this code.
- dmytrish 13y agoAlso, GHC from version 7.6.1 supports a flag to defer type errors until run time[1]: -fdefer-type-errors. This is not support for dynamic types, but still gives even more flexibility in type-error handling. [1] http://ghc.haskell.org/trac/ghc/wiki/DeferErrorsToRuntime http://ghc.haskell.org/trac/ghc/wiki/DeferErrorsToRuntime