Skip to content

Instantly share code, notes, and snippets.

View paciook's full-sized avatar
⛈️
Typing...

Fran Pacio paciook

⛈️
Typing...
View GitHub Profile
@paciook
paciook / fix.md
Created May 1, 2024 21:21
How fix works

Giving these definitions (let is found in Haskell documentation):

fix :: (a -> a) -> a
fix f = let x = f x in x
fact = fix (\f -> \x -> if x <= 1 then x else x * f (x-1))

I'll try to explain how fix works.

Let's reduce fact