old_contents: """ Random utility functions """
  
  def thread(arg, *fns):
      if len(fns) > 0:
          return thread(fns[0](arg), *fns[1:])
      else:
          return arg
  
  def identity(x):
      return x
  
  def constantly(x):
      """ Returns a function that takes any args and returns x """
      def func(*args, **kwargs):
          return x
      return func
  
new_contents: """ Random utility functions """
  from functools import wraps
  
  def thread(arg, *fns):
      if len(fns) > 0:
          return thread(fns[0](arg), *fns[1:])
      else:
          return arg
  
  def identity(x):
      return x
  
  def constantly(x):
      """ Returns a function that takes any args and returns x """
      def func(*args, **kwargs):
          return x
      return func
  
  def complement(fn):
      """ Return fn that outputs the opposite truth values of the
      input function
      """
      @wraps(fn)
      def wrapper(*args, **kwargs):
          return not fn(*args, **kwargs)
      return wrapper
  
subject: add utility to get the negative of a fn