patterns :: [[Bool]]
patterns = pats 4
 where
  pats n = init base ++ map (last base ++) (pats (n+1))
   where
    base = bits n

  bits 0 = [[]]
  bits k = [ False : bs | bs <- bits (k-1) ]
        ++ [ True  : bs | bs <- bits (k-1) ]

-------------------------------------------------------------------------
-- the end.
patterns :: [[Bool]]
patterns = pats 4
 where
  pats n = init base ++ map (last base ++) (pats (n+1))
   where
    base = bits n

  bits 0 = [[]]
  bits k = [ False : bs | bs <- bits (k-1) ]
        ++ [ True  : bs | bs <- bits (k-1) ]

-------------------------------------------------------------------------
-- the end.
patterns = pats 4
 where
  pats n = init base ++ map (last base ++) (pats (n+1))
   where
    base = bits n

  bits 0 = [[]]
  bits k = [ False : bs | bs <- bits (k-1) ]
        ++ [ True  : bs | bs <- bits (k-1) ]

-------------------------------------------------------------------------
-- the end.