#haskell - Tue 20 Feb 2007 between 00:00 and 00:12



sorearkc5tja: yes, but ...
kc5tja: ghc, nhc96, jhc : all Haskell->C
kc5tjao_O? I thought ghc compiled to object files directly.
sorearkc5tja: jhc is whole program mega optimizing, first order, pointsto analyser, all that fun stuff.
emkI'm trying to find out if any interesting monad laws apply to commutative monads.
sorearkc5tja: GHC generates C--, then either prettyprints C (-fvia-C) or compiles it using a builtin C-- compiler (-fasm)
kc5tjaIs it GNU-specific C, or portable ANSI C?
sorearworse
GNU specific + arch deps
ghc -fvia-C -unreg gives you "ANSI" C, but still wordsize specific.
kc5tjaIs it possible to bolt on another C-- backend?
Oh, that's fine.
sorearjhc generates wordsize independent ANSI C
kc5tjaI 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.
sorearthe reg in -unreg stands for global register variables - very archdep
zbrowni see
oops.
sorearI *believe* ghc has an emit-c-- option, but its not exactly formal C--. pretty close, but...
kc5tjaIf it is specified well enough to make an independent backend for it, then that'll do.
brb -- laundry, and food.
sorear@where commentary
lambdabothttp://hackage.haskell.org/trac/ghc/wiki/Commentary
sorear^^^ your reference
kc5tjakc5tja: ^^ marker for when I get back
Dammit, it didn't highlight my name.

There we go. :)
sorearI see a bunct of bright red spaces :)
Emacs warn-trailing-whitespace mode interracts funnily with erc.
nrb23I se a bunch of blank lines
ddariusemk: Basically,you have the monad laws plus a law asserting the two implementations of liftM2 are equivalent.
emkddarius: Hmm. I need to think about that for a second...
sorearbah. somehow I had the impression commutativity referred to m1 (m2 a) vs m2 (m1 a)
commutative applicative functors FTW!
emkddarius: 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) }
sorearliftM2 f a b = liftM2 (flip f) b a
ddariusemk: 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):

Page: 2 9 16 23 30 37 44 51 58 65 72 79 86 93 100 107 

IrcArchive