Skip to content

ex1 3

← Back

Basic Info

Functional Programming
└── Lab ML
    └── 0​321
        └── 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
;