Lens.Micro.GHC.Internal

microlens-ghc-0.4.14.3: 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.Internal

Contents

- Unpacking bytestrings
- Converting bytestrings between strict and lazy
- Traversing bytestrings

Description

Synopsis

- class IsByteString t where
  - packedBytes :: Lens' [Word8] t
  - unpackedBytes :: Lens' t [Word8]
  - packedChars :: Lens' String t
  - unpackedChars :: Lens' t String
  - chars :: Traversal' t Char
- unpackStrict :: ByteString -> [Word8]
- unpackStrict8 :: ByteString -> String
- unpackLazy :: ByteString -> [Word8]
- unpackLazy8 :: ByteString -> String
- fromStrict :: ByteString -> ByteString
- toStrict :: ByteString -> ByteString
- traversedStrictTree :: Traversal' ByteString Word8
- traversedStrictTree8 :: Traversal' ByteString Char
- traversedLazy :: Traversal' ByteString Word8
- traversedLazy8 :: Traversal' ByteString Char

# Documentation

class IsByteString t where #

Methods

packedBytes :: Lens' [Word8] t #

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

unpackedBytes :: Lens' t [Word8] #

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

packedChars :: Lens' String t #

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

unpackedChars :: Lens' t String #

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

chars :: Traversal' t Char #

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

#### Instances

Instances details

IsByteString ByteString # |
Instance details Defined in Lens.Micro.GHC.Internal Methods packedBytes :: Lens' [Word8] ByteString # unpackedBytes :: Lens' ByteString [Word8] # packedChars :: Lens' String ByteString # unpackedChars :: Lens' ByteString String # chars :: Traversal' ByteString Char #
IsByteString ByteString # |
Instance details Defined in Lens.Micro.GHC.Internal Methods packedBytes :: Lens' [Word8] ByteString # unpackedBytes :: Lens' ByteString [Word8] # packedChars :: Lens' String ByteString # unpackedChars :: Lens' ByteString String # chars :: Traversal' ByteString Char #

# Unpacking bytestrings

unpackStrict :: ByteString -> [Word8] #

unpackStrict8 :: ByteString -> String #

unpackLazy :: ByteString -> [Word8] #

unpackLazy8 :: ByteString -> String #

# Converting bytestrings between strict and lazy

fromStrict :: ByteString -> ByteString #

toStrict :: ByteString -> ByteString #

# Traversing bytestrings

traversedStrictTree :: Traversal' ByteString Word8 #

traversedStrictTree8 :: Traversal' ByteString Char #

traversedLazy :: Traversal' ByteString Word8 #

traversedLazy8 :: Traversal' ByteString Char #