microlens-ghc-0.4.15.1: microlens + array, bytestring, containers, transformers

Copyright | (C) 2013-2016 Edward Kmett 2015-2016 Artyom Kazak 2018 Monadfix
License | BSD-style (see the file LICENSE)
Safe Haskell | Trustworthy
Language | Haskell2010

Lens.Micro.GHC

Contents

- Orphan instances

Description

By importing this module you get all functions and types from microlens, as well as the following instances:

- `at` for `Map`, `Set`, `IntMap` and `IntSet`

- `ix` for

  - `Map`, `Set`, `IntMap` and `IntSet`
  - `Array` and `UArray`
  - `Seq`
  - strict `ByteString` and lazy `ByteString`
  - `Tree`
- `each` for the same as above, excluding `Set` and `IntSet`

- `_head`, `_tail`, `_init`, `_last` for

  - `Seq`
  - strict and lazy bytestrings

- `strict` and `lazy` for

  - bytestrings
  - `StateT`, `WriterT`, `RWST`

Synopsis

- module Lens.Micro
- packedBytes :: IsByteString t => Lens' [Word8] t
- unpackedBytes :: IsByteString t => Lens' t [Word8]
- packedChars :: IsByteString t => Lens' String t
- unpackedChars :: IsByteString t => Lens' t String
- chars :: IsByteString t => Traversal' t Char

# Documentation

module Lens.Micro

packedBytes :: IsByteString t => Lens' [Word8] t Source #

Treat a list of bytes as a strict or lazy `ByteString`.

unpackedBytes :: IsByteString t => Lens' t [Word8] Source #

Treat a strict or lazy `ByteString` as a list of bytes.

packedChars :: IsByteString t => Lens' String t Source #

Treat a `String` as a strict or lazy `ByteString`. (Note that it will garble characters above 0xFF, same as `pack` does.)

unpackedChars :: IsByteString t => Lens' t String Source #

Treat a strict or lazy `ByteString` as a `String`. (Just as `packedChars`, it will garble characters above 0xFF.)

chars :: IsByteString t => Traversal' t Char Source #

Traverse characters in a strict or lazy `ByteString` (to traverse bytes instead of characters, use `each`).

# Orphan instances

At IntSet Source # |
Instance details Methods at :: Index IntSet -> Lens' IntSet (Maybe (IxValue IntSet)) Source #
Ixed ByteString Source # |
Instance details Methods ix :: Index ByteString -> Traversal' ByteString (IxValue ByteString) Source #
Ixed ByteString Source # |
Instance details Methods ix :: Index ByteString -> Traversal' ByteString (IxValue ByteString) Source #
Ixed IntSet Source # |
Instance details Methods ix :: Index IntSet -> Traversal' IntSet (IxValue IntSet) Source #
Strict ByteString ByteString Source # |
Instance details Methods strict :: Lens' ByteString ByteString Source # lazy :: Lens' ByteString ByteString Source #
Cons ByteString ByteString Word8 Word8 Source # |
Instance details Methods _Cons :: Traversal ByteString ByteString (Word8, ByteString) (Word8, ByteString) Source #
Cons ByteString ByteString Word8 Word8 Source # |
Instance details Methods _Cons :: Traversal ByteString ByteString (Word8, ByteString) (Word8, ByteString) Source #
(a ~ Word8, b ~ Word8) => Each ByteString ByteString a b Source # |
Instance details Methods each :: Traversal ByteString ByteString a b Source #
(a ~ Word8, b ~ Word8) => Each ByteString ByteString a b Source # |
Instance details Methods each :: Traversal ByteString ByteString a b Source #
Snoc ByteString ByteString Word8 Word8 Source # |
Instance details Methods _Snoc :: Traversal ByteString ByteString (ByteString, Word8) (ByteString, Word8) Source #
Snoc ByteString ByteString Word8 Word8 Source # |
Instance details Methods _Snoc :: Traversal ByteString ByteString (ByteString, Word8) (ByteString, Word8) Source #
At (IntMap a) Source # |
Instance details Methods at :: Index (IntMap a) -> Lens' (IntMap a) (Maybe (IxValue (IntMap a))) Source #
Ord k => At (Set k) Source # |
Instance details Methods at :: Index (Set k) -> Lens' (Set k) (Maybe (IxValue (Set k))) Source #
Ixed (IntMap a) Source # |
Instance details Methods ix :: Index (IntMap a) -> Traversal' (IntMap a) (IxValue (IntMap a)) Source #
Ixed (Seq a) Source # |
Instance details Methods ix :: Index (Seq a) -> Traversal' (Seq a) (IxValue (Seq a)) Source #
Ord k => Ixed (Set k) Source # |
Instance details Methods ix :: Index (Set k) -> Traversal' (Set k) (IxValue (Set k)) Source #
Ixed (Tree a) Source # |
Instance details Methods ix :: Index (Tree a) -> Traversal' (Tree a) (IxValue (Tree a)) Source #
Cons (Seq a) (Seq b) a b Source # |
Instance details Methods _Cons :: Traversal (Seq a) (Seq b) (a, Seq a) (b, Seq b) Source #
Each (IntMap a) (IntMap b) a b Source # |
Instance details Methods each :: Traversal (IntMap a) (IntMap b) a b Source #
Each (Seq a) (Seq b) a b Source # |
Instance details Methods each :: Traversal (Seq a) (Seq b) a b Source #
Each (Tree a) (Tree b) a b Source # |
Instance details Methods each :: Traversal (Tree a) (Tree b) a b Source #
Snoc (Seq a) (Seq b) a b Source # |
Instance details Methods _Snoc :: Traversal (Seq a) (Seq b) (Seq a, a) (Seq b, b) Source #
Ord k => At (Map k a) Source # |
Instance details Methods at :: Index (Map k a) -> Lens' (Map k a) (Maybe (IxValue (Map k a))) Source #
(IArray UArray e, Ix i) => Ixed (UArray i e) Source # |
Instance details Methods ix :: Index (UArray i e) -> Traversal' (UArray i e) (IxValue (UArray i e)) Source #
Ord k => Ixed (Map k a) Source # |
Instance details Methods ix :: Index (Map k a) -> Traversal' (Map k a) (IxValue (Map k a)) Source #
Ix i => Ixed (Array i e) Source # |
Instance details Methods ix :: Index (Array i e) -> Traversal' (Array i e) (IxValue (Array i e)) Source #
(Ix i, IArray UArray a, IArray UArray b, i ~ j) => Each (UArray i a) (UArray j b) a b Source # |
Instance details Methods each :: Traversal (UArray i a) (UArray j b) a b Source #
c ~ d => Each (Map c a) (Map d b) a b Source # |
Instance details Methods each :: Traversal (Map c a) (Map d b) a b Source #
(Ix i, i ~ j) => Each (Array i a) (Array j b) a b Source # |
Instance details Methods each :: Traversal (Array i a) (Array j b) a b Source #
Strict (StateT s m a) (StateT s m a) Source # |
Instance details Methods strict :: Lens' (StateT s m a) (StateT s m a) Source # lazy :: Lens' (StateT s m a) (StateT s m a) Source #
Strict (WriterT w m a) (WriterT w m a) Source # |
Instance details Methods strict :: Lens' (WriterT w m a) (WriterT w m a) Source # lazy :: Lens' (WriterT w m a) (WriterT w m a) Source #
Strict (RWST r w s m a) (RWST r w s m a) Source # |
Instance details Methods strict :: Lens' (RWST r w s m a) (RWST r w s m a) Source # lazy :: Lens' (RWST r w s m a) (RWST r w s m a) Source #