conditional-restriction-parser-0.1.0.4: Parser and interpreter of OpenStreetMap conditional restriction values
Safe HaskellSafe-Inferred
LanguageHaskell2010

ConditionalRestriction.Result

Description

A simple result type. Similar to the Either type, but tuned for results with an error type.

Synopsis

Documentation

data Result e a Source #

The Result type consists of an error type e and a success type a.

Constructors

Err e 
Ok a 

Instances

Instances details
Bifunctor Result Source # 
Instance details

Defined in ConditionalRestriction.Result

Methods

bimap :: (a -> b) -> (c -> d) -> Result a c -> Result b d #

first :: (a -> b) -> Result a c -> Result b c #

second :: (b -> c) -> Result a b -> Result a c #

Applicative (Result e) Source # 
Instance details

Defined in ConditionalRestriction.Result

Methods

pure :: a -> Result e a #

(<*>) :: Result e (a -> b) -> Result e a -> Result e b #

liftA2 :: (a -> b -> c) -> Result e a -> Result e b -> Result e c #

(*>) :: Result e a -> Result e b -> Result e b #

(<*) :: Result e a -> Result e b -> Result e a #

Functor (Result e) Source # 
Instance details

Defined in ConditionalRestriction.Result

Methods

fmap :: (a -> b) -> Result e a -> Result e b #

(<$) :: a -> Result e b -> Result e a #

Monad (Result e) Source # 
Instance details

Defined in ConditionalRestriction.Result

Methods

(>>=) :: Result e a -> (a -> Result e b) -> Result e b #

(>>) :: Result e a -> Result e b -> Result e b #

return :: a -> Result e a #

(Show e, Show a) => Show (Result e a) Source # 
Instance details

Defined in ConditionalRestriction.Result

Methods

showsPrec :: Int -> Result e a -> ShowS #

show :: Result e a -> String #

showList :: [Result e a] -> ShowS #

(Eq e, Eq a) => Eq (Result e a) Source # 
Instance details

Defined in ConditionalRestriction.Result

Methods

(==) :: Result e a -> Result e a -> Bool #

(/=) :: Result e a -> Result e a -> Bool #

fromResult :: a -> Result e a -> a Source #

Result equivalent to fromMaybe.