-- | High-level helper to get span info with less boilerplate.
spanAndOffs :: Maybe Span -> MaybeT Conversion SpanAndOffs
spanAndOffs mbSpan = do
    aSpan <- hoistMaybe mbSpan
    offs <- MaybeT (spanToOffsets aSpan)
    return $! SpanAndOffs aSpan offs

-- | A range in bytes.
spanAndOffs :: Maybe Span -> MaybeT Conversion SpanAndOffs
spanAndOffs mbSpan = do
    aSpan <- hoistMaybe mbSpan
    offs <- MaybeT (spanToOffsets aSpan)
    return $! SpanAndOffs aSpan offs

-- | A range in bytes.
spanAndOffs mbSpan = do
    aSpan <- hoistMaybe mbSpan
    offs <- MaybeT (spanToOffsets aSpan)
    return $! SpanAndOffs aSpan offs

-- | A range in bytes.