[Haskell-cafe] Re: Is using Data.Dynamic considered a no-go?

Achim Schneider barsoap at web.de
Thu Feb 12 12:58:18 EST 2009


Peter Verswyvelen <bugfact at gmail.com> wrote:

> Haskell seems to have pretty strong support for dynamic casting using
> Data.Typeable and Data.Dynamic.
> All kinds of funky dynamic programming seems to be possible with these
> "hacks".
> 
> Is this considered as being as bad as - say - unsafePerformIO? What
> kind of evil is lurking here?
> 
Uncertainty. Noone on #haskell seems to know how Typeable-dispatches
compare to pattern matching wrt. performance, and I was either too lazy
or too uninterested to measure it myself. Combined with a custom type
class and existentials, they safe you from writing catch-all ADTs and
thus give code flexibility (and conciseness), while retaining static
typing, modulo unexhaustive pattern warnings. This is how XHB uses
Typeable, and, IMHO, it's a Good Thing.

-- 
(c) this sig last receiving data processing entity. Inspect headers
for copyright history. All rights reserved. Copying, hiring, renting,
performance and/or quoting of this signature prohibited.




More information about the Haskell-Cafe mailing list