       else
         fibre.run result
   else
+    # TODO: handle array and object of promises/thunks.
+
     # No idea what is it, just forwards.
     return value
 

# Waits for a promise or a thunk to end.
$wait = (value) ->
  fiber = $fiber.current

  throw new Error 'not running in a fiber' unless fiber?

  if $isPromise value


  (args...) ->
    fiber = $fiber.current
    throw new Error 'not running in a fiber' unless fiber?

    args.push (error, result) ->
      if error?
