#apache #archlinux #asterisk #centos #debian #gentoo #haskell #kde #kubuntu #lisp #math #mysql #perl #python #ruby-lang #rubyonrails #suse #ubuntu #vim #wikipedia 0 1 2 3 4 5 6 7 8 9 10 11 12
Top Prev 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 Next
#haskell
<xerox> ?hoogle glob
<lambdabot> Language.Haskell.TH.global :: Name -> ExpQ
<lambdabot> System.Win32.Mem.globalAlloc :: GlobalAllocFlags -> DWORD -> IO HGLOBAL
<lambdabot> System.Win32.Mem.globalFlags :: HGLOBAL -> IO GlobalAllocFlags
<Igloo> dons: Yeah, I haven't made the latest webpages yet, but I also don't have anything interesting to put there
<hpaste> paolino pasted "CPS parsing" at http://hpaste.org/544
<Igloo> dons: I should possibly start deleting all the homepage fields, or point them at hackage, or something
<paolino> hi, is it possible to use combinators or anyway factor up the pattern there in my paste?
<Cale> paolino: use a list comprehension
<nmessenger> you could factor the reads destruction into a function.
<dcoutts> kolmodin, yeah, we can come back to the attributes, but yeah having decided to ignore them I'm not so frustrated now. Being able to parse all of linux & glibc will be quite satisfying :-)
<dcoutts> kolmodin, actually I want to figure out how to make ebuild use my cc-wrapper for gcc so I can test it with emerge system.
<Cale> er, hmm...
<Cale> actually...
<kolmodin> dcoutts: that would be really cool
<nmessenger> maybeRead x = case reads x of {((y,_):_) -> Just y; _ -> Nothing} -- then use the maybe function to CPS
<dcoutts> kolmodin, it's probably something one can do in ebuild.sh
<Cale> case (vs1,vs2) of (x:xs, ys) -> ...; ([], y:ys) -> ...
<kolmodin> dcoutts: perhaps you could introduce a wrapper around gcc, like distcc does
<dcoutts> kolmodin, that's exactly what I do
<Cale> You don't have to have two lets like that either, you can combine them into a single let with two declarations.
<dcoutts> kolmodin, :
<dcoutts> args <- getArgs
<dcoutts> gccExitcode <- rawSystem "gcc" args
<kolmodin> dcoutts: nice. so the wrapper finds input files, runs your parser on them and log, then run gcc
<dcoutts> then I try and grok the args and run the parser and log the results
<dcoutts> so I always just run gcc, even if I can't grok the args
<kolmodin> a gcc command line parser might be useful too :)
<kolmodin> that would make it easier to implement wrappers :D
<paolino> where do I force the types ?
<kolmodin> for every argument, check if there is a file with that name, parse.. :D
<dcoutts> kolmodin, I look for the presence of a .c file in the args, and I strip out "-o foo.o"
<hpaste> Cale annotated "CPS parsing" with "another option" at http://hpaste.org/544#a1
<kolmodin> right
<dcoutts> and I ignore it if it's got -E in the args
<kolmodin> right
<nmessenger> case ((reads :: ReadS Int1) t, (reads :: ReadS Int2) t) of ...
<Cale> Indeed
<paolino> mmh so if I put up another instance of (Summa a,Show a) I have to make a big refactoring...
<hpaste> Cale annotated "CPS parsing" with "collapse let" at http://hpaste.org/544#a2
<Cale> I'm not completely sure if it's more readable like that.
<paolino> is there any way I can make that tuple a list ?
<Cale> The tricky bit is the fact that fn is being used polymorphically.
<nmessenger> which tuple? The one in the case? It's not worth it.
<Cale> why are you using reads?
<paolino> that's because a can't escape parse , right ?
<Cale> Oh, right, duh
<paolino> Cale , because I've never done any parsing :)
<Cale> What are Int1 and Int2 ?
<paolino> instances of Summa
Previous Page Next Page