optics-extra-0.2: Extra utilities and instances for optics-core

Safe HaskellNone
LanguageHaskell2010

Optics.Empty

Contents

Description

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

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

Documentation

class AsEmpty a where #

Class for types that may be _Empty.

Minimal complete definition

Nothing

Methods

_Empty :: Prism' a () #

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

Defined in Optics.Empty.Core

Methods

_Empty :: Prism' Ordering () #

AsEmpty () 
Instance details

Defined in Optics.Empty.Core

Methods

_Empty :: Prism' () () #

AsEmpty Event 
Instance details

Defined in Optics.Empty.Core

Methods

_Empty :: Prism' Event () #

AsEmpty All 
Instance details

Defined in Optics.Empty.Core

Methods

_Empty :: Prism' All () #

AsEmpty Any 
Instance details

Defined in Optics.Empty.Core

Methods

_Empty :: Prism' Any () #

AsEmpty ByteString Source # 
Instance details

Defined in Optics.Empty

Methods

_Empty :: Prism' ByteString () #

AsEmpty ByteString Source # 
Instance details

Defined in Optics.Empty

Methods

_Empty :: Prism' ByteString () #

AsEmpty IntSet 
Instance details

Defined in Optics.Empty.Core

Methods

_Empty :: Prism' IntSet () #

AsEmpty Text Source # 
Instance details

Defined in Optics.Empty

Methods

_Empty :: Prism' Text () #

AsEmpty Text Source # 
Instance details

Defined in Optics.Empty

Methods

_Empty :: Prism' Text () #

AsEmpty [a] 
Instance details

Defined in Optics.Empty.Core

Methods

_Empty :: Prism' [a] () #

AsEmpty (Maybe a) 
Instance details

Defined in Optics.Empty.Core

Methods

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

AsEmpty (ZipList a) 
Instance details

Defined in Optics.Empty.Core

Methods

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

AsEmpty (First a) 
Instance details

Defined in Optics.Empty.Core

Methods

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

AsEmpty (Last a) 
Instance details

Defined in Optics.Empty.Core

Methods

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

AsEmpty a => AsEmpty (Dual a) 
Instance details

Defined in Optics.Empty.Core

Methods

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

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

Defined in Optics.Empty.Core

Methods

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

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

Defined in Optics.Empty.Core

Methods

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

AsEmpty (IntMap a) 
Instance details

Defined in Optics.Empty.Core

Methods

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

AsEmpty (Seq a) 
Instance details

Defined in Optics.Empty.Core

Methods

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

AsEmpty (Set a) 
Instance details

Defined in Optics.Empty.Core

Methods

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

AsEmpty (HashSet a) Source # 
Instance details

Defined in Optics.Empty

Methods

_Empty :: Prism' (HashSet a) () #

Unbox a => AsEmpty (Vector a) Source # 
Instance details

Defined in Optics.Empty

Methods

_Empty :: Prism' (Vector a) () #

Storable a => AsEmpty (Vector a) Source # 
Instance details

Defined in Optics.Empty

Methods

_Empty :: Prism' (Vector a) () #

AsEmpty (Vector a) Source # 
Instance details

Defined in Optics.Empty

Methods

_Empty :: Prism' (Vector a) () #

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

Defined in Optics.Empty.Core

Methods

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

AsEmpty (Map k a) 
Instance details

Defined in Optics.Empty.Core

Methods

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

AsEmpty (HashMap k a) Source # 
Instance details

Defined in Optics.Empty

Methods

_Empty :: Prism' (HashMap k a) () #

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

Defined in Optics.Empty.Core

Methods

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

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

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

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

Orphan instances

AsEmpty ByteString Source # 
Instance details

Methods

_Empty :: Prism' ByteString () #

AsEmpty ByteString Source # 
Instance details

Methods

_Empty :: Prism' ByteString () #

AsEmpty Text Source # 
Instance details

Methods

_Empty :: Prism' Text () #

AsEmpty Text Source # 
Instance details

Methods

_Empty :: Prism' Text () #

AsEmpty (HashSet a) Source # 
Instance details

Methods

_Empty :: Prism' (HashSet a) () #

Unbox a => AsEmpty (Vector a) Source # 
Instance details

Methods

_Empty :: Prism' (Vector a) () #

Storable a => AsEmpty (Vector a) Source # 
Instance details

Methods

_Empty :: Prism' (Vector a) () #

AsEmpty (Vector a) Source # 
Instance details

Methods

_Empty :: Prism' (Vector a) () #

AsEmpty (HashMap k a) Source # 
Instance details

Methods

_Empty :: Prism' (HashMap k a) () #