hxt-9.3.1.22: A collection of tools for processing XML with Haskell.

Safe Haskell | Safe-Inferred
Language | Haskell2010

Data.Function.Selector

Synopsis

- data Selector s a = S {
  - getS :: s -> a
  - setS :: a -> s -> s
  }
- chgS :: Selector s a -> (a -> a) -> s -> s
- chgM :: Monad m => Selector s a -> (a -> m a) -> s -> m s
- mkSelector :: (s -> a) -> (a -> s -> s) -> Selector s a
- idS :: Selector s s
- (.&&&.) :: Selector s a -> Selector s b -> Selector s (a, b)
- class Comp1 s a | s -> a where
  - comp1 :: Selector s a
- class Comp2 s a | s -> a where
  - comp2 :: Selector s a
- class Comp3 s a | s -> a where
  - comp3 :: Selector s a

# Documentation

data Selector s a Source #

A Selector is a pair of an access function and a modifying function for reading and updating parts of a composite type

Constructors

S |

Fields

- getS :: s -> a
- setS :: a -> s -> s

#### Instances

Instances details

Category Selector Source # |
Instance details Defined in Data.Function.Selector Methods id :: Selector a a Source # (.) :: Selector b c -> Selector a b -> Selector a c Source #

chgS :: Selector s a -> (a -> a) -> s -> s Source #

chgM :: Monad m => Selector s a -> (a -> m a) -> s -> m s Source #

mkSelector :: (s -> a) -> (a -> s -> s) -> Selector s a Source #

Alias for constructor S

idS :: Selector s s Source #

(.&&&.) :: Selector s a -> Selector s b -> Selector s (a, b) infixr 3 Source #

class Comp1 s a | s -> a where Source #

Selectors for pairs and 3-tuples: comp1, comp2, comp3, this can be extended to n-tuples

Methods

comp1 :: Selector s a Source #

#### Instances

Instances details

Comp1 (a, b) a Source # |
Instance details Defined in Data.Function.Selector Methods comp1 :: Selector (a, b) a Source #
Comp1 (a, b, c) a Source # |
Instance details Defined in Data.Function.Selector Methods comp1 :: Selector (a, b, c) a Source #

class Comp2 s a | s -> a where Source #

Methods

comp2 :: Selector s a Source #

#### Instances

Instances details

Comp2 (a, b) b Source # |
Instance details Defined in Data.Function.Selector Methods comp2 :: Selector (a, b) b Source #
Comp2 (a, b, c) b Source # |
Instance details Defined in Data.Function.Selector Methods comp2 :: Selector (a, b, c) b Source #

class Comp3 s a | s -> a where Source #

Methods

comp3 :: Selector s a Source #

#### Instances

Instances details

Comp3 (a, b, c) c Source # |
Instance details Defined in Data.Function.Selector Methods comp3 :: Selector (a, b, c) c Source #