[Haskell-cafe] unapplying function definitions?

PR Stanley prstanley at ntlworld.com
Sun May 4 12:48:58 EDT 2008

>>What on earth is unapplying function definitions?
>>The following is taken from chapter 13 of the Hutton book:
>>"...when reasoning about programs, function definitions can be both
>>applied from left to right and unapplied from right to left."
>Well, because of referential transparency, we can say that the left
>hand side of a function is exactly equal to the right hand side.
>Thus, we can instead of applying functions, and making progress
>towards a normal form, unapply them and get further away from a normal
>form... for example:
>5 = head [5,6,7,8,9] = head ([5,6] ++ [7] ++ [8,9]) = head (([] ++ [5]
>++ [6]) ++ [7] ++ [8,9]) .......
>There are of course an infinite number of ways of doing this, so it's
>usually only interesting, if we have some reason for applying a
>specific expansion.
>>What is the normal form?

More information about the Haskell-Cafe mailing list