| instance Typeable a = Typeable (MVar a) where
| typeOf x =
| mkAppTy (mkTyCon Control.Concurrent.MVar.MVar) [typeOf
(undefined::a)]
As I think you now know, the above declaration is fine if you use
-fglasgow-exts. Haskell 98 does not support lexically scoped type
variables, but GHC
Hello Experts,
I need MVar and Chan to be instances of Typeable. Any hint on how this is most
easily done would be greatly appreciated. I could change the libraries and
add 'deriving Typeable' but I hesitate to do so.
Cheers,
Ben
___
Haskell-Cafe
On Fri, Nov 05, 2004 at 01:57:53PM +0100, Benjamin Franksen wrote:
Hello Experts,
I need MVar and Chan to be instances of Typeable. Any hint on how this is most
easily done would be greatly appreciated. I could change the libraries and
add 'deriving Typeable' but I hesitate to do so.
The
On Friday 05 November 2004 15:51, you wrote:
On Fri, Nov 05, 2004 at 01:57:53PM +0100, Benjamin Franksen wrote:
Hello Experts,
I need MVar and Chan to be instances of Typeable. Any hint on how this is
most easily done would be greatly appreciated. I could change the
libraries and add
nstance Typeable a = Typeable (MVar a) where
typeOf (x::x) =
mkAppTy (mkTyCon Control.Concurrent.MVar.MVar) [typeOf (undefined::x)]
Keean.
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
On Friday 05 November 2004 16:20, MR K P SCHUPKE wrote:
nstance Typeable a = Typeable (MVar a) where
typeOf (x::x) =
mkAppTy (mkTyCon Control.Concurrent.MVar.MVar) [typeOf
(undefined::x)]
I may be missing something but this look like an open recursion to me. The
type 'x' is 'MVar a',
On Friday 05 November 2004 13:57, Benjamin Franksen wrote:
Hello Experts,
I need MVar and Chan to be instances of Typeable. Any hint on how this is
most easily done would be greatly appreciated. I could change the libraries
and add 'deriving Typeable' but I hesitate to do so.
Ok, I found a
On Fri, 5 Nov 2004 14:43:55 +0100
Benjamin Franksen [EMAIL PROTECTED] wrote:
snip
the instances by hand. My first attempt was:
instance Typeable a = Typeable (MVar a) where
typeOf x =
mkAppTy (mkTyCon Control.Concurrent.MVar.MVar) [typeOf (undefined::a)]
but unfortunately this
My mistake:
instance Typeable a = Typeable (MVar a) where
typeOf (x::MVar x) =
mkAppTy (mkTyCon Control.Concurrent.MVar.MVar) [typeOf (undefined::x)]
Keean.
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
On Friday 05 November 2004 15:07, Benjamin Franksen wrote:
instance Typeable a = Typeable (MVar a) where
typeOf x =
mkAppTy (mkTyCon Control.Concurrent.MVar.MVar) [typeOf y]
where
y = unsafePerformIO $ do
z - newEmptyMVar = readMVar
return (z `asTypeOf` x)
On Fri, Nov 05, 2004 at 01:57:53PM +0100, Benjamin Franksen wrote:
Hello Experts,
I need MVar and Chan to be instances of Typeable. Any hint on how this is most
easily done would be greatly appreciated. I could change the libraries and
add 'deriving Typeable' but I hesitate to do so.
11 matches
Mail list logo