Change-Id: Ifbbe3bca6988b0a090f456ae8d9dbaa808c89e19 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8867 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
16 lines
555 B
Haskell
16 lines
555 B
Haskell
module ValidationParseT where
|
|
|
|
import Control.Selective (Selective)
|
|
import Data.Functor.Compose (Compose (..))
|
|
import PossehlAnalyticsPrelude
|
|
|
|
-- | A simple way to create an Applicative parser that parses from some environment.
|
|
--
|
|
-- Use with DerivingVia. Grep codebase for examples.
|
|
newtype ValidationParseT env m a = ValidationParseT {unValidationParseT :: env -> m (Validation (NonEmpty Error) a)}
|
|
deriving
|
|
(Functor, Applicative, Selective)
|
|
via ( Compose
|
|
((->) env)
|
|
(Compose m (Validation (NonEmpty Error)))
|
|
)
|