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
Paul, The Hutton book has gotten great reviews, but pouring over a faulty OCRd version can only be counterproductive. I highly recommend Yet Another Haskell Tutorial[1]. After that you can check out all the other wonderful online resources (starting here [2]). At that point a few OCR errors won't be able to stand in your way! Best wishes on you Haskell explorations, Joel [1] http://www.cs.utah.edu/~hal/docs/daume02yaht.pdf [2] http://haskell.org/haskellwiki/Learning_Haskell
This looks like foldr, specifically: f = foldr (.) v so really, there's no way of telling what the operator could be, other than that: (.) :: a -> b -> b where f :: [a] -> b v :: b BTW, I find that most of your emails are in a very large font size. Do other people notice this? It's not very nice to read. Gmail's 'Show Original' feature tells me that the HTML version of your message contains <font size=3> near the start. On 19/09/2007, PR Stanley <prstanley@ntlworld.com> wrote:
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
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.
participants (4)
-
Joel Koerwer -
PR Stanley -
Rodrigo Queiro -
Thomas Hartman