[Haskell-cafe] request for code review

2006-03-05 Thread Shannon -jj Behrens
Hi, I'm working on another article like . This time, I'm taking an exercise out of "Expert C Programming: Deep C Secrets" and translating it into Haskell. The program translates C type declarations into English. I would greatly appreciate some code rev

Re: [Haskell-cafe] request for code review

2006-03-05 Thread Neil Mitchell
Hi, You seem to like let a lot, whereas I hardly ever use them. In general I find where a lot more readable. (disclaimer, all notes untested, may not compile, may be wrong) Also, most haskell programs use $ instead of |> > -- For convenience: > currTokType :: ParseContext -> TokenType > currTok

Re: [Haskell-cafe] request for code review

2006-03-05 Thread Brian Hulley
Neil Mitchell wrote: stackTop ctx = let (x:xs) = stack ctx in x stackTop ctx = head ctx stackTop ParseContext{stack=x:_} = x or: stackTop ctx = head (stack ctx) ===stackTop ctx = head . stack $ ctx ===stackTop = head . stack Regards, Brian. _

[Haskell-cafe] beginner question - file handling

2006-03-05 Thread Richard Gooding
Hi, can someone please point me at some code to read in the lines for a file - a working example ? I've have checked the tutorials on the wiki (some broken links) but couldn't find anything. - and my "The craft of functiional programming" doesn't have an example either ! thanks Rich __

Re: [Haskell-cafe] beginner question - file handling

2006-03-05 Thread Neil Mitchell
Hi do x <- readFile "test.txt" print (length (lines x)) That prints out the number of lines in a file, but once you have done lines x, you can do anything you want to the lines Thanks Neil On 3/5/06, Richard Gooding <[EMAIL PROTECTED]> wrote: > Hi, > > can someone please point me at some

Re: [Haskell-cafe] request for code review

2006-03-05 Thread Scott Turner
On 2006 March 05 Sunday 05:43, Shannon -jj Behrens wrote: > classifyString s        = Token (whichType s) s >   where whichType "volatile" = Qualifier >         whichType "void"     = Type >         whichType "char"     = Type >         whichType "signed"   = Type >         whichType "unsigned" = T

[Haskell-cafe] Haskell documentation and GADTs

2006-03-05 Thread Jim Apple
I'm having trouble generating automatic documentation in a module with GADTs. Haddock gives a parse error, and http://www.cse.ogi.edu/~hallgren/Programatica/tools/features.html seems to indicate that Programmatica will as well. Any ideas? Jim ___ Haskel