| sorear | kc5tja: yes, but ... kc5tja: ghc, nhc96, jhc : all Haskell->C |
| kc5tja | o_O? I thought ghc compiled to object files directly. |
| sorear | kc5tja: jhc is whole program mega optimizing, first order, pointsto analyser, all that fun stuff. |
| emk | I'm trying to find out if any interesting monad laws apply to commutative monads. |
| sorear | kc5tja: GHC generates C--, then either prettyprints C (-fvia-C) or compiles it using a builtin C-- compiler (-fasm) |
| kc5tja | Is it GNU-specific C, or portable ANSI C? |
| sorear | worse GNU specific + arch deps ghc -fvia-C -unreg gives you "ANSI" C, but still wordsize specific. |
| kc5tja | Is it possible to bolt on another C-- backend? Oh, that's fine. |
| sorear | jhc generates wordsize independent ANSI C |
| kc5tja | I was just wondering because I'd like to run some code through a C compiler for the 65816 processor, to see how it runs on that platform. Just an experiment -- nothing production. |
| sorear | the reg in -unreg stands for global register variables - very archdep |
| zbrown | i see oops. |
| sorear | I *believe* ghc has an emit-c-- option, but its not exactly formal C--. pretty close, but... |
| kc5tja | If it is specified well enough to make an independent backend for it, then that'll do. brb -- laundry, and food. |
| sorear | @where commentary |
| lambdabot | http://hackage.haskell.org/trac/ghc/wiki/Commentary |
| sorear | ^^^ your reference |
| kc5tja | kc5tja: ^^ marker for when I get back Dammit, it didn't highlight my name. There we go. :) |
| sorear | I see a bunct of bright red spaces :) Emacs warn-trailing-whitespace mode interracts funnily with erc. |
| nrb23 | I se a bunch of blank lines |
| ddarius | emk: Basically,you have the monad laws plus a law asserting the two implementations of liftM2 are equivalent. |
| emk | ddarius: Hmm. I need to think about that for a second... |
| sorear | bah. somehow I had the impression commutativity referred to m1 (m2 a) vs m2 (m1 a) commutative applicative functors FTW! |
| emk | ddarius: Basically, if I swap the first two binding forms, I should get the same result? do { x <- a; y <- b; return (x,y) } <=> do { y <- b; x <-a; return (x,y) } |
| sorear | liftM2 f a b = liftM2 (flip f) b a |
| ddarius | emk: Yes, or more categorically, uncurry (liftM2 (,)) . swap = fmap swap . uncurry (liftM2 (,)) |
| sorear | @pl do { x <- a; y <- b; return (x,y) } === do { y <- b; x <-a; return (x,y) } |
| lambdabot | (line 1, column 4): |