[Haskell-cafe] Missing Symbol (2)

Thomas Hartman thomas.hartman at db.com
Wed Sep 19 10:04:40 EDT 2007

as provided, this won't compile because v hasn't been defined.

f [] = 0
f (x:xs) = x . f xs

compiles but gives 

f :: (Num (a -> c)) => [c -> c] -> a -> c

which seems wrong. maybe I'm not understanding what v is not supposed to 

I am thinking maybe you want iterate

*Main> take 5 $ iterate (+1) 0

It would be easier to understand your desired function if you would 
provide an example of desired usage.


PR Stanley <prstanley at ntlworld.com> 
Sent by: haskell-cafe-bounces at haskell.org
09/19/2007 02:17 AM

haskell-cafe at haskell.org

[Haskell-cafe] Missing Symbol (2)

Here's another one:
f [] = v
f (x:xs) = x . f xs
The "." is supposed to denote a generic operator - f [] maps to some 
value v and applied to non-empty list applies head to ? operator.
Thanks, Paul

Haskell-Cafe mailing list
Haskell-Cafe at haskell.org


This e-mail may contain confidential and/or privileged information. If you 
are not the intended recipient (or have received this e-mail in error) 
please notify the sender immediately and destroy this e-mail. Any 
unauthorized copying, disclosure or distribution of the material in this 
e-mail is strictly forbidden.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20070919/b4cf210f/attachment.htm

More information about the Haskell-Cafe mailing list