11 Sep
2012
11 Sep
'12
6:06 a.m.
Hi Stephen, I wasn't aware of Data.Dynamic. I tried: *viewEvent :: Dynamic -> IO () viewEvent event = do case fromDynamic event of Nothing -> return () Just (Message s) -> putStrLn $ show s* But still got the same error (Ambiguous type variable `t0' in the constraint: (Typeable t0) arising from a use of `fromDynamic')... Best, Corentin On Mon, Sep 10, 2012 at 11:33 PM, Stephen Tetley <stephen.tetley@gmail.com>wrote:
Whilst dynamic typing isn't idiomatic for Haskell, it seems like you've decided you want it. So why not use Data.Dynamic rather than roll you're own dynamic typing with Typeable?