I thought I should just update you on the position wrt functional
dependencies in GHC.
Shamed by bug reports into taking up the cudgels, I re-engineered
the partial support for functional dependencies. The story is now
as follows:
GHC 4.08 does not support functional dependencies and never will
The HEAD, which will become GHCi 5.0, does not have functional
dependencies, and I think they work properly
Any brave people who like building the HEAD do please give it a whirl.
Simon
| -----Original Message-----
| From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
| Sent: 30 December 2000 01:14
| To: [EMAIL PROTECTED]
| Subject: zonkIdOcc: FunDep_a1Dc
|
|
| If I run ghc on
|
| --------------------------------------------------------------
| ------------------
|
| > module Main (main) where
|
| > data ERR a b = EOK a | ERR b deriving (Show)
| > data Error = No | Notatall deriving (Show, Eq)
|
|
| > class MonadErr m e | m -> e where
| > aerturn :: e -> m a
| > areturn :: a -> m a
| > acatch :: a -> (a -> m b) -> (e -> m b) -> m b
| > (>>>=) :: m a -> (a -> m b) -> m b
| > (>>>) :: m a -> m b -> m b
|
| > data BP a = BP (Int -> (ERR a Error, Int))
|
| > instance MonadErr BP Error where
| > aerturn k = BP $ \s -> (ERR k, s)
| > areturn k = BP $ \s -> (EOK k, s)
| > acatch k try handler = BP $ \s -> let BP try' = try k
| > (r,s1) = try' s
| > (BP c2, s2) = case r of
| >
| EOK r -> (areturn r, s1)
| >
| ERR r -> (handler r, s)
| > in c2 s2
| > a >>> b = a >>>= \_ -> b
|
| > (BP c1) >>>= fc2 = BP $ \s0 -> let (r,s1) = c1 s0
| > BP c2 = case r of
| > EOK r -> fc2 r
| > ERR r
| -> BP (\s -> (ERR r, s))
| > in c2 s1
|
| > run_BP :: Int -> BP a -> (ERR a Error, Int)
| > run_BP st (BP bp) = bp st
|
| > foo :: (ERR Int Error, Int)
| > foo = run_BP 111 (aerturn No)
|
| > main = print (show foo)
|
| --------------------------------------------------------------
| ------------------
|
| I get
|
| ghc -fglasgow-exts Er.lhs -o Er
| zonkIdOcc: FunDep_a11w
| zonkIdOcc: FunDep_a11t
| zonkIdOcc: FunDep_a11t
|
| ghc --version
| The Glorious Glasgow Haskell Compilation System, version 4.08.1
|
| What is this about? Is it dangerous? (I.e. will it break my
| executable?)
|
| Sengan
|
|
| _______________________________________________
| Glasgow-haskell-bugs mailing list
| [EMAIL PROTECTED]
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
|
_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs