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 be.
I am thinking maybe you want iterate
*Main> take 5 $ iterate (+1) 0
[0,1,2,3,4]
It would be easier to understand your
desired function if you would provide an example of desired usage.
t.
PR Stanley <prstanley@ntlworld.com> Sent by: haskell-cafe-bounces@haskell.org
09/19/2007 02:17 AM
To
haskell-cafe@haskell.org
cc
Subject
[Haskell-cafe] Missing Symbol (2)
Hi
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@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
---
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.