memorable-bits-0.1.0.1: Generate human memorable strings from binary data.

Safe HaskellNone
LanguageHaskell2010

Data.Memorable

Contents

Synopsis

Documentation

renderMemorable :: (MemRender p, Depth p ~ MemLen a, Memorable a) => Proxy p -> a -> String Source #

This is the function to use when you want to turn your values into a memorable strings.

>>> import Data.Word
>>> import Data.Memorable.Theme.Words
>>> let myPattern = words8 .- words8
>>> renderMemorable myPattern (0x0123 :: Word16)
"cats-bulk"

parseMemorable :: (Memorable a, MemRender p, MemLen a ~ Depth p) => Proxy p -> String -> Maybe a Source #

Turn a memorable string back into a Memorable value.

rerender :: (MemRender a, MemRender b, Depth a ~ Depth b) => Proxy a -> Proxy b -> String -> Maybe String Source #

Convert a memorable string into a different memorable string.

Useful for things like taking an existing md5, and converting it into a memorable one.

>>> :set -XTypeApplications -XDataKinds
>>> import Data.Memorable.Theme.Words
>>> rerender hex (padHex @128 $ four words10) "2d4fbe4d5db8748c931b85c551d03360"
Just "lurk-lash-atop-hole-b8748c931b85c551d03360"

class Memorable a where Source #

Class for all things that can be converted to memorable strings. See renderMemorable for how to use.

Associated Types

type MemLen a :: Nat Source #

Methods

renderMem :: MonadPut m => a -> Coding m () Source #

parserMem :: MonadGet m => Coding m a Source #

Instances
Memorable Int8 Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen Int8 :: Nat Source #

Memorable Int16 Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen Int16 :: Nat Source #

Memorable Int32 Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen Int32 :: Nat Source #

Memorable Int64 Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen Int64 :: Nat Source #

Memorable Word8 Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen Word8 :: Nat Source #

Memorable Word16 Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen Word16 :: Nat Source #

Memorable Word32 Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen Word32 :: Nat Source #

Memorable Word64 Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen Word64 :: Nat Source #

Memorable Word256 Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen Word256 :: Nat Source #

Memorable Int256 Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen Int256 :: Nat Source #

Memorable Word224 Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen Word224 :: Nat Source #

Memorable Int224 Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen Int224 :: Nat Source #

Memorable Word192 Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen Word192 :: Nat Source #

Memorable Int192 Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen Int192 :: Nat Source #

Memorable Word160 Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen Word160 :: Nat Source #

Memorable Int160 Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen Int160 :: Nat Source #

Memorable Word128 Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen Word128 :: Nat Source #

Memorable Int128 Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen Int128 :: Nat Source #

Memorable Word96 Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen Word96 :: Nat Source #

Memorable Int96 Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen Int96 :: Nat Source #

Memorable IP4 Source #
>>> renderMemorable threeWordsFor32Bits (ip4FromOctets 127 0 0 1)
"shore-pick-pets"
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen IP4 :: Nat Source #

Memorable IP6 Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen IP6 :: Nat Source #

Memorable (Digest Blake2b_512) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest Blake2b_512) :: Nat Source #

Memorable (Digest Blake2bp_512) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest Blake2bp_512) :: Nat Source #

Memorable (Digest Blake2s_224) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest Blake2s_224) :: Nat Source #

Memorable (Digest Blake2s_256) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest Blake2s_256) :: Nat Source #

Memorable (Digest Blake2sp_224) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest Blake2sp_224) :: Nat Source #

Memorable (Digest Blake2sp_256) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest Blake2sp_256) :: Nat Source #

Memorable (Digest Keccak_224) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest Keccak_224) :: Nat Source #

Memorable (Digest Keccak_256) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest Keccak_256) :: Nat Source #

Memorable (Digest Keccak_384) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest Keccak_384) :: Nat Source #

Memorable (Digest Keccak_512) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest Keccak_512) :: Nat Source #

Memorable (Digest MD2) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest MD2) :: Nat Source #

Memorable (Digest MD4) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest MD4) :: Nat Source #

Memorable (Digest MD5) Source #
>>> :set -XOverloadedStrings
>>> import Data.ByteString
>>> import Crypto.Hash
>>> let myPattern = padHex (four flw10)
>>> renderMemorable myPattern (hash ("anExample" :: ByteString) :: Digest MD5)
"bark-most-gush-tuft-1b7155ab0dce3ecb4195fc"
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest MD5) :: Nat Source #

Memorable (Digest RIPEMD160) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest RIPEMD160) :: Nat Source #

