compose :: BL.ByteString -> BL.ByteString -> IO String
compose sourceConfig template = do
    case decodeConfiguration sourceConfig of
        Left err ->
            error $ "Invalid Configuration: " ++ err

        Right config -> do
            envelopes <- mapConcurrently fetchComponent (contents config)
            return $ renderComponents template envelopes
compose :: BL.ByteString -> BL.ByteString -> IO String
compose sourceConfig template = do
    case decodeConfiguration sourceConfig of
        Left err ->
            error $ "Invalid Configuration: " ++ err

        Right config -> do
            envelopes <- mapConcurrently fetchComponent (contents config)
            return $ renderComponents template envelopes
compose sourceConfig template = do
    case decodeConfiguration sourceConfig of
        Left err ->
            error $ "Invalid Configuration: " ++ err

        Right config -> do
            envelopes <- mapConcurrently fetchComponent (contents config)
            return $ renderComponents template envelopes