code: function fold(foldVar,foldLam,foldApp){
      return function go(term){
        switch (term.ctor){
          case "Var": return foldVar(term.index);
          case "Lam": return foldLam(go(term.body));
          case "App": return foldApp(go(term.func),go(term.argm));
        };
      };
    }
docs: ∀ a . (Number -> a), (a, a -> a), (a -> a), Term -> a Replaces constructors by functions.