fix :: (a -> a) -> a
fix f = f (fix f)
f :: [Int] -> [Int]
f xs = 1 : map (*2) xs
take 7 (fix f) ==> [1,2,4,8,16,32,64]
Looks right to me. fix :: (a -> a) -> a
fix f = f (fix f)
f :: [Int] -> [Int]
f xs = 1 : map (*2) xs
take 7 (fix f) ==> [1,2,4,8,16,32,64]
Looks right to me.No comments yet.