Hi,
I'm working on another article like
http://www.linuxjournal.com/article/8850. 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
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
currTokType
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.
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
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 code to
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 = Type
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
___