Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fixpoint :: (X->X)->X
- fixpoint = /*magic*/
- f :: Int -> Int
- f x = x * 2
- print (fixpoint f) // prints "0"
- g :: String -> String
- g s = "Hello, " ++ s
- print (fixpoint f) // error, no fixed point
- foo :: (nat->nat)->(nat->nat)
- foo f =
- \n -> if n == 0 then 1 else n * f (n - 1)
- bar :: nat->nat
- bar = fixpoint foo //????
- //actually, bar is a function computing factorial
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement