lens-witherable-0.2.0.2: lens-compatible tools for working with witherable
Copyright(c) Carl Howells 2021-2022
LicenseMIT
Maintainerchowells79@gmail.com
Safe HaskellSafe-Inferred
LanguageHaskell2010

Witherable.Lens.Withering

Description

This module contains a replacement for MaybeT intended for use in lens-like contexts. The important difference from MaybeT is that Withering drops the short-circuiting behavior that requires Monad constraints.

Synopsis

Documentation

newtype Withering f a Source #

A replacement for MaybeT with no short-circuiting behavior. This allows its Applicative instance to not require f to be an instance of Monad.

Constructors

Withering 

Fields

Instances

Instances details
Applicative f => Applicative (Withering f) Source # 
Instance details

Defined in Witherable.Lens.Withering

Methods

pure :: a -> Withering f a #

(<*>) :: Withering f (a -> b) -> Withering f a -> Withering f b #

liftA2 :: (a -> b -> c) -> Withering f a -> Withering f b -> Withering f c #

(*>) :: Withering f a -> Withering f b -> Withering f b #

(<*) :: Withering f a -> Withering f b -> Withering f a #

Functor f => Functor (Withering f) Source # 
Instance details

Defined in Witherable.Lens.Withering

Methods

fmap :: (a -> b) -> Withering f a -> Withering f b #

(<$) :: a -> Withering f b -> Withering f a #

Show (f (Maybe a)) => Show (Withering f a) Source # 
Instance details

Defined in Witherable.Lens.Withering

Methods

showsPrec :: Int -> Withering f a -> ShowS #

show :: Withering f a -> String #

showList :: [Withering f a] -> ShowS #

Eq (f (Maybe a)) => Eq (Withering f a) Source # 
Instance details

Defined in Witherable.Lens.Withering

Methods

(==) :: Withering f a -> Withering f a -> Bool #

(/=) :: Withering f a -> Withering f a -> Bool #

Ord (f (Maybe a)) => Ord (Withering f a) Source # 
Instance details

Defined in Witherable.Lens.Withering

Methods

compare :: Withering f a -> Withering f a -> Ordering #

(<) :: Withering f a -> Withering f a -> Bool #

(<=) :: Withering f a -> Withering f a -> Bool #

(>) :: Withering f a -> Withering f a -> Bool #

(>=) :: Withering f a -> Withering f a -> Bool #

max :: Withering f a -> Withering f a -> Withering f a #

min :: Withering f a -> Withering f a -> Withering f a #

empty :: Applicative f => Withering f a Source #

A Withering value wrapping Nothing. This cannot be part of an Alternative instance for Withering because it needs to be available with only an Applicative constraint on f, and any lawful Alternative instance would require more structure than that.