Article View: pl.comp.lang.funkcyjne
Article #919problem z parsec
From: 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
Technical Details
Message-ID:
<f9cbho$u8f$3@news.onet.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!not-for-mailShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!not-for-mail From: "lowik86@onet.eu" <lowik86@onet.eu> Newsgroups: pl.comp.lang.funkcyjne Subject: problem z parsec Date: Wed, 08 Aug 2007 14:05:13 +0200 Organization: Onet.pl Lines: 19 Message-ID: <f9cbho$u8f$3@news.onet.pl> NNTP-Posting-Host: blg27.neoplus.adsl.tpnet.pl Mime-Version: 1.0 X-Trace: news.onet.pl 1186574712 30991 83.28.200.27 (8 Aug 2007 12:05:12 GMT) X-Complaints-To: usenet@news.onet.pl NNTP-Posting-Date: Wed, 8 Aug 2007 12:05:12 +0000 (UTC) X-Sender: 4z7QeQq3Wc/d50GmqnhbRQ== X-Antivirus-Status: Clean X-Antivirus: avast! (VPS 000764-1, 2007-08-07), Outbound message User-Agent: Thunderbird 1.5.0.12 (Windows/20070509) Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit