-- | Helper to run initalization step for wire
-- TODO: move to core package
withInit :: (c -> GameMonadT AppMonad a) -> (a -> AppWire c b) -> AppWire c b 
withInit initStep nextStep = mkGen $ \s c -> do 
  a <- initStep c
  (mb, nextStep') <- stepWire (nextStep a) s (Right c)
  return (mb, nextStep')

-- | Inhibits if gets Nothing
withInit :: (c -> GameMonadT AppMonad a) -> (a -> AppWire c b) -> AppWire c b
withInit initStep nextStep = mkGen $ \s c -> do 
  a <- initStep c
  (mb, nextStep') <- stepWire (nextStep a) s (Right c)
  return (mb, nextStep')

-- | Inhibits if gets Nothing
withInit initStep nextStep = mkGen $ \s c -> do 
  a <- initStep c
  (mb, nextStep') <- stepWire (nextStep a) s (Right c)
  return (mb, nextStep')

-- | Inhibits if gets Nothing