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

Copyright | (c) Henry J. Wylde 2016
License | BSD3
Maintainer | public@hjwylde.com
Safe Haskell | Safe
Language | Haskell2010

Control.Lens.Extra

Contents

- Folds
- Traversals

Description

Extra utility functions for working with lenses.

Synopsis

- module Control.Lens
- is :: Getting Any s a -> s -> Bool
- isn't :: Getting All s a -> s -> Bool
- hasuse :: MonadState s m => Getting Any s a -> m Bool
- hasn'tuse :: MonadState s m => Getting All s a -> m Bool
- filteredBy :: Eq b => Lens' a b -> b -> Traversal' a a

# Documentation

module Control.Lens

# 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.