wiki:FirstPrinciples/UnnecessaryWrapping

Unnecessary Function Wrapping

if e then true else false

is equivalent to just evaluating expression e

fun f x = g x

is just equivalent to binding f = g and then calling f x

This is the same with curried functions

fun sum xs = fold (fn (acc,x) => acc+x) 0 xs

is just equivalent to partial application of a curried fold

val sum = fold (fn (acc,x) => acc+x) 0

Haskell has uniform synta - every functions is a curried one, so every binding is just a binding.

Last modified 2 years ago Last modified on Nov 1, 2018, 10:40:13 AM
Note: See TracWiki for help on using the wiki.