Hi,
I am a beginner for haskell. I was stuck with a sample of programming
in haskell. Following is my code:
-
import Prelude hiding (return, fail)
type Parser a = (String-[(a,String)])
return :: a - Parser a
return v =
Prelude so that the one you declared locally is used.
Michael
On Tue, Mar 16, 2010 at 9:09 PM, 国平张 zhangguop...@gmail.com wrote:
Hi,
I am a beginner for haskell. I was stuck with a sample of programming
in haskell. Following is my code
Sorry to bother again. I just cannot figure out how it could compile.
I got compile errors.
Can someone point out what is right code to use a do notion to make a
Parser works.
Thanks in advance.
newtype
, modules loaded: none.
2010/3/19 Stephen Tetley stephen.tet...@gmail.com:
On 19 March 2010 04:35, 国平张 zhangguop...@gmail.com wrote:
Sorry to bother again. I just cannot figure out how it could compile.
I got compile errors.
Can someone point out what is right code to use a do notion to make a
Parser
stephen.tet...@gmail.com 写道:
2010/3/19 国平张 zhangguop...@gmail.com:
Sorry. The same error, This is new stuff.
Ah indeed - I didn't spot that one as I only read the code rather than ran it.
With the change the parser type to use /newtype/ all the primitive
parsers have to be encoded inside
Hi,
I wrote a type program to compute fibonacci series, if the max value
is big, then it becomes very slow.
like
take 100 fib
How can I make it faster :-)
fibo 0 = 0
fibo 1 = 1
fibo (n+2) = (fibo n) + (fibo (n+1))
fib :: [Int]
fib = [fibo i | i - [0..]]
sorry. My mistake :-). I wanted to send to haskell-cafe, so I just
pick up a mail thread and send reply. But I forgot to change the
title.
Sorry again for it.
2010/3/24 Ivan Miljenovic ivan.miljeno...@gmail.com:
On 24 March 2010 15:46, 国平张 zhangguop...@gmail.com wrote:
I wrote a type program
Hi,
I wrote a type program to compute fibonacci series, if the max value
is big, then it becomes very slow.
like
take 100 fib
How can I make it faster :-)
fibo 0 = 0
fibo 1 = 1
fibo (n+2) = (fibo n) + (fibo (n+1))
fib :: [Int]
fib = [fibo i | i - [0..]]