{- CSE 341. Y combinator in Haskell (version that fails type checking) -} -- for reference, the fix function finds the fixed point of another function fix :: (t -> t) -> t fix f = f (fix f) -- Here's the canonical definition of Y in Haskell (taken from -- http://stackoverflow.com/questions/4273413/y-combinator-in-haskell) -- y = \f -> (\x -> f (x x)) (\x -> f (x x)) -- rewritten to make f a parameter: y f = (\x -> f (x x)) (\x -> f (x x)) -- this won't type check in Haskell