fun greaterThan x =
fn y => x > y
fun filter (f, []) = []
| filter (f, x::xs) =
if f x
then x :: filter (f, xs)
else filter (f, xs)
fun shorterThan x =
fn y => String.size x < String.size y
fun shorterThan' x = let
val n = String.size x
in
fn y => n < String.size y
end
fun incrBy x =
fn y => y + x
fun map (f, []) = []
| map (f, x::xs) = f x :: map (f, xs)
fun compose (f, g) = fn x => f (g x)
fun sqrt_of_abs i = Math.sqrt (Real.fromInt (abs i))
fun sqrt_of_abs i = (Math.sqrt o Real.fromInt o abs) i
val sqrt_of_abs = Math.sqrt o Real.fromInt o abs
fun bkup f g x =
case f x
of NONE => g x
| SOME y => y