def hang(nb, doc): return align(nest(nb, doc))
def align(doc): return column(lambda k: nesting(lambda i: nest(k - i, doc)))
def f(n): if n > nb_spaces: return nest(nb_spaces, lbreak()) else: return spaces(nb_spaces - n)