Memorable (Digest SHA1) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest SHA1) :: Nat Source #

Memorable (Digest SHA224) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest SHA224) :: Nat Source #

Memorable (Digest SHA256) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest SHA256) :: Nat Source #

Memorable (Digest SHA3_224) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest SHA3_224) :: Nat Source #

Memorable (Digest SHA3_256) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest SHA3_256) :: Nat Source #

Memorable (Digest SHA3_384) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest SHA3_384) :: Nat Source #

Memorable (Digest SHA3_512) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest SHA3_512) :: Nat Source #

Memorable (Digest SHA384) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest SHA384) :: Nat Source #

Memorable (Digest SHA512) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest SHA512) :: Nat Source #

Memorable (Digest SHA512t_224) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest SHA512t_224) :: Nat Source #

Memorable (Digest SHA512t_256) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest SHA512t_256) :: Nat Source #

Memorable (Digest Skein256_224) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest Skein256_224) :: Nat Source #

Memorable (Digest Skein256_256) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest Skein256_256) :: Nat Source #

Memorable (Digest Skein512_224) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest Skein512_224) :: Nat Source #

Memorable (Digest Skein512_256) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest Skein512_256) :: Nat Source #

Memorable (Digest Skein512_384) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest Skein512_384) :: Nat Source #

Memorable (Digest Skein512_512) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest Skein512_512) :: Nat Source #

Memorable (Digest Tiger) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest Tiger) :: Nat Source #

Memorable (Digest Whirlpool) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (Digest Whirlpool) :: Nat Source #

(Memorable a, Memorable b) => Memorable (a, b) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (a, b) :: Nat Source #

Methods

renderMem :: MonadPut m => (a, b) -> Coding m () Source #

parserMem :: MonadGet m => Coding m (a, b) Source #

(Memorable a, Memorable b, Memorable c) => Memorable (a, b, c) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (a, b, c) :: Nat Source #

Methods

renderMem :: MonadPut m => (a, b, c) -> Coding m () Source #

parserMem :: MonadGet m => Coding m (a, b, c) Source #

(Memorable a, Memorable b, Memorable c, Memorable d) => Memorable (a, b, c, d) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (a, b, c, d) :: Nat Source #

Methods

renderMem :: MonadPut m => (a, b, c, d) -> Coding m () Source #

parserMem :: MonadGet m => Coding m (a, b, c, d) Source #

(Memorable a, Memorable b, Memorable c, Memorable d, Memorable e) => Memorable (a, b, c, d, e) Source # 
Instance details

Defined in Data.Memorable.Internal

Associated Types

type MemLen (a, b, c, d, e) :: Nat Source #

Methods

renderMem :: MonadPut m => (a, b, c, d, e) -> Coding m () Source #

parserMem :: MonadGet m => Coding m (a, b, c, d, e) Source #

Pattern Building

(.-) :: Proxy a -> Proxy b -> Proxy (a :- b) Source #

Proxy version of :-. The new pattern depth is the sum of the two parts. >>> import Data.Word >>> import Data.Memorable.Theme.Words >>> let myPattern = words8 .- words8 >>> renderMemorable myPattern (0xabcd :: Word16) "ages-old"

(.|) :: Depth a ~ Depth b => Proxy a -> Proxy b -> Proxy (a :| b) Source #

Proxy version of :|. It also constraints the two subpatterns to being the same depth. Use this to add an extra bit to the pattern depth, where the bit chooses to proceed down either the left or right side.

>>> :set -XTypeApplications
>>> :set -XDataKinds
>>> import Data.Word
>>> let myPattern = padHex (Proxy @"foo" .| Proxy @"bar")
>>> renderMemorable myPattern (0x00 :: Word8)
"bar-00"
>>> renderMemorable myPattern (0xff :: Word8)
"foo-7f"

See also ToTree

WARNING: Each side of the split must be unique. See the warning about :|.

two :: Proxy a -> Proxy (a :- a) Source #

Put two things next to each other.

three :: Proxy a -> Proxy ((a :- a) :- a) Source #

Put three things next to each other.

four :: Proxy a -> Proxy (((a :- a) :- a) :- a) Source #

Put four things next to each other.

five :: Proxy a -> Proxy ((((a :- a) :- a) :- a) :- a) Source #

Put five things next to each other. Same as using .- repeatedly

padHex :: forall n a. Proxy a -> Proxy (PadTo Hex n a) Source #

Pad this pattern out with hex digits. Useful when you want some human readability, but also want full coverage of the data. See Hex for details.

>>> import Data.Word
>>> import Data.Memorable.Theme.Fantasy
>>> renderMemorable (padHex rpgWeapons) (0xdeadbeef01020304 :: Word64)
"sacred-club-of-ghoul-charming-eef01020304"

padDec :: forall n a. Proxy a -> Proxy (PadTo Dec n a) Source #

Pad with decimal digits. See padHex and Dec for details. This does not pad with 0's

hex :: Proxy (Number Hex n) Source #

A single hex number consuming n bits, which it will try and figure out from context (with leading 0's).

hex4 :: Proxy (Number Hex 4) Source #

A single hex number consuming 4 bits (with leading 0's).

hex8 :: Proxy (Number Hex 8) Source #

A single hex number consuming 8 bits (with leading 0's).

hex16 :: Proxy (Number Hex 16) Source #

A single hex number consuming 16 bits (with leading 0's).

hex32 :: Proxy (Number Hex 32) Source #

A single hex number consuming 32 bits (with leading 0's).

dec :: Proxy (Number Dec n) Source #

A single decimal number consuming n bits, which it will try and figure out from context (no leading 0's)

dec4 :: Proxy (Number Dec 4) Source #

A single decimal number consuming 4 bits (no leading 0's)

dec8 :: Proxy (Number Dec 8) Source #

A single decimal number consuming 8 bits (no leading 0's)

dec16 :: Proxy (Number Dec 16) Source #

A single decimal number consuming 16 bits (no leading 0's)

dec32 :: Proxy (Number Dec 32) Source #

A single decimal number consuming 32 bits (no leading 0's)

type family ToTree (a :: [k]) :: * where ... Source #

Convert a '[Symbol] to a balanced tree of :|. Each result has equal probability of occurring. Length of the list must be a power of two. This is very useful for converting long lists of words into a usable pattern.

>>> :kind! ToTree '["a", "b", "c", "d"]
ToTree '["a", "b", "c", "d"] :: *
= ("a" :| "b") :| ("c" :| "d")

Equations

ToTree (x ': (y ': '[])) = x :| y 
ToTree '[x :| y] = x :| y 
ToTree xs = ToTree (ToTreeH xs) 

leftSide :: Proxy (a :| b) -> Proxy a Source #

Shrink a branching pattern by discarding the right hand side.

rightSide :: Proxy (a :| b) -> Proxy b Source #

Shrink a branching pattern by discarding the left hand side.

Pattern Types

data a :- b Source #

Append two patterns together by doing the first, then the second. See also .-

Instances
(MemRender a, MemRender b) => MemRender (a :- b :: Type) Source # 
Instance details

Defined in Data.Memorable.Internal

Methods

render :: Proxy (a :- b) -> Coding Get String Source #

parser :: Proxy (a :- b) -> ExceptT String (State ([String], Coding PutM ())) () Source #

class MemRender a Source #

The class that implements the main rendering function.

Minimal complete definition

render, parser

Instances
KnownSymbol a => MemRender (a :: Symbol) Source # 
Instance details

Defined in Data.Memorable.Internal

(NumberRender nt, KnownNat a, KnownNat o) => MemRender (NumberWithOffset nt a o :: Type) Source # 
Instance details

Defined in Data.Memorable.Internal

(MemRender a, MemRender b) => MemRender (a :- b :: Type) Source # 
Instance details

Defined in Data.Memorable.Internal

Methods

render :: Proxy (a :- b) -> Coding Get String Source #

parser :: Proxy (a :- b) -> ExceptT String (State ([String], Coding PutM ())) () Source #

(MemRender a, MemRender b) => MemRender (a :| b :: Type) Source # 
Instance details

Defined in Data.Memorable.Internal

Methods

render :: Proxy (a :| b) -> Coding Get String Source #

parser :: Proxy (a :| b) -> ExceptT String (State ([String], Coding PutM ())) () Source #

(MemRender a, Depth a <= n, NumberRender nt, KnownNat n, KnownNat (Depth a)) => MemRender (PadTo nt n a :: Type) Source # 
Instance details

Defined in Data.Memorable.Internal

Methods

render :: Proxy (PadTo nt n a) -> Coding Get String Source #

parser :: Proxy (PadTo nt n a) -> ExceptT String (State ([String], Coding PutM ())) () Source #

type Number nt n = NumberWithOffset nt n 0 Source #

Captures n bits and converts them to a string via the nt ("number type") argument. See Dec, Hex.

data NumberWithOffset nt (n :: Nat) (o :: Nat) Source #

Captures n bits and convertes them to a string via the nt ("number type") argument after adding the offset. See Dec, Hex.

Instances
(NumberRender nt, KnownNat a, KnownNat o) => MemRender (NumberWithOffset nt a o :: Type) Source # 
Instance details

Defined in Data.Memorable.Internal

data PadTo nt (n :: Nat) a Source #

Pad the a argument out to length n by taking the remaining bits and converting them via nt (see Dec and Hex). If padding is required, it is separated by a dash.

See padHex and padDec for convinence functions.

Instances
(MemRender a, Depth a <= n, NumberRender nt, KnownNat n, KnownNat (Depth a)) => MemRender (PadTo nt n a :: Type) Source # 
Instance details

Defined in Data.Memorable.Internal

Methods

render :: Proxy (PadTo nt n a) -> Coding Get String Source #

parser :: Proxy (PadTo nt n a) -> ExceptT String (State ([String], Coding PutM ())) () Source #

data Dec Source #

Render numbers as decimal numbers. Does not pad.

data Hex Source #

Render numbers as hexadecimal numbers. Pads with 0s.

type family Depth (a :: k) :: Nat where ... Source #

Determines the number of bits that a pattern will consume.

Equations

Depth (a :: Symbol) = 0 
Depth (a :- b) = Depth a + Depth b 
Depth (a :| b) = 1 + Depth a 
Depth (NumberWithOffset nt a o) = a 
Depth (PadTo nt n a) = n 

getDepth :: forall a. KnownNat (Depth a) => Proxy a -> Integer Source #

Get the depth of a pattern as a value-level Integer. >>> :set -XTypeApplications -XDataKinds >>> getDepth (Proxy "foo" .| Proxy "bar") 1

type family LeftSide (a :: *) :: * where ... Source #

Useful to prevent haddock from expanding the type.

Equations

LeftSide (a :| b) = a 

type family RightSide (a :: *) :: * where ... Source #

Useful to prevent haddock from expanding the type.

Equations

RightSide (a :| b) = b 

Re-export

data Proxy (t :: k) :: forall k. k -> Type #

Proxy is a type that holds no data, but has a phantom parameter of arbitrary type (or even kind). Its use is to provide type information, even though there is no value available of that type (or it may be too costly to create one).

Historically, Proxy :: Proxy a is a safer alternative to the 'undefined :: a' idiom.

>>> Proxy :: Proxy (Void, Int -> Int)
Proxy

Proxy can even hold types of higher kinds,

>>> Proxy :: Proxy Either
Proxy
>>> Proxy :: Proxy Functor
Proxy
>>> Proxy :: Proxy complicatedStructure
Proxy

Constructors

Proxy 
Instances
Generic1 (Proxy :: k -> Type) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep1 Proxy :: k -> Type #

Methods

from1 :: Proxy a -> Rep1 Proxy a #

to1 :: Rep1 Proxy a -> Proxy a #

Monad (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

(>>=) :: Proxy a -> (a -> Proxy b) -> Proxy b #

(>>) :: Proxy a -> Proxy b -> Proxy b #

return :: a -> Proxy a #

fail :: String -> Proxy a #

Functor (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

fmap :: (a -> b) -> Proxy a -> Proxy b #

(<$) :: a -> Proxy b -> Proxy a #

Applicative (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

pure :: a -> Proxy a #

(<*>) :: Proxy (a -> b) -> Proxy a -> Proxy b #

liftA2 :: (a -> b -> c) -> Proxy a -> Proxy b -> Proxy c #

(*>) :: Proxy a -> Proxy b -> Proxy b #

(<*) :: Proxy a -> Proxy b -> Proxy a #

Foldable (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Proxy m -> m #

foldMap :: Monoid m => (a -> m) -> Proxy a -> m #

foldr :: (a -> b -> b) -> b -> Proxy a -> b #

foldr' :: (a -> b -> b) -> b -> Proxy a -> b #

foldl :: (b -> a -> b) -> b -> Proxy a -> b #

foldl' :: (b -> a -> b) -> b -> Proxy a -> b #

foldr1 :: (a -> a -> a) -> Proxy a -> a #

foldl1 :: (a -> a -> a) -> Proxy a -> a #

toList :: Proxy a -> [a] #

null :: Proxy a -> Bool #

length :: Proxy a -> Int #

elem :: Eq a => a -> Proxy a -> Bool #

maximum :: Ord a => Proxy a -> a #

minimum :: Ord a => Proxy a -> a #

sum :: Num a => Proxy a -> a #

product :: Num a => Proxy a -> a #

Traversable (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Proxy a -> f (Proxy b) #

sequenceA :: Applicative f => Proxy (f a) -> f (Proxy a) #

mapM :: Monad m => (a -> m b) -> Proxy a -> m (Proxy b) #

sequence :: Monad m => Proxy (m a) -> m (Proxy a) #

Alternative (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Proxy

Methods

empty :: Proxy a #

(<|>) :: Proxy a -> Proxy a -> Proxy a #

some :: Proxy a -> Proxy [a] #

many :: Proxy a -> Proxy [a] #

MonadPlus (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Proxy

Methods

mzero :: Proxy a #

mplus :: Proxy a -> Proxy a -> Proxy a #

Eq1 (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftEq :: (a -> b -> Bool) -> Proxy a -> Proxy b -> Bool #

Ord1 (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftCompare :: (a -> b -> Ordering) -> Proxy a -> Proxy b -> Ordering #

Read1 (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Proxy a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Proxy a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Proxy a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Proxy a] #

Show1 (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Proxy a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Proxy a] -> ShowS #

Hashable1 (Proxy :: Type -> Type) 
Instance details

Defined in Data.Hashable.Class

Methods

liftHashWithSalt :: (Int -> a -> Int) -> Int -> Proxy a -> Int #

Bounded (Proxy t)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

minBound :: Proxy t #

maxBound :: Proxy t #

Enum (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

succ :: Proxy s -> Proxy s #

pred :: Proxy s -> Proxy s #

toEnum :: Int -> Proxy s #

fromEnum :: Proxy s -> Int #

enumFrom :: Proxy s -> [Proxy s] #

enumFromThen :: Proxy s -> Proxy s -> [Proxy s] #

enumFromTo :: Proxy s -> Proxy s -> [Proxy s] #

enumFromThenTo :: Proxy s -> Proxy s -> Proxy s -> [Proxy s] #

Eq (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

(==) :: Proxy s -> Proxy s -> Bool #

(/=) :: Proxy s -> Proxy s -> Bool #

Ord (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

compare :: Proxy s -> Proxy s -> Ordering #

(<) :: Proxy s -> Proxy s -> Bool #

(<=) :: Proxy s -> Proxy s -> Bool #

(>) :: Proxy s -> Proxy s -> Bool #

(>=) :: Proxy s -> Proxy s -> Bool #

max :: Proxy s -> Proxy s -> Proxy s #

min :: Proxy s -> Proxy s -> Proxy s #

Read (Proxy t)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Show (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

showsPrec :: Int -> Proxy s -> ShowS #

show :: Proxy s -> String #

showList :: [Proxy s] -> ShowS #

Ix (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

range :: (Proxy s, Proxy s) -> [Proxy s] #

index :: (Proxy s, Proxy s) -> Proxy s -> Int #

unsafeIndex :: (Proxy s, Proxy s) -> Proxy s -> Int

inRange :: (Proxy s, Proxy s) -> Proxy s -> Bool #

rangeSize :: (Proxy s, Proxy s) -> Int #

unsafeRangeSize :: (Proxy s, Proxy s) -> Int

Generic (Proxy t) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (Proxy t) :: Type -> Type #

Methods

from :: Proxy t -> Rep (Proxy t) x #

to :: Rep (Proxy t) x -> Proxy t #

Semigroup (Proxy s)

Since: base-4.9.0.0

Instance details

Defined in Data.Proxy

Methods

(<>) :: Proxy s -> Proxy s -> Proxy s #

sconcat :: NonEmpty (Proxy s) -> Proxy s #

stimes :: Integral b => b -> Proxy s -> Proxy s #

Monoid (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

mempty :: Proxy s #

mappend :: Proxy s -> Proxy s -> Proxy s #

mconcat :: [Proxy s] -> Proxy s #

Hashable (Proxy a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Proxy a -> Int #

hash :: Proxy a -> Int #

type Rep1 (Proxy :: k -> Type)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

type Rep1 (Proxy :: k -> Type) = D1 (MetaData "Proxy" "Data.Proxy" "base" False) (C1 (MetaCons "Proxy" PrefixI False) (U1 :: k -> Type))
type Rep (Proxy t)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

type Rep (Proxy t) = D1 (MetaData "Proxy" "Data.Proxy" "base" False) (C1 (MetaCons "Proxy" PrefixI False) (U1 :: Type -> Type))