Google
 
Web unafbapune.blogspot.com

Sunday, January 29, 2012

 

Ex 4.46 reverse

Write your own definition of a Haskell operation "reverse" that reverses a list.

Solution:

myreverse :: [a] -> [a]
myreverse [] = []
myreverse (x:xs) = myreverse xs ++ [x]

Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?