{-# options_haddock prune, hide #-}

-- |Internal combinators for paths.
module Ribosome.Internal.Path where

import Exon (exon)

import Ribosome.Host.Data.Report (Report)

failInvalidPath ::
  Member (Stop Report) r =>
  Text ->
  Maybe a ->
  Sem r a
failInvalidPath :: forall (r :: EffectRow) a.
Member (Stop Report) r =>
Text -> Maybe a -> Sem r a
failInvalidPath Text
spec Maybe a
result =
  (HasCallStack => Sem r a) -> Sem r a
forall a. HasCallStack => (HasCallStack => a) -> a
withFrozenCallStack do
    Report -> Maybe a -> Sem r a
forall err (r :: EffectRow) a.
Member (Stop err) r =>
err -> Maybe a -> Sem r a
stopNote (Text -> Report
forall a. IsString a => Text -> a
fromText [exon|Invalid path: #{spec}|]) Maybe a
result