Definition of functions

Functions are defined in terms of equations:


square x = x * x
min x y = if x <= y then x else y

-- We may also create conditional / guarded equations (piecewise function)
min x y
	| x <= y 	= x
	| x > y 	= y

sign x
	| x < 0		= -1
	| x == 0	= 0
	| x > 0 	= 1