subs (x:xs) = yss ++ map (x:) yss
              where
                yss = subs xs

{-

subs [3]
= subs [] ++ map (3:) subs []
= [[]] ++ map (3:) [[]]
= [[]] ++ [[3]]
= [[],[3]]

subs [2,3]
= subs [3] ++ map (2:) subs [3]
= [[],[3]] ++ map (2:) [[],[3]]
= [[],[3]] ++ [[2],[2,3]]
= [[],[3],[2],[2,3]]

subs [1,2,3]
= subs [2,3] ++ map (1:) (subs [2,3])
= [[],[3],[2],[2,3]] ++ map (1:) [[],[3],[2],[2,3]]
= [[],[3],[2],[2,3],[1],[1,3],[1,2],[1,2,3]]

-}
subs (x:xs) = yss ++ map (x:) yss
              where
                yss = subs xs

{-

subs [3]
= subs [] ++ map (3:) subs []
= [[]] ++ map (3:) [[]]
= [[]] ++ [[3]]
= [[],[3]]

subs [2,3]
= subs [3] ++ map (2:) subs [3]
= [[],[3]] ++ map (2:) [[],[3]]
= [[],[3]] ++ [[2],[2,3]]
= [[],[3],[2],[2,3]]

subs [1,2,3]
= subs [2,3] ++ map (1:) (subs [2,3])
= [[],[3],[2],[2,3]] ++ map (1:) [[],[3],[2],[2,3]]
= [[],[3],[2],[2,3],[1],[1,3],[1,2],[1,2,3]]

-}
subs (x:xs) = yss ++ map (x:) yss
              where
                yss = subs xs

{-

subs [3]
= subs [] ++ map (3:) subs []
= [[]] ++ map (3:) [[]]
= [[]] ++ [[3]]
= [[],[3]]

subs [2,3]
= subs [3] ++ map (2:) subs [3]
= [[],[3]] ++ map (2:) [[],[3]]
= [[],[3]] ++ [[2],[2,3]]
= [[],[3],[2],[2,3]]

subs [1,2,3]
= subs [2,3] ++ map (1:) (subs [2,3])
= [[],[3],[2],[2,3]] ++ map (1:) [[],[3],[2],[2,3]]
= [[],[3],[2],[2,3],[1],[1,3],[1,2],[1,2,3]]

-}