ex1 3¶
Basic Info¶
Functional Programming
└── Lab ML
└── 0321
└── ex1 3.sml
Preview¶
(*Improve the powerset function by using a let and computing the powerset of the tail only once*)
fun powerSet(nil) = [nil]
| powerSet(x::xs) =
let
val L = powerSet(xs)
in
L @ insertAll(x,L)
end
;