optics-core-0.2: Optics as an abstract interface: core definitions

Safe HaskellNone
LanguageHaskell2010

Optics.Empty.Core

Description

This module defines the AsEmpty class, which provides a Prism for a type that may be _Empty.

Note that orphan instances for this class are defined in the Optics.Empty module from optics-extra, so if you are not simply depending on optics you may wish to import that module instead.

>>> isn't _Empty [1,2,3]
True
>>> case Nothing of { Empty -> True; _ -> False }
True
Synopsis

Documentation

class AsEmpty a where Source #

Class for types that may be _Empty.

Minimal complete definition

Nothing

Methods

_Empty :: Prism' a () Source #

>>> isn't _Empty [1,2,3]
True

_Empty :: (Monoid a, Eq a) => Prism' a () Source #

>>> isn't _Empty [1,2,3]
True
Instances
AsEmpty Ordering Source # 
Instance details

Defined in Optics.Empty.Core

AsEmpty () Source # 
Instance details

Defined in Optics.Empty.Core

Methods

_Empty :: Prism' () () Source #

AsEmpty Event Source # 
Instance details

Defined in Optics.Empty.Core

Methods

_Empty :: Prism' Event () Source #

AsEmpty All Source # 
Instance details

Defined in Optics.Empty.Core

Methods

_Empty :: Prism' All () Source #

AsEmpty Any Source # 
Instance details

Defined in Optics.Empty.Core

Methods

_Empty :: Prism' Any () Source #

AsEmpty IntSet Source # 
Instance details

Defined in Optics.Empty.Core

Methods

_Empty :: Prism' IntSet () Source #

AsEmpty [a] Source # 
Instance details

Defined in Optics.Empty.Core

Methods

_Empty :: Prism' [a] () Source #

AsEmpty (Maybe a) Source # 
Instance details

Defined in Optics.Empty.Core

Methods

_Empty :: Prism' (Maybe a) () Source #

AsEmpty (ZipList a) Source # 
Instance details

Defined in Optics.Empty.Core

Methods

_Empty :: Prism' (ZipList a) () Source #

AsEmpty (First a) Source # 
Instance details

Defined in Optics.Empty.Core

Methods

_Empty :: Prism' (First a) () Source #

AsEmpty (Last a) Source # 
Instance details

Defined in Optics.Empty.Core

Methods

_Empty :: Prism' (Last a) () Source #

AsEmpty a => AsEmpty (Dual a) Source # 
Instance details

Defined in Optics.Empty.Core

Methods

_Empty :: Prism' (Dual a) () Source #

(Eq a, Num a) => AsEmpty (Sum a) Source # 
Instance details

Defined in Optics.Empty.Core

Methods

_Empty :: Prism' (Sum a) () Source #

(Eq a, Num a) => AsEmpty (Product a) Source # 
Instance details

Defined in Optics.Empty.Core

Methods

_Empty :: Prism' (Product a) () Source #

AsEmpty (IntMap a) Source # 
Instance details

Defined in Optics.Empty.Core

Methods

_Empty :: Prism' (IntMap a) () Source #

AsEmpty (Seq a) Source # 
Instance details

Defined in Optics.Empty.Core

Methods

_Empty :: Prism' (Seq a) () Source #

AsEmpty (Set a) Source # 
Instance details

Defined in Optics.Empty.Core

Methods

_Empty :: Prism' (Set a) () Source #

(AsEmpty a, AsEmpty b) => AsEmpty (a, b) Source # 
Instance details

Defined in Optics.Empty.Core

Methods

_Empty :: Prism' (a, b) () Source #

AsEmpty (Map k a) Source # 
Instance details

Defined in Optics.Empty.Core

Methods

_Empty :: Prism' (Map k a) () Source #

(AsEmpty a, AsEmpty b, AsEmpty c) => AsEmpty (a, b, c) Source # 
Instance details

Defined in Optics.Empty.Core

Methods

_Empty :: Prism' (a, b, c) () Source #

pattern Empty :: forall a. AsEmpty a => a Source #

Pattern synonym for matching on any type with an AsEmpty instance.

>>> case Nothing of { Empty -> True; _ -> False }
True