[Haskell-cafe] type variable in class instance
corentin.dupont at gmail.com
Tue Sep 11 00:06:15 CEST 2012
I wasn't aware of Data.Dynamic.
*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')...
On Mon, Sep 10, 2012 at 11:33 PM, Stephen Tetley
<stephen.tetley at 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?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe