57bab040ed
I want to use these in multiple projects. Change-Id: I5dfdad8614bc5835e59df06f724de78acae78d42 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8971 Reviewed-by: Profpatsch <mail@profpatsch.de> Tested-by: BuildkiteCI
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)))
|
|
)
|