Thread View: pl.comp.lang.funkcyjne
1 messages
1 total messages
Started by lowik86
Wed, 08 Aug 2007 12:05
problem z parsec
Author: lowik86
Date: Wed, 08 Aug 2007 12:05
Date: Wed, 08 Aug 2007 12:05
19 lines
1497 bytes
1497 bytes
ze strony http://legacy.cs.uu.nl/daan/download/parsec/parsec.html
wrzucilem taki kawalek kodu:
price :: Parser Int -- price in cents
price = lexeme (do{ ds1 <- many1 digit
; char '.'
; ds2 <- count 2 digit
; return (convert 0 (ds1 ++ ds2))
})
<?> "price"
where
convert n [] = n
convert n (d:ds) = convert (10*n + digitToInt d) ds
i wywala mi blad : Variable not in scope: 'digitToInt'
co robie nie tak?
musza importowac jakis modul?ale jakie?
dodaje import Char ale wtedy wywala mi mase dziwnych bledow.
z gory dzieki
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads