Hi Twan,

On Fri, Jan 18, 2008 at 01:34:17AM +0100, Twan van Laarhoven wrote:
> 
> I have finished converting the ghc compiler to do notation. Here is a 
> patchset.

Great stuff, thanks!

> The patchset is split into 99 patches, most of which touch one file each.

I've applied most of the patches.

I didn't apply these because they contained or caused conflicts:

Added Applicative instance for UniqSM
Monadify rename/RnExpr: use do, return and standard monad functions
Monadify rename/RnSource: use do, return and standard monad functions
Monadify typecheck/TcHsSyn: use do, return and standard monad functions
All monads with a unique supply now use MonadUnique
Monadify rename/RnEnv: use do, return and standard monad functions

Or these because they touch cmm, codeGen, nativeGen (and thus would
cause lots of conflicts with the branch that Simon mentioned):

Renamed the AGraph composition operator from <*> to <#> for compatability with 
Applicative
Replace remaining uses of getUniqueUs etc. by MonadUnique functions
Monadify codeGen/CgBindery: use return and standard monad functions
Monadify codeGen/CgCallConv: use return and standard monad functions
Monadify codeGen/CgCase: use return and standard monad functions
Monadify codeGen/CgClosure: use return and standard monad functions
Monadify codeGen/CgCon: use return and standard monad functions
Monadify codeGen/CgExpr: use do, return and standard monad functions
Monadify codeGen/CgHeapery: use return and standard monad functions
Monadify codeGen/CgLetNoEscape: use return and standard monad functions
Monadify codeGen/CgStackery: use return and standard monad functions
Monadify codeGen/CgUtils: use standard monad functions
Monadify codeGen/CgTailCall: use return and standard monad functions
Monadify codeGen/CodeGen: use return and standard monad functions
Monadify codeGen/CgMonad: custom monad functions are no longer needed
Monadify nativeGen/RegLiveness: use return
Monadify nativeGen/MachCodeGen: use do, return and standard monad functions
Monadify nativeGen/AsmCodeGen: use return and standard monad functions
Monadify nativeGen/NCGMonad: use the State monad instead of a custom thing


I noticed that there are a few uses of these:

Applicative
(<$>)
(<*>)
(>=>)
(=<<)

that we might want to eliminate again, as per Simon's comment, but I
decided that if we do then the easiest way would be to apply the patches
as they are and then remove the uses of them in later patches.

(I might have already removed all the (>=>)s as it's a new function, so
bootstrapping with 6.6 fails).

> The next phase of the ghc code cleanup

A couple of things I noticed, that you might be interested in having a
look at:

In ghci/RtClosureInspect.hs,
    trIO :: IO a -> TR a 
    trIO = liftTcM . liftIO
looks to me like it should be removed, and uses replaced with liftIO.

Also, this change in your
  Monadify deSugar/Match: use do, return, applicative, standard monad functions
patch looks like an error to me?:

hunk ./compiler/deSugar/Match.lhs 375
-Replace the `as' pattern @x@@p@ with the pattern p and a binding @x = [EMAIL 
PROTECTED]
+Replace the `as' pattern @xp@ with the pattern p and a binding @x = do [EMAIL 
PROTECTED]


Thanks
Ian

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to