werewolf-1.5.2.0: A game engine for playing werewolf within an arbitrary chat client

Copyright(c) Henry J. Wylde 2016
LicenseBSD3
Maintainerpublic@hjwylde.com
Safe HaskellSafe
LanguageHaskell2010

Control.Lens.Extra

Contents

Description

Extra utility functions for working with lenses.

Synopsis

Documentation

Folds

is :: Getting Any s a -> s -> Bool Source #

The counter-part to isn't, but more general as it takes a Getting instead.

is = has

isn't :: Getting All s a -> s -> Bool Source #

A re-write of isn't to be more general by taking a Getting instead.

isn't = hasn't

hasuse :: MonadState s m => Getting Any s a -> m Bool Source #

Check to see if this Fold or Traversal matches 1 or more entries in the current state.

hasuse = gets . has

hasn'tuse :: MonadState s m => Getting All s a -> m Bool Source #

Check to see if this Fold or Traversal has no matches in the current state.

hasn'tuse = gets . hasn't

Traversals

filteredBy :: Eq b => Lens' a b -> b -> Traversal' a a Source #

A companion to filtered that, rather than using a predicate, filters on the given lens for matches.