packages feed

hydra-0.5.0: src/main/haskell/Hydra/Flows.hs

-- | Functions and type class implementations for working with Hydra's built-in Flow monad

module Hydra.Flows where

import Hydra.Kernel

import qualified Control.Monad as CM
import qualified System.IO as IO


fromFlowIo :: s -> Flow s a -> IO.IO a
fromFlowIo cx f = case mv of
    Just v -> return v
    Nothing -> CM.fail $ traceSummary trace
  where
    FlowState mv _ trace = unFlow f cx emptyTrace