predicate-typed-0.7.4.0: Predicates, Refinement types and Dsl

Safe HaskellNone
LanguageHaskell2010

Predicate.Misc

Contents

Description

Utility methods for Predicate / methods for displaying the evaluation tree

Synopsis

useful type families

type family AndT (b :: Bool) (b1 :: Bool) :: Bool where ... #

typelevel boolean And

Equations

AndT False _ = False 
AndT True b1 = b1 

type family OrT (b :: Bool) (b1 :: Bool) :: Bool where ... #

typelevel boolean Or

Equations

OrT True _ = True 
OrT False b1 = b1 

type family NotT (b :: Bool) :: Bool where ... #

typelevel boolean Not

Equations

NotT True = False 
NotT False = True 

type family RepeatT (n :: Nat) (p :: k) :: [k] where ... #

Repeat an expression n times

Equations

RepeatT 0 _p = TypeError (Text "RepeatT is not defined for zero") 
RepeatT 1 p = p ': '[] 
RepeatT n p = p ': RepeatT (n - 1) p 

type family IntersperseT (s :: Symbol) (xs :: [Symbol]) :: Symbol where ... #

Intersperse a symbol inside a list of symbols

Equations

IntersperseT _s '[] = "" 
IntersperseT _s '[x] = x 
IntersperseT s (x ': (y ': xs)) = x <%> (s <%> IntersperseT s (y ': xs)) 

type family LenT (xs :: [k]) :: Nat where ... #

length of a type level list

Equations

LenT '[] = 0 
LenT (_x ': xs) = 1 + LenT xs 

type family FlipT (d :: k1 -> k -> k2) (p :: k) (q :: k1) :: k2 where ... #

flip at the type level

Equations

FlipT d p q = d q p 

type family IfT (b :: Bool) (t :: k) (f :: k) :: k where ... #

'if' at the type level

Equations

IfT True t _f = t 
IfT False _t f = f 

type family SumT (ns :: [Nat]) :: Nat where ... #

sum at the type level for a list of Nat

Equations

SumT '[] = 0 
SumT (n ': ns) = n + SumT ns 

type family MapT (f :: k -> k1) (xs :: [k]) :: [k1] where ... #

map at the type level

Equations

MapT _f '[] = '[] 
MapT f (x ': xs) = f x ': MapT f xs 

type family ConsT s where ... #

Extract a from a list-like container

Equations

ConsT [a] = a 
ConsT (ZipList a) = a 
ConsT Text = Char 
ConsT ByteString = Word8 
ConsT (Seq a) = a 
ConsT s = TypeError (Text "invalid ConsT instance" :$$: (Text "s = " :<>: ShowType s)) 

type family (p :: k -> k1) %% (q :: k) :: k1 where ... infixl 9 #

Equations

p %% q = p q 

type family (p :: k) %& (q :: k -> k1) :: k1 where ... infixr 9 #

Equations

p %& q = q p 

type (<%>) s t = AppendSymbol s t infixr 7 #

type family ExtractAFromList (as :: Type) :: Type where ... #

type family to extract a from a list of a

Equations

ExtractAFromList [a] = a 
ExtractAFromList z = TypeError (Text "ExtractAFromList: expected [a] but found something else" :$$: (Text "as = " :<>: ShowType z)) 

type family ExtractAFromTA (ta :: Type) :: Type where ... #

type family to extract a from t a

Equations

ExtractAFromTA (_t a) = a 
ExtractAFromTA z = TypeError (Text "ExtractAFromTA: expected (t a) but found something else" :$$: (Text "t a = " :<>: ShowType z)) 

type family ExtractTFromTA (ta :: Type) :: Type -> Type where ... #

type family to extract t from t a

Equations

ExtractTFromTA (t _a) = t 
ExtractTFromTA z = TypeError (Text "ExtractTFromTA: expected (t a) but found something else" :$$: (Text "t a = " :<>: ShowType z)) 

type family MaybeT mb where ... #

Equations

MaybeT (Maybe a) = a 
MaybeT o = TypeError (Text "MaybeT: expected 'Maybe a' " :$$: (Text "o = " :<>: ShowType o)) 

type family LeftT lr where ... #

Equations

LeftT (Either a _) = a 
LeftT o = TypeError (Text "LeftT: expected 'Either a b' " :$$: (Text "o = " :<>: ShowType o)) 

type family RightT lr where ... #

Equations

RightT (Either _a b) = b 
RightT o = TypeError (Text "RightT: expected 'Either a b' " :$$: (Text "o = " :<>: ShowType o)) 

type family ThisT lr where ... #

Equations

ThisT (These a _b) = a 
ThisT o = TypeError (Text "ThisT: expected 'These a b' " :$$: (Text "o = " :<>: ShowType o)) 

type family ThatT lr where ... #

Equations

ThatT (These _a b) = b 
ThatT o = TypeError (Text "ThatT: expected 'These a b' " :$$: (Text "o = " :<>: ShowType o)) 

type family TheseT lr where ... #

Equations

TheseT (These a b) = (a, b) 
TheseT o = TypeError (Text "TheseT: expected 'These a b' " :$$: (Text "o = " :<>: ShowType o)) 

type family FnT ab :: Type where ... #

Equations

FnT (_a -> b) = b 
FnT ab = TypeError (Text "FnT: expected Type -> Type but found a simple Type?" :$$: (Text "ab = " :<>: ShowType ab)) 

type family ApplyConstT (ta :: Type) (b :: Type) :: Type where ... #

Equations

ApplyConstT (t _a) b = t b 
ApplyConstT ta b = TypeError ((Text "ApplyConstT: (t a) b but found something else" :$$: (Text "t a = " :<>: ShowType ta)) :$$: (Text "b = " :<>: ShowType b)) 

type family CheckT (tp :: Type) :: Bool where ... #

Equations

CheckT () = TypeError (Text "Printfn: inductive tuple cannot be empty") 
CheckT _o = True 

type family JoinT x y where ... #

Equations

JoinT (t a) (t b) = t (a, b) 
JoinT ta tb = TypeError ((Text "JoinT: expected (t a) (t b) but found something else" :$$: (Text "t a = " :<>: ShowType ta)) :$$: (Text "t b = " :<>: ShowType tb)) 

type family FailWhenT (b :: Bool) (msg :: ErrorMessage) :: Constraint where ... #

helper method that fails with a msg when True

Equations

FailWhenT False _ = () 
FailWhenT True e = TypeError e 

type family FailUnlessT (b :: Bool) (msg :: ErrorMessage) :: Constraint where ... #

helper method that fails with msg when False

Equations

FailUnlessT True _ = () 
FailUnlessT False e = TypeError e 

type family ZwischenT (a :: Nat) (b :: Nat) (v :: Nat) :: Constraint where ... #

type level Between

Equations

ZwischenT m n v = FailUnlessT (AndT (m <=? v) (v <=? n)) (((Text "ZwischenT failure" :$$: ShowType v) :$$: Text " is outside of ") :$$: ((ShowType m :<>: Text " and ") :<>: ShowType n)) 

extract values from the type level

class GetBool (a :: Bool) where #

get Bool from the typelevel

Methods

getBool :: Bool #

Instances
GetBool False # 
Instance details

Defined in Predicate.Misc

Methods

getBool :: Bool #

GetBool True # 
Instance details

Defined in Predicate.Misc

Methods

getBool :: Bool #

class GetLen xs where #

get the length of a typelevel container

>>> getLen @'["abc","def","g"]
3
>>> getLen @'[]
0
>>> getLen @(9 ':| '[1,2,3])
4
>>> getLen @('These 9 "Asfs")
1
>>> getLen @('This 1)
0

Methods

getLen :: Int #

Instances
GetLen ([] :: [k]) # 
Instance details

Defined in Predicate.Misc

Methods

getLen :: Int #

GetLen (Nothing :: Maybe a) # 
Instance details

Defined in Predicate.Misc

Methods

getLen :: Int #

GetLen (Just a2 :: Maybe a1) # 
Instance details

Defined in Predicate.Misc

Methods

getLen :: Int #

GetLen xs => GetLen (x ': xs :: [a]) # 
Instance details

Defined in Predicate.Misc

Methods

getLen :: Int #

GetLen xs => GetLen (x :| xs :: NonEmpty a) # 
Instance details

Defined in Predicate.Misc

Methods

getLen :: Int #

GetLen (Right a2 :: Either a1 b) # 
Instance details

Defined in Predicate.Misc

Methods

getLen :: Int #

GetLen (Left a2 :: Either a1 b) # 
Instance details

Defined in Predicate.Misc

Methods

getLen :: Int #

GetLen (That a2 :: These a1 b) # 
Instance details

Defined in Predicate.Misc

Methods

getLen :: Int #

GetLen (This a2 :: These a1 b) # 
Instance details

Defined in Predicate.Misc

Methods

getLen :: Int #

GetLen (These a2 b2 :: These a1 b1) # 
Instance details

Defined in Predicate.Misc

Methods

getLen :: Int #

class GetThese th where #

get These from typelevel

Methods

getThese :: (String, These w v -> Bool) #

Instances
GetThese (That y :: These a b) # 
Instance details

Defined in Predicate.Misc

Methods

getThese :: (String, These w v -> Bool) #

GetThese (This x :: These a b) # 
Instance details

Defined in Predicate.Misc

Methods

getThese :: (String, These w v -> Bool) #

GetThese (These x y :: These a b) # 
Instance details

Defined in Predicate.Misc

Methods

getThese :: (String, These0 w v -> Bool) #

class GetOrdering (cmp :: Ordering) where #

get ordering from the typelevel

Instances
GetOrdering LT # 
Instance details

Defined in Predicate.Misc

GetOrdering EQ # 
Instance details

Defined in Predicate.Misc

GetOrdering GT # 
Instance details

Defined in Predicate.Misc

data OrderingP #

all the ways to compare two values

Constructors

CGt 
CGe 
CEq 
CLe 
CLt 
CNe 

class GetOrd (k :: OrderingP) where #

extract OrderingP from the typelevel

Methods

getOrd :: Ord a => (String, a -> a -> Bool) #

Instances
GetOrd CGt # 
Instance details

Defined in Predicate.Misc

Methods

getOrd :: Ord a => (String, a -> a -> Bool) #

GetOrd CGe # 
Instance details

Defined in Predicate.Misc

Methods

getOrd :: Ord a => (String, a -> a -> Bool) #

GetOrd CEq # 
Instance details

Defined in Predicate.Misc

Methods

getOrd :: Ord a => (String, a -> a -> Bool) #

GetOrd CLe # 
Instance details

Defined in Predicate.Misc

Methods

getOrd :: Ord a => (String, a -> a -> Bool) #

GetOrd CLt # 
Instance details

Defined in Predicate.Misc

Methods

getOrd :: Ord a => (String, a -> a -> Bool) #

GetOrd CNe # 
Instance details

Defined in Predicate.Misc

Methods

getOrd :: Ord a => (String, a -> a -> Bool) #

nat :: forall n a. (KnownNat n, Num a) => a #

get a Nat from the typelevel

>>> nat @14
14

symb :: forall s. KnownSymbol s => String #

gets the Symbol from the typelevel

>>> symb @"abc"
"abc"

inductive tuples

class ToITupleC x where #

takes a flat n-tuple and creates an inductive tuple. see PrintT

>>> toITupleC (123,'x',False,"abc")
(123,('x',(False,("abc",()))))
>>> toITupleC (123,'x')
(123,('x',()))

Associated Types

type ToITupleP x #

Methods

toITupleC :: x -> ToITupleP x #

Instances
(TypeError (Text "ToITupleC: inductive tuple cannot be empty") :: Constraint) => ToITupleC () # 
Instance details

Defined in Predicate.Misc

Associated Types

type ToITupleP () :: Type #

Methods

toITupleC :: () -> ToITupleP () #

ToITupleC (a, b) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ToITupleP (a, b) :: Type #

Methods

toITupleC :: (a, b) -> ToITupleP (a, b) #

ToITupleC (a, b, c) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ToITupleP (a, b, c) :: Type #

Methods

toITupleC :: (a, b, c) -> ToITupleP (a, b, c) #

ToITupleC (a, b, c, d) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ToITupleP (a, b, c, d) :: Type #

Methods

toITupleC :: (a, b, c, d) -> ToITupleP (a, b, c, d) #

ToITupleC (a, b, c, d, e) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ToITupleP (a, b, c, d, e) :: Type #

Methods

toITupleC :: (a, b, c, d, e) -> ToITupleP (a, b, c, d, e) #

ToITupleC (a, b, c, d, e, f) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ToITupleP (a, b, c, d, e, f) :: Type #

Methods

toITupleC :: (a, b, c, d, e, f) -> ToITupleP (a, b, c, d, e, f) #

ToITupleC (a, b, c, d, e, f, g) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ToITupleP (a, b, c, d, e, f, g) :: Type #

Methods

toITupleC :: (a, b, c, d, e, f, g) -> ToITupleP (a, b, c, d, e, f, g) #

ToITupleC (a, b, c, d, e, f, g, h) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ToITupleP (a, b, c, d, e, f, g, h) :: Type #

Methods

toITupleC :: (a, b, c, d, e, f, g, h) -> ToITupleP (a, b, c, d, e, f, g, h) #

ToITupleC (a, b, c, d, e, f, g, h, i) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ToITupleP (a, b, c, d, e, f, g, h, i) :: Type #

Methods

toITupleC :: (a, b, c, d, e, f, g, h, i) -> ToITupleP (a, b, c, d, e, f, g, h, i) #

ToITupleC (a, b, c, d, e, f, g, h, i, j) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ToITupleP (a, b, c, d, e, f, g, h, i, j) :: Type #

Methods

toITupleC :: (a, b, c, d, e, f, g, h, i, j) -> ToITupleP (a, b, c, d, e, f, g, h, i, j) #

ToITupleC (a, b, c, d, e, f, g, h, i, j, k) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ToITupleP (a, b, c, d, e, f, g, h, i, j, k) :: Type #

Methods

toITupleC :: (a, b, c, d, e, f, g, h, i, j, k) -> ToITupleP (a, b, c, d, e, f, g, h, i, j, k) #

ToITupleC (a, b, c, d, e, f, g, h, i, j, k, l) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ToITupleP (a, b, c, d, e, f, g, h, i, j, k, l) :: Type #

Methods

toITupleC :: (a, b, c, d, e, f, g, h, i, j, k, l) -> ToITupleP (a, b, c, d, e, f, g, h, i, j, k, l) #

class ToITupleListC (n :: Nat) a where #

takes a list of size n and converts it to an inductive tuple. see PrintL

>>> toITupleListC @4 [10,12,13,1]
Right (10,(12,(13,(1,()))))
>>> toITupleListC @2 ["ab","cc"]
Right ("ab",("cc",()))
>>> toITupleListC @10 [10,12,13,1]
Left "toITupleListC: expected exactly 10 values"
>>> toITupleListC @2 [10,12,13,1]
Left "toITupleListC: expected exactly 2 values"

Associated Types

type ToITupleListP n a #

Methods

toITupleListC :: [a] -> Either String (ToITupleListP n a) #

Instances
(TypeError (Text "ToITupleListC: inductive tuple cannot be empty") :: Constraint) => ToITupleListC 0 a # 
Instance details

Defined in Predicate.Misc

Associated Types

type ToITupleListP 0 a :: Type #

Methods

toITupleListC :: [a] -> Either String (ToITupleListP 0 a) #

ToITupleListC 1 a # 
Instance details

Defined in Predicate.Misc

Associated Types

type ToITupleListP 1 a :: Type #

Methods

toITupleListC :: [a] -> Either String (ToITupleListP 1 a) #

ToITupleListC 2 a # 
Instance details

Defined in Predicate.Misc

Associated Types

type ToITupleListP 2 a :: Type #

Methods

toITupleListC :: [a] -> Either String (ToITupleListP 2 a) #

ToITupleListC 3 a # 
Instance details

Defined in Predicate.Misc

Associated Types

type ToITupleListP 3 a :: Type #

Methods

toITupleListC :: [a] -> Either String (ToITupleListP 3 a) #

ToITupleListC 4 a # 
Instance details

Defined in Predicate.Misc

Associated Types

type ToITupleListP 4 a :: Type #

Methods

toITupleListC :: [a] -> Either String (ToITupleListP 4 a) #

ToITupleListC 5 a # 
Instance details

Defined in Predicate.Misc

Associated Types

type ToITupleListP 5 a :: Type #

Methods

toITupleListC :: [a] -> Either String (ToITupleListP 5 a) #

ToITupleListC 6 a # 
Instance details

Defined in Predicate.Misc

Associated Types

type ToITupleListP 6 a :: Type #

Methods

toITupleListC :: [a] -> Either String (ToITupleListP 6 a) #

ToITupleListC 7 a # 
Instance details

Defined in Predicate.Misc

Associated Types

type ToITupleListP 7 a :: Type #

Methods

toITupleListC :: [a] -> Either String (ToITupleListP 7 a) #

ToITupleListC 8 a # 
Instance details

Defined in Predicate.Misc

Associated Types

type ToITupleListP 8 a :: Type #

Methods

toITupleListC :: [a] -> Either String (ToITupleListP 8 a) #

ToITupleListC 9 a # 
Instance details

Defined in Predicate.Misc

Associated Types

type ToITupleListP 9 a :: Type #

Methods

toITupleListC :: [a] -> Either String (ToITupleListP 9 a) #

ToITupleListC 10 a # 
Instance details

Defined in Predicate.Misc

Associated Types

type ToITupleListP 10 a :: Type #

Methods

toITupleListC :: [a] -> Either String (ToITupleListP 10 a) #

ToITupleListC 11 a # 
Instance details

Defined in Predicate.Misc

Associated Types

type ToITupleListP 11 a :: Type #

Methods

toITupleListC :: [a] -> Either String (ToITupleListP 11 a) #

ToITupleListC 12 a # 
Instance details

Defined in Predicate.Misc

Associated Types

type ToITupleListP 12 a :: Type #

Methods

toITupleListC :: [a] -> Either String (ToITupleListP 12 a) #

class ReverseITupleC x xs ys where #

Associated Types

type ReverseITupleT x xs ys #

Methods

reverseITupleC :: x -> xs -> ys -> ReverseITupleT x xs ys #

Instances
ReverseITupleC x () ys # 
Instance details

Defined in Predicate.Misc

Associated Types

type ReverseITupleT x () ys :: Type #

Methods

reverseITupleC :: x -> () -> ys -> ReverseITupleT x () ys #

ReverseITupleC w ws (x, ys) => ReverseITupleC x (w, ws) ys # 
Instance details

Defined in Predicate.Misc

Associated Types

type ReverseITupleT x (w, ws) ys :: Type #

Methods

reverseITupleC :: x -> (w, ws) -> ys -> ReverseITupleT x (w, ws) ys #

class TupleC (n :: Nat) a where #

try to convert a list to a n-tuple

Associated Types

type TupleT n a #

Methods

getTupleC :: [a] -> Either [a] (TupleT n a) #

Instances
TupleC 2 a #

convert a list of at least 2 elements to a 2-tuple

Instance details

Defined in Predicate.Misc

Associated Types

type TupleT 2 a :: Type #

Methods

getTupleC :: [a] -> Either [a] (TupleT 2 a) #

TupleC 3 a #

convert a list of at least 3 elements to a 3-tuple

Instance details

Defined in Predicate.Misc

Associated Types

type TupleT 3 a :: Type #

Methods

getTupleC :: [a] -> Either [a] (TupleT 3 a) #

TupleC 4 a #

convert a list of at least 4 elements to a 4-tuple

Instance details

Defined in Predicate.Misc

Associated Types

type TupleT 4 a :: Type #

Methods

getTupleC :: [a] -> Either [a] (TupleT 4 a) #

TupleC 5 a #

convert a list of at least 5 elements to a 5-tuple

Instance details

Defined in Predicate.Misc

Associated Types

type TupleT 5 a :: Type #

Methods

getTupleC :: [a] -> Either [a] (TupleT 5 a) #

TupleC 6 a #

convert a list of at least 6 elements to a 6-tuple

Instance details

Defined in Predicate.Misc

Associated Types

type TupleT 6 a :: Type #

Methods

getTupleC :: [a] -> Either [a] (TupleT 6 a) #

TupleC 7 a #

convert a list of at least 7 elements to a 7-tuple

Instance details

Defined in Predicate.Misc

Associated Types

type TupleT 7 a :: Type #

Methods

getTupleC :: [a] -> Either [a] (TupleT 7 a) #

TupleC 8 a #

convert a list of at least 8 elements to a 8-tuple

Instance details

Defined in Predicate.Misc

Associated Types

type TupleT 8 a :: Type #

Methods

getTupleC :: [a] -> Either [a] (TupleT 8 a) #

TupleC 9 a #

convert a list of at least 9 elements to a 9-tuple

Instance details

Defined in Predicate.Misc

Associated Types

type TupleT 9 a :: Type #

Methods

getTupleC :: [a] -> Either [a] (TupleT 9 a) #

TupleC 10 a #

convert a list of at least 10 elements to a 10-tuple

Instance details

Defined in Predicate.Misc

Associated Types

type TupleT 10 a :: Type #

Methods

getTupleC :: [a] -> Either [a] (TupleT 10 a) #

TupleC 11 a #

convert a list of at least 11 elements to a 11-tuple

Instance details

Defined in Predicate.Misc

Associated Types

type TupleT 11 a :: Type #

Methods

getTupleC :: [a] -> Either [a] (TupleT 11 a) #

TupleC 12 a #

convert a list of at least 12 elements to a 12-tuple

Instance details

Defined in Predicate.Misc

Associated Types

type TupleT 12 a :: Type #

Methods

getTupleC :: [a] -> Either [a] (TupleT 12 a) #

extract from n-tuple

type family T4_1 x where ... #

extract opts part of 4 tuple from the type level for use with Refined2

Equations

T4_1 '(opts, _, _, _) = opts 

type family T4_2 x where ... #

extract ip part of 4 tuple from the type level for use with Refined2

Equations

T4_2 '(_, ip, _, _) = ip 

type family T4_3 x where ... #

extract op part of 4 tuple from the type level for use with Refined2

Equations

T4_3 '(_, _, op, _) = op 

type family T4_4 x where ... #

extract i part of 4 tuple from the type level for use with Refined2

Equations

T4_4 '(_, _, _, i) = i 

type family T5_1 x where ... #

extract opts part of 5 tuple from the type level for use with Refined3

Equations

T5_1 '(opts, _, _, _, _) = opts 

type family T5_2 x where ... #

extract ip part of 5 tuple from the type level for use with Refined3

Equations

T5_2 '(_, ip, _, _, _) = ip 

type family T5_3 x where ... #

extract op part of 5 tuple from the type level for use with Refined3

Equations

T5_3 '(_, _, op, _, _) = op 

type family T5_4 x where ... #

extract fmt part of 5 tuple from the type level for use with Refined3

Equations

T5_4 '(_, _, _, fmt, _) = fmt 

type family T5_5 x where ... #

extract i part of 5 tuple from the type level for use with Refined3

Equations

T5_5 '(_, _, _, _, i) = i 

tuple classes

class ExtractL1C tp where #

extract the first element from a n-tuple

Associated Types

type ExtractL1T tp #

Methods

extractL1C :: tp -> ExtractL1T tp #

Instances
ExtractL1C (a, b) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL1T (a, b) :: Type #

Methods

extractL1C :: (a, b) -> ExtractL1T (a, b) #

ExtractL1C (a, b, c) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL1T (a, b, c) :: Type #

Methods

extractL1C :: (a, b, c) -> ExtractL1T (a, b, c) #

ExtractL1C (a, b, c, d) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL1T (a, b, c, d) :: Type #

Methods

extractL1C :: (a, b, c, d) -> ExtractL1T (a, b, c, d) #

ExtractL1C (a, b, c, d, e) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL1T (a, b, c, d, e) :: Type #

Methods

extractL1C :: (a, b, c, d, e) -> ExtractL1T (a, b, c, d, e) #

ExtractL1C (a, b, c, d, e, f) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL1T (a, b, c, d, e, f) :: Type #

Methods

extractL1C :: (a, b, c, d, e, f) -> ExtractL1T (a, b, c, d, e, f) #

ExtractL1C (a, b, c, d, e, f, g) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL1T (a, b, c, d, e, f, g) :: Type #

Methods

extractL1C :: (a, b, c, d, e, f, g) -> ExtractL1T (a, b, c, d, e, f, g) #

ExtractL1C (a, b, c, d, e, f, g, h) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL1T (a, b, c, d, e, f, g, h) :: Type #

Methods

extractL1C :: (a, b, c, d, e, f, g, h) -> ExtractL1T (a, b, c, d, e, f, g, h) #

class ExtractL2C tp where #

extract the second element from a n-tuple

Associated Types

type ExtractL2T tp #

Methods

extractL2C :: tp -> ExtractL2T tp #

Instances
ExtractL2C (a, b) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL2T (a, b) :: Type #

Methods

extractL2C :: (a, b) -> ExtractL2T (a, b) #

ExtractL2C (a, b, c) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL2T (a, b, c) :: Type #

Methods

extractL2C :: (a, b, c) -> ExtractL2T (a, b, c) #

ExtractL2C (a, b, c, d) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL2T (a, b, c, d) :: Type #

Methods

extractL2C :: (a, b, c, d) -> ExtractL2T (a, b, c, d) #

ExtractL2C (a, b, c, d, e) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL2T (a, b, c, d, e) :: Type #

Methods

extractL2C :: (a, b, c, d, e) -> ExtractL2T (a, b, c, d, e) #

ExtractL2C (a, b, c, d, e, f) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL2T (a, b, c, d, e, f) :: Type #

Methods

extractL2C :: (a, b, c, d, e, f) -> ExtractL2T (a, b, c, d, e, f) #

ExtractL2C (a, b, c, d, e, f, g) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL2T (a, b, c, d, e, f, g) :: Type #

Methods

extractL2C :: (a, b, c, d, e, f, g) -> ExtractL2T (a, b, c, d, e, f, g) #

ExtractL2C (a, b, c, d, e, f, g, h) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL2T (a, b, c, d, e, f, g, h) :: Type #

Methods

extractL2C :: (a, b, c, d, e, f, g, h) -> ExtractL2T (a, b, c, d, e, f, g, h) #

class ExtractL3C tp where #

extract the third element from a n-tuple

Associated Types

type ExtractL3T tp #

Methods

extractL3C :: tp -> ExtractL3T tp #

Instances
ExtractL3C (a, b) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL3T (a, b) :: Type #

Methods

extractL3C :: (a, b) -> ExtractL3T (a, b) #

ExtractL3C (a, b, c) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL3T (a, b, c) :: Type #

Methods

extractL3C :: (a, b, c) -> ExtractL3T (a, b, c) #

ExtractL3C (a, b, c, d) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL3T (a, b, c, d) :: Type #

Methods

extractL3C :: (a, b, c, d) -> ExtractL3T (a, b, c, d) #

ExtractL3C (a, b, c, d, e) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL3T (a, b, c, d, e) :: Type #

Methods

extractL3C :: (a, b, c, d, e) -> ExtractL3T (a, b, c, d, e) #

ExtractL3C (a, b, c, d, e, f) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL3T (a, b, c, d, e, f) :: Type #

Methods

extractL3C :: (a, b, c, d, e, f) -> ExtractL3T (a, b, c, d, e, f) #

ExtractL3C (a, b, c, d, e, f, g) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL3T (a, b, c, d, e, f, g) :: Type #

Methods

extractL3C :: (a, b, c, d, e, f, g) -> ExtractL3T (a, b, c, d, e, f, g) #

ExtractL3C (a, b, c, d, e, f, g, h) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL3T (a, b, c, d, e, f, g, h) :: Type #

Methods

extractL3C :: (a, b, c, d, e, f, g, h) -> ExtractL3T (a, b, c, d, e, f, g, h) #

class ExtractL4C tp where #

extract the fourth element from a n-tuple

Associated Types

type ExtractL4T tp #

Methods

extractL4C :: tp -> ExtractL4T tp #

Instances
ExtractL4C (a, b) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL4T (a, b) :: Type #

Methods

extractL4C :: (a, b) -> ExtractL4T (a, b) #

ExtractL4C (a, b, c) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL4T (a, b, c) :: Type #

Methods

extractL4C :: (a, b, c) -> ExtractL4T (a, b, c) #

ExtractL4C (a, b, c, d) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL4T (a, b, c, d) :: Type #

Methods

extractL4C :: (a, b, c, d) -> ExtractL4T (a, b, c, d) #

ExtractL4C (a, b, c, d, e) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL4T (a, b, c, d, e) :: Type #

Methods

extractL4C :: (a, b, c, d, e) -> ExtractL4T (a, b, c, d, e) #

ExtractL4C (a, b, c, d, e, f) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL4T (a, b, c, d, e, f) :: Type #

Methods

extractL4C :: (a, b, c, d, e, f) -> ExtractL4T (a, b, c, d, e, f) #

ExtractL4C (a, b, c, d, e, f, g) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL4T (a, b, c, d, e, f, g) :: Type #

Methods

extractL4C :: (a, b, c, d, e, f, g) -> ExtractL4T (a, b, c, d, e, f, g) #

ExtractL4C (a, b, c, d, e, f, g, h) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL4T (a, b, c, d, e, f, g, h) :: Type #

Methods

extractL4C :: (a, b, c, d, e, f, g, h) -> ExtractL4T (a, b, c, d, e, f, g, h) #

class ExtractL5C tp where #

extract the fifth element from a n-tuple

Associated Types

type ExtractL5T tp #

Methods

extractL5C :: tp -> ExtractL5T tp #

Instances
ExtractL5C (a, b) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL5T (a, b) :: Type #

Methods

extractL5C :: (a, b) -> ExtractL5T (a, b) #

ExtractL5C (a, b, c) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL5T (a, b, c) :: Type #

Methods

extractL5C :: (a, b, c) -> ExtractL5T (a, b, c) #

ExtractL5C (a, b, c, d) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL5T (a, b, c, d) :: Type #

Methods

extractL5C :: (a, b, c, d) -> ExtractL5T (a, b, c, d) #

ExtractL5C (a, b, c, d, e) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL5T (a, b, c, d, e) :: Type #

Methods

extractL5C :: (a, b, c, d, e) -> ExtractL5T (a, b, c, d, e) #

ExtractL5C (a, b, c, d, e, f) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL5T (a, b, c, d, e, f) :: Type #

Methods

extractL5C :: (a, b, c, d, e, f) -> ExtractL5T (a, b, c, d, e, f) #

ExtractL5C (a, b, c, d, e, f, g) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL5T (a, b, c, d, e, f, g) :: Type #

Methods

extractL5C :: (a, b, c, d, e, f, g) -> ExtractL5T (a, b, c, d, e, f, g) #

ExtractL5C (a, b, c, d, e, f, g, h) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL5T (a, b, c, d, e, f, g, h) :: Type #

Methods

extractL5C :: (a, b, c, d, e, f, g, h) -> ExtractL5T (a, b, c, d, e, f, g, h) #

class ExtractL6C tp where #

extract the sixth element from a n-tuple

Associated Types

type ExtractL6T tp #

Methods

extractL6C :: tp -> ExtractL6T tp #

Instances
ExtractL6C (a, b) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL6T (a, b) :: Type #

Methods

extractL6C :: (a, b) -> ExtractL6T (a, b) #

ExtractL6C (a, b, c) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL6T (a, b, c) :: Type #

Methods

extractL6C :: (a, b, c) -> ExtractL6T (a, b, c) #

ExtractL6C (a, b, c, d) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL6T (a, b, c, d) :: Type #

Methods

extractL6C :: (a, b, c, d) -> ExtractL6T (a, b, c, d) #

ExtractL6C (a, b, c, d, e) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL6T (a, b, c, d, e) :: Type #

Methods

extractL6C :: (a, b, c, d, e) -> ExtractL6T (a, b, c, d, e) #

ExtractL6C (a, b, c, d, e, f) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL6T (a, b, c, d, e, f) :: Type #

Methods

extractL6C :: (a, b, c, d, e, f) -> ExtractL6T (a, b, c, d, e, f) #

ExtractL6C (a, b, c, d, e, f, g) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL6T (a, b, c, d, e, f, g) :: Type #

Methods

extractL6C :: (a, b, c, d, e, f, g) -> ExtractL6T (a, b, c, d, e, f, g) #

ExtractL6C (a, b, c, d, e, f, g, h) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL6T (a, b, c, d, e, f, g, h) :: Type #

Methods

extractL6C :: (a, b, c, d, e, f, g, h) -> ExtractL6T (a, b, c, d, e, f, g, h) #

class ExtractL7C tp where #

extract the seventh element from a n-tuple

Associated Types

type ExtractL7T tp #

Methods

extractL7C :: tp -> ExtractL7T tp #

Instances
ExtractL7C (a, b) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL7T (a, b) :: Type #

Methods

extractL7C :: (a, b) -> ExtractL7T (a, b) #

ExtractL7C (a, b, c) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL7T (a, b, c) :: Type #

Methods

extractL7C :: (a, b, c) -> ExtractL7T (a, b, c) #

ExtractL7C (a, b, c, d) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL7T (a, b, c, d) :: Type #

Methods

extractL7C :: (a, b, c, d) -> ExtractL7T (a, b, c, d) #

ExtractL7C (a, b, c, d, e) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL7T (a, b, c, d, e) :: Type #

Methods

extractL7C :: (a, b, c, d, e) -> ExtractL7T (a, b, c, d, e) #

ExtractL7C (a, b, c, d, e, f) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL7T (a, b, c, d, e, f) :: Type #

Methods

extractL7C :: (a, b, c, d, e, f) -> ExtractL7T (a, b, c, d, e, f) #

ExtractL7C (a, b, c, d, e, f, g) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL7T (a, b, c, d, e, f, g) :: Type #

Methods

extractL7C :: (a, b, c, d, e, f, g) -> ExtractL7T (a, b, c, d, e, f, g) #

ExtractL7C (a, b, c, d, e, f, g, h) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL7T (a, b, c, d, e, f, g, h) :: Type #

Methods

extractL7C :: (a, b, c, d, e, f, g, h) -> ExtractL7T (a, b, c, d, e, f, g, h) #

class ExtractL8C tp where #

extract the eighth element from a n-tuple

Associated Types

type ExtractL8T tp #

Methods

extractL8C :: tp -> ExtractL8T tp #

Instances
ExtractL8C (a, b) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL8T (a, b) :: Type #

Methods

extractL8C :: (a, b) -> ExtractL8T (a, b) #

ExtractL8C (a, b, c) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL8T (a, b, c) :: Type #

Methods

extractL8C :: (a, b, c) -> ExtractL8T (a, b, c) #

ExtractL8C (a, b, c, d) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL8T (a, b, c, d) :: Type #

Methods

extractL8C :: (a, b, c, d) -> ExtractL8T (a, b, c, d) #

ExtractL8C (a, b, c, d, e) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL8T (a, b, c, d, e) :: Type #

Methods

extractL8C :: (a, b, c, d, e) -> ExtractL8T (a, b, c, d, e) #

ExtractL8C (a, b, c, d, e, f) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL8T (a, b, c, d, e, f) :: Type #

Methods

extractL8C :: (a, b, c, d, e, f) -> ExtractL8T (a, b, c, d, e, f) #

ExtractL8C (a, b, c, d, e, f, g) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL8T (a, b, c, d, e, f, g) :: Type #

Methods

extractL8C :: (a, b, c, d, e, f, g) -> ExtractL8T (a, b, c, d, e, f, g) #

ExtractL8C (a, b, c, d, e, f, g, h) # 
Instance details

Defined in Predicate.Misc

Associated Types

type ExtractL8T (a, b, c, d, e, f, g, h) :: Type #

Methods

extractL8C :: (a, b, c, d, e, f, g, h) -> ExtractL8T (a, b, c, d, e, f, g, h) #

primes

isPrime :: Int -> Bool #

prime predicate

>>> isPrime 7
True
>>> isPrime 6
False

primeStream :: [Integer] #

primes stream

>>> take 10 primeStream
[2,3,5,7,11,13,17,19,23,29]

primeFactors :: Integer -> [Integer] #

prime factors

>>> primeFactors 100
[2,2,5,5]
>>> primeFactors 123
[3,41]

regular expressions

compileRegex :: forall rs. GetROpts rs => String -> String -> Either (String, String) Regex #

compile a regex using type level options

data ROpt #

Regex options for Rescan Resplit Re etc

Constructors

Anchored

Force pattern anchoring

AutoCallout

Compile automatic callouts | BsrAnycrlf -- R matches only CR, LF, or CrlF | BsrUnicode -- ^ R matches all Unicode line endings

Caseless

Do caseless matching

DollarEndonly

dollar not to match newline at end

Dotall

matches anything including NL

Dupnames

Allow duplicate names for subpatterns

Extended

Ignore whitespace and # comments

Extra

PCRE extra features (not much use currently)

Firstline

Force matching to be before newline

Multiline

caret and dollar match newlines within data | NewlineAny -- ^ Recognize any Unicode newline sequence | NewlineAnycrlf -- ^ Recognize CR, LF, and CrlF as newline sequences

NewlineCr

Set CR as the newline sequence

NewlineCrlf

Set CrlF as the newline sequence

NewlineLf

Set LF as the newline sequence

NoAutoCapture

Disable numbered capturing parentheses (named ones available)

Ungreedy

Invert greediness of quantifiers

Utf8

Run in UTF--8 mode

NoUtf8Check

Do not check the pattern for UTF-8 validity

Instances
Bounded ROpt # 
Instance details

Defined in Predicate.Misc

Enum ROpt # 
Instance details

Defined in Predicate.Misc

Methods

succ :: ROpt -> ROpt #

pred :: ROpt -> ROpt #

toEnum :: Int -> ROpt #

fromEnum :: ROpt -> Int #

enumFrom :: ROpt -> [ROpt] #

enumFromThen :: ROpt -> ROpt -> [ROpt] #

enumFromTo :: ROpt -> ROpt -> [ROpt] #

enumFromThenTo :: ROpt -> ROpt -> ROpt -> [ROpt] #

Eq ROpt # 
Instance details

Defined in Predicate.Misc

Methods

(==) :: ROpt -> ROpt -> Bool #

(/=) :: ROpt -> ROpt -> Bool #

Ord ROpt # 
Instance details

Defined in Predicate.Misc

Methods

compare :: ROpt -> ROpt -> Ordering #

(<) :: ROpt -> ROpt -> Bool #

(<=) :: ROpt -> ROpt -> Bool #

(>) :: ROpt -> ROpt -> Bool #

(>=) :: ROpt -> ROpt -> Bool #

max :: ROpt -> ROpt -> ROpt #

min :: ROpt -> ROpt -> ROpt #

Read ROpt # 
Instance details

Defined in Predicate.Misc

Show ROpt # 
Instance details

Defined in Predicate.Misc

Methods

showsPrec :: Int -> ROpt -> ShowS #

show :: ROpt -> String #

showList :: [ROpt] -> ShowS #

GetROpts ([] :: [ROpt]) # 
Instance details

Defined in Predicate.Misc

Methods

getROpts :: ([String], [PCREOption]) #

(Typeable r, GetROpt r, GetROpts rs) => GetROpts (r ': rs) # 
Instance details

Defined in Predicate.Misc

Methods

getROpts :: ([String], [PCREOption]) #

class GetROpts (os :: [ROpt]) where #

extract the regex options from the type level list

Methods

getROpts :: ([String], [PCREOption]) #

Instances
GetROpts ([] :: [ROpt]) # 
Instance details

Defined in Predicate.Misc

Methods

getROpts :: ([String], [PCREOption]) #

(Typeable r, GetROpt r, GetROpts rs) => GetROpts (r ': rs) # 
Instance details

Defined in Predicate.Misc

Methods

getROpts :: ([String], [PCREOption]) #

data RReplace #

used by ReplaceImpl and sub and gsub to allow more flexible replacement These parallel the RegexReplacement (not exported) class in Text.Regex.PCRE.Heavy but have overlappable instances which is problematic for this code so I use RReplace

Instances
Show RReplace # 
Instance details

Defined in Predicate.Misc

class GetReplaceFnSub (k :: ReplaceFnSub) where #

extract replacement options from typelevel

Instances
GetReplaceFnSub RPrepend # 
Instance details

Defined in Predicate.Misc

GetReplaceFnSub ROverWrite # 
Instance details

Defined in Predicate.Misc

GetReplaceFnSub RAppend # 
Instance details

Defined in Predicate.Misc

data ReplaceFnSub #

simple regex string replacement options

Constructors

RPrepend 
ROverWrite 
RAppend 
Instances
Bounded ReplaceFnSub # 
Instance details

Defined in Predicate.Misc

Enum ReplaceFnSub # 
Instance details

Defined in Predicate.Misc

Eq ReplaceFnSub # 
Instance details

Defined in Predicate.Misc

Read ReplaceFnSub # 
Instance details

Defined in Predicate.Misc

Show ReplaceFnSub # 
Instance details

Defined in Predicate.Misc

P (ReplaceAllStringT o p q r) x => P (ReplaceAllString o p q r :: Type) x # 
Instance details

Defined in Predicate.Data.Regex

Associated Types

type PP (ReplaceAllString o p q r) x :: Type #

Methods

eval :: MonadEval m => proxy (ReplaceAllString o p q r) -> POpts -> x -> m (TT (PP (ReplaceAllString o p q r) x)) #

type PP (ReplaceAllString o p q r :: Type) x # 
Instance details

Defined in Predicate.Data.Regex

type PP (ReplaceAllString o p q r :: Type) x

displayROpts :: [String] -> String #

display regex options

colors

newtype SColor #

wrapper for a Show instance around Color

Constructors

SColor Color 
Instances
Bounded SColor # 
Instance details

Defined in Predicate.Misc

Enum SColor # 
Instance details

Defined in Predicate.Misc

Show SColor # 
Instance details

Defined in Predicate.Misc

class GetColor (a :: Color) where #

get Color from the typelevel

Methods

getColor :: Color #

Instances
GetColor Black # 
Instance details

Defined in Predicate.Misc

Methods

getColor :: Color #

GetColor Blue # 
Instance details

Defined in Predicate.Misc

Methods

getColor :: Color #

GetColor Cyan # 
Instance details

Defined in Predicate.Misc

Methods

getColor :: Color #

GetColor Default # 
Instance details

Defined in Predicate.Misc

Methods

getColor :: Color #

GetColor Green # 
Instance details

Defined in Predicate.Misc

Methods

getColor :: Color #

GetColor Magenta # 
Instance details

Defined in Predicate.Misc

Methods

getColor :: Color #

GetColor Red # 
Instance details

Defined in Predicate.Misc

Methods

getColor :: Color #

GetColor White # 
Instance details

Defined in Predicate.Misc

Methods

getColor :: Color #

GetColor Yellow # 
Instance details

Defined in Predicate.Misc

Methods

getColor :: Color #

miscellaneous

class Bifunctor p => SwapC p where #

Methods

swapC :: p a b -> p b a #

Instances
SwapC Either # 
Instance details

Defined in Predicate.Misc

Methods

swapC :: Either a b -> Either b a #

SwapC (,) # 
Instance details

Defined in Predicate.Misc

Methods

swapC :: (a, b) -> (b, a) #

SwapC Arg # 
Instance details

Defined in Predicate.Misc

Methods

swapC :: Arg a b -> Arg b a #

SwapC These # 
Instance details

Defined in Predicate.Misc

Methods

swapC :: These a b -> These b a #

SwapC ((,,) a) # 
Instance details

Defined in Predicate.Misc

Methods

swapC :: (a, a0, b) -> (a, b, a0) #

SwapC ((,,,) a b) # 
Instance details

Defined in Predicate.Misc

Methods

swapC :: (a, b, a0, b0) -> (a, b, b0, a0) #

SwapC ((,,,,) a b c) # 
Instance details

Defined in Predicate.Misc

Methods

swapC :: (a, b, c, a0, b0) -> (a, b, c, b0, a0) #

SwapC ((,,,,,) a b c d) # 
Instance details

Defined in Predicate.Misc

Methods

swapC :: (a, b, c, d, a0, b0) -> (a, b, c, d, b0, a0) #

SwapC ((,,,,,,) a b c d e) # 
Instance details

Defined in Predicate.Misc

Methods

swapC :: (a, b, c, d, e, a0, b0) -> (a, b, c, d, e, b0, a0) #

showTK :: forall r. Typeable r => String #

show the kind as a string

showT :: forall (t :: Type). Typeable t => String #

show the type as a string

showThese :: These a b -> String #

display constructor name for These

prettyOrd :: Ordering -> String #

pretty print Ordering

unlessNull :: (Foldable t, Monoid m) => t a -> m -> m #

convenience method for optional display

unlessNullM :: (Foldable t, Applicative m) => t a -> (t a -> m ()) -> m () #

pureTryTest :: a -> IO (Either () a) #

pureTryTestPred :: (String -> Bool) -> a -> IO (Either String (Either () a)) #

(~>) :: Bool -> Bool -> Bool infixr 1 #

boolean implication

>>> True ~> False
False
>>> True ~> True
True
>>> False ~> False
True
>>> False ~> True
True

drawTreeU :: Tree String -> String #

draw a tree using unicode

asProxyLeft :: proxy a -> proxy1 a -> proxy a #

asProxyRight :: proxy a -> proxy1 a -> proxy1 a #

removeAnsi :: Show a => Either String a -> IO () #

strip ansi characters from a string and print it (for doctests)

_Id :: Lens (Identity a) (Identity b) a b #