 
 _emptyFn = ()->
 
-cutFlowsByArity = (flowFns, arity)->
-  debug 'cutFlowsByArity  ', arity     
-  for fn, inx in flowFns
-    debug 'fn.length', fn.length
-    if not _isArray(fn) and fn.length is arity
-      return flowFns[inx..] 
-  return []
+# cutFlowsByArity = (flowFns, arity)->
+#   debug 'cutFlowsByArity  ', arity     
+#   for fn, inx in flowFns
+#     debug 'fn.length', fn.length
+#     if not _isArray(fn) and fn.length is arity
+#       return flowFns[inx..] 
+#   return []
 
 unifyErrors = (errors)->
   errs = errors.filter (err)-> err 


runFlow = (flowFns, err, args, outCallback)->
  debug 'runFlow start', err, args
  errorHandlerArity = args.length + 2 # include err, callback
  if err
    flowFns = cutFlowsByArity(flowFns, errorHandlerArity)    
  
  return outCallback err, args... if flowFns.length is 0 
  
  [fn, fns...] = flowFns  

  if _isArray fn 
    fnArr = fn.map (flow)->  

    catch error
      fnDone error

_fn.delay = (msec, fn)->
  return (args...)->
    setTimeout ()->
      fn args...
    , msec  

_fn.wrap = (preFns,postFns)->
  preFns = [preFns] unless _isArray preFns
