Y combinator in Haskell
fix :: (a -> a) -> a
fix f = f (fix f)
Y combinator (with sharing) -- https://hackage.haskell.org/package/base/docs/Data-Function.html#v:fix
-- https://stackoverflow.com/questions/53715841/sharing-vs-non-sharing-fixed-point-combinator
fix :: (a -> a) -> a
fix f = let x = f x in x
Y combinator (type level) type Fix :: (Type -> Type) -> Type
newtype Fix f = Fix (f (Fix f))