Safe Haskell | None |
---|---|
Language | Haskell2010 |
Utility methods for Predicate / methods for displaying the evaluation tree
Synopsis
- type family AndT (b :: Bool) (b1 :: Bool) :: Bool where ...
- type family OrT (b :: Bool) (b1 :: Bool) :: Bool where ...
- type family NotT (b :: Bool) :: Bool where ...
- type family RepeatT (n :: Nat) (p :: k) :: [k] where ...
- type family IntersperseT (s :: Symbol) (xs :: [Symbol]) :: Symbol where ...
- type family LenT (xs :: [k]) :: Nat where ...
- type family FlipT (d :: k1 -> k -> k2) (p :: k) (q :: k1) :: k2 where ...
- type family IfT (b :: Bool) (t :: k) (f :: k) :: k where ...
- type family SumT (ns :: [Nat]) :: Nat where ...
- type family MapT (f :: k -> k1) (xs :: [k]) :: [k1] where ...
- type family ConsT s where ...
- type family (p :: k -> k1) %% (q :: k) :: k1 where ...
- type family (p :: k) %& (q :: k -> k1) :: k1 where ...
- type (<%>) s t = AppendSymbol s t
- type family ExtractAFromList (as :: Type) :: Type where ...
- type family ExtractAFromTA (ta :: Type) :: Type where ...
- type family ExtractTFromTA (ta :: Type) :: Type -> Type where ...
- type family MaybeT mb where ...
- type family LeftT lr where ...
- type family RightT lr where ...
- type family ThisT lr where ...
- type family ThatT lr where ...
- type family TheseT lr where ...
- type family FnT ab :: Type where ...
- type family ApplyConstT (ta :: Type) (b :: Type) :: Type where ...
- type family CheckT (tp :: Type) :: Bool where ...
- type family JoinT x y where ...
- type family FailWhenT (b :: Bool) (msg :: ErrorMessage) :: Constraint where ...
- type family FailUnlessT (b :: Bool) (msg :: ErrorMessage) :: Constraint where ...
- type family ZwischenT (a :: Nat) (b :: Nat) (v :: Nat) :: Constraint where ...
- class GetBool (a :: Bool) where
- class GetLen xs where
- class GetThese th where
- class GetOrdering (cmp :: Ordering) where
- data OrderingP
- class GetOrd (k :: OrderingP) where
- nat :: forall n a. (KnownNat n, Num a) => a
- symb :: forall s. KnownSymbol s => String
- class ToITupleC x where
- class ToITupleListC (n :: Nat) a where
- type ToITupleListP n a
- toITupleListC :: [a] -> Either String (ToITupleListP n a)
- class ReverseITupleC x xs ys where
- type ReverseITupleT x xs ys
- reverseITupleC :: x -> xs -> ys -> ReverseITupleT x xs ys
- class TupleC (n :: Nat) a where
- type family T4_1 x where ...
- type family T4_2 x where ...
- type family T4_3 x where ...
- type family T4_4 x where ...
- type family T5_1 x where ...
- type family T5_2 x where ...
- type family T5_3 x where ...
- type family T5_4 x where ...
- type family T5_5 x where ...
- class ExtractL1C tp where
- type ExtractL1T tp
- extractL1C :: tp -> ExtractL1T tp
- class ExtractL2C tp where
- type ExtractL2T tp
- extractL2C :: tp -> ExtractL2T tp
- class ExtractL3C tp where
- type ExtractL3T tp
- extractL3C :: tp -> ExtractL3T tp
- class ExtractL4C tp where
- type ExtractL4T tp
- extractL4C :: tp -> ExtractL4T tp
- class ExtractL5C tp where
- type ExtractL5T tp
- extractL5C :: tp -> ExtractL5T tp
- class ExtractL6C tp where
- type ExtractL6T tp
- extractL6C :: tp -> ExtractL6T tp
- class ExtractL7C tp where
- type ExtractL7T tp
- extractL7C :: tp -> ExtractL7T tp
- class ExtractL8C tp where
- type ExtractL8T tp
- extractL8C :: tp -> ExtractL8T tp
- isPrime :: Int -> Bool
- primeStream :: [Integer]
- primeFactors :: Integer -> [Integer]
- compileRegex :: forall rs. GetROpts rs => String -> String -> Either (String, String) Regex
- data ROpt
- class GetROpts (os :: [ROpt]) where
- data RReplace
- class GetReplaceFnSub (k :: ReplaceFnSub) where
- data ReplaceFnSub
- displayROpts :: [String] -> String
- newtype SColor = SColor Color
- class GetColor (a :: Color) where
- class Bifunctor p => SwapC p where
- swapC :: p a b -> p b a
- showTK :: forall r. Typeable r => String
- showT :: forall (t :: Type). Typeable t => String
- showThese :: These a b -> String
- prettyOrd :: Ordering -> String
- unlessNull :: (Foldable t, Monoid m) => t a -> m -> m
- unlessNullM :: (Foldable t, Applicative m) => t a -> (t a -> m ()) -> m ()
- nullSpace :: String -> String
- nullIf :: String -> String -> String
- pureTryTest :: a -> IO (Either () a)
- pureTryTestPred :: (String -> Bool) -> a -> IO (Either String (Either () a))
- (~>) :: Bool -> Bool -> Bool
- errorInProgram :: HasCallStack => String -> x
- drawTreeU :: Tree String -> String
- asProxyLeft :: proxy a -> proxy1 a -> proxy a
- asProxyRight :: proxy a -> proxy1 a -> proxy1 a
- removeAnsi :: Show a => Either String a -> IO ()
- _Id :: Lens (Identity a) (Identity b) a b
useful type families
type family IntersperseT (s :: Symbol) (xs :: [Symbol]) :: Symbol where ... #
Intersperse a symbol inside a list of symbols
IntersperseT _s '[] = "" | |
IntersperseT _s '[x] = x | |
IntersperseT s (x ': (y ': xs)) = x <%> (s <%> IntersperseT s (y ': xs)) |
type family FlipT (d :: k1 -> k -> k2) (p :: k) (q :: k1) :: k2 where ... #
flip
at the type level
FlipT d p q = d 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
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
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
ExtractTFromTA (t _a) = t | |
ExtractTFromTA z = TypeError (Text "ExtractTFromTA: expected (t a) but found something else" :$$: (Text "t a = " :<>: ShowType z)) |
type family ApplyConstT (ta :: Type) (b :: Type) :: Type where ... #
type family FailWhenT (b :: Bool) (msg :: ErrorMessage) :: Constraint where ... #
helper method that fails with a msg when True
type family FailUnlessT (b :: Bool) (msg :: ErrorMessage) :: Constraint where ... #
helper method that fails with msg when False
FailUnlessT True _ = () | |
FailUnlessT False e = TypeError e |
extract values from the type level
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
Instances
GetLen ([] :: [k]) # | |
Defined in Predicate.Misc | |
GetLen (Nothing :: Maybe a) # | |
Defined in Predicate.Misc | |
GetLen (Just a2 :: Maybe a1) # | |
Defined in Predicate.Misc | |
GetLen xs => GetLen (x ': xs :: [a]) # | |
Defined in Predicate.Misc | |
GetLen xs => GetLen (x :| xs :: NonEmpty a) # | |
Defined in Predicate.Misc | |
GetLen (Right a2 :: Either a1 b) # | |
Defined in Predicate.Misc | |
GetLen (Left a2 :: Either a1 b) # | |
Defined in Predicate.Misc | |
GetLen (That a2 :: These a1 b) # | |
Defined in Predicate.Misc | |
GetLen (This a2 :: These a1 b) # | |
Defined in Predicate.Misc | |
GetLen (These a2 b2 :: These a1 b1) # | |
Defined in Predicate.Misc |
get These
from typelevel
Instances
GetThese (That y :: These a b) # | |
Defined in Predicate.Misc | |
GetThese (This x :: These a b) # | |
Defined in Predicate.Misc | |
GetThese (These x y :: These a b) # | |
Defined in Predicate.Misc |
class GetOrdering (cmp :: Ordering) where #
get ordering from the typelevel
getOrdering :: Ordering #
Instances
GetOrdering LT # | |
Defined in Predicate.Misc getOrdering :: Ordering # | |
GetOrdering EQ # | |
Defined in Predicate.Misc getOrdering :: Ordering # | |
GetOrdering GT # | |
Defined in Predicate.Misc getOrdering :: Ordering # |
all the ways to compare two values
Instances
Bounded OrderingP # | |
Enum OrderingP # | |
Defined in Predicate.Misc succ :: OrderingP -> OrderingP # pred :: OrderingP -> OrderingP # fromEnum :: OrderingP -> Int # enumFrom :: OrderingP -> [OrderingP] # enumFromThen :: OrderingP -> OrderingP -> [OrderingP] # enumFromTo :: OrderingP -> OrderingP -> [OrderingP] # enumFromThenTo :: OrderingP -> OrderingP -> OrderingP -> [OrderingP] # | |
Eq OrderingP # | |
Read OrderingP # | |
Show OrderingP # | |
class GetOrd (k :: OrderingP) where #
extract OrderingP
from the typelevel
symb :: forall s. KnownSymbol s => String #
gets the Symbol from the typelevel
>>>
symb @"abc"
"abc"
inductive tuples
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',()))
Instances
(TypeError (Text "ToITupleC: inductive tuple cannot be empty") :: Constraint) => ToITupleC () # | |
ToITupleC (a, b) # | |
ToITupleC (a, b, c) # | |
ToITupleC (a, b, c, d) # | |
ToITupleC (a, b, c, d, e) # | |
ToITupleC (a, b, c, d, e, f) # | |
ToITupleC (a, b, c, d, e, f, g) # | |
ToITupleC (a, b, c, d, e, f, g, h) # | |
ToITupleC (a, b, c, d, e, f, g, h, i) # | |
ToITupleC (a, b, c, d, e, f, g, h, i, j) # | |
ToITupleC (a, b, c, d, e, f, g, h, i, j, k) # | |
ToITupleC (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"
type ToITupleListP n a #
toITupleListC :: [a] -> Either String (ToITupleListP n a) #
Instances
class ReverseITupleC x xs ys where #
type ReverseITupleT x xs ys #
reverseITupleC :: x -> xs -> ys -> ReverseITupleT x xs ys #
Instances
ReverseITupleC x () ys # | |
Defined in Predicate.Misc type ReverseITupleT x () ys :: Type # reverseITupleC :: x -> () -> ys -> ReverseITupleT x () ys # | |
ReverseITupleC w ws (x, ys) => ReverseITupleC x (w, ws) ys # | |
Defined in Predicate.Misc type ReverseITupleT x (w, ws) ys :: Type # 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
Instances
TupleC 2 a # | convert a list of at least 2 elements to a 2-tuple |
TupleC 3 a # | convert a list of at least 3 elements to a 3-tuple |
TupleC 4 a # | convert a list of at least 4 elements to a 4-tuple |
TupleC 5 a # | convert a list of at least 5 elements to a 5-tuple |
TupleC 6 a # | convert a list of at least 6 elements to a 6-tuple |
TupleC 7 a # | convert a list of at least 7 elements to a 7-tuple |
TupleC 8 a # | convert a list of at least 8 elements to a 8-tuple |
TupleC 9 a # | convert a list of at least 9 elements to a 9-tuple |
TupleC 10 a # | convert a list of at least 10 elements to a 10-tuple |
TupleC 11 a # | convert a list of at least 11 elements to a 11-tuple |
TupleC 12 a # | convert a list of at least 12 elements to a 12-tuple |
extract from n-tuple
type family T4_1 x where ... #
extract opts
part of 4 tuple from the type level for use with Refined2
T4_1 '(opts, _, _, _) = opts |
type family T4_2 x where ... #
extract ip
part of 4 tuple from the type level for use with Refined2
T4_2 '(_, ip, _, _) = ip |
type family T4_3 x where ... #
extract op
part of 4 tuple from the type level for use with Refined2
T4_3 '(_, _, op, _) = op |
type family T4_4 x where ... #
extract i
part of 4 tuple from the type level for use with Refined2
T4_4 '(_, _, _, i) = i |
type family T5_1 x where ... #
extract opts
part of 5 tuple from the type level for use with Refined3
T5_1 '(opts, _, _, _, _) = opts |
type family T5_2 x where ... #
extract ip
part of 5 tuple from the type level for use with Refined3
T5_2 '(_, ip, _, _, _) = ip |
type family T5_3 x where ... #
extract op
part of 5 tuple from the type level for use with Refined3
T5_3 '(_, _, op, _, _) = op |
type family T5_4 x where ... #
extract fmt
part of 5 tuple from the type level for use with Refined3
T5_4 '(_, _, _, fmt, _) = fmt |
type family T5_5 x where ... #
extract i
part of 5 tuple from the type level for use with Refined3
T5_5 '(_, _, _, _, i) = i |
tuple classes
class ExtractL1C tp where #
extract the first element from a n-tuple
type ExtractL1T tp #
extractL1C :: tp -> ExtractL1T tp #
Instances
ExtractL1C (a, b) # | |
Defined in Predicate.Misc type ExtractL1T (a, b) :: Type # extractL1C :: (a, b) -> ExtractL1T (a, b) # | |
ExtractL1C (a, b, c) # | |
Defined in Predicate.Misc type ExtractL1T (a, b, c) :: Type # extractL1C :: (a, b, c) -> ExtractL1T (a, b, c) # | |
ExtractL1C (a, b, c, d) # | |
Defined in Predicate.Misc type ExtractL1T (a, b, c, d) :: Type # extractL1C :: (a, b, c, d) -> ExtractL1T (a, b, c, d) # | |
ExtractL1C (a, b, c, d, e) # | |
Defined in Predicate.Misc type ExtractL1T (a, b, c, d, e) :: Type # extractL1C :: (a, b, c, d, e) -> ExtractL1T (a, b, c, d, e) # | |
ExtractL1C (a, b, c, d, e, f) # | |
Defined in Predicate.Misc type ExtractL1T (a, b, c, d, e, f) :: Type # extractL1C :: (a, b, c, d, e, f) -> ExtractL1T (a, b, c, d, e, f) # | |
ExtractL1C (a, b, c, d, e, f, g) # | |
Defined in Predicate.Misc type ExtractL1T (a, b, c, d, e, f, g) :: Type # 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) # | |
Defined in Predicate.Misc type ExtractL1T (a, b, c, d, e, f, g, h) :: Type # 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
type ExtractL2T tp #
extractL2C :: tp -> ExtractL2T tp #
Instances
ExtractL2C (a, b) # | |
Defined in Predicate.Misc type ExtractL2T (a, b) :: Type # extractL2C :: (a, b) -> ExtractL2T (a, b) # | |
ExtractL2C (a, b, c) # | |
Defined in Predicate.Misc type ExtractL2T (a, b, c) :: Type # extractL2C :: (a, b, c) -> ExtractL2T (a, b, c) # | |
ExtractL2C (a, b, c, d) # | |
Defined in Predicate.Misc type ExtractL2T (a, b, c, d) :: Type # extractL2C :: (a, b, c, d) -> ExtractL2T (a, b, c, d) # | |
ExtractL2C (a, b, c, d, e) # | |
Defined in Predicate.Misc type ExtractL2T (a, b, c, d, e) :: Type # extractL2C :: (a, b, c, d, e) -> ExtractL2T (a, b, c, d, e) # | |
ExtractL2C (a, b, c, d, e, f) # | |
Defined in Predicate.Misc type ExtractL2T (a, b, c, d, e, f) :: Type # extractL2C :: (a, b, c, d, e, f) -> ExtractL2T (a, b, c, d, e, f) # | |
ExtractL2C (a, b, c, d, e, f, g) # | |
Defined in Predicate.Misc type ExtractL2T (a, b, c, d, e, f, g) :: Type # 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) # | |
Defined in Predicate.Misc type ExtractL2T (a, b, c, d, e, f, g, h) :: Type # 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
type ExtractL3T tp #
extractL3C :: tp -> ExtractL3T tp #
Instances
ExtractL3C (a, b) # | |
Defined in Predicate.Misc type ExtractL3T (a, b) :: Type # extractL3C :: (a, b) -> ExtractL3T (a, b) # | |
ExtractL3C (a, b, c) # | |
Defined in Predicate.Misc type ExtractL3T (a, b, c) :: Type # extractL3C :: (a, b, c) -> ExtractL3T (a, b, c) # | |
ExtractL3C (a, b, c, d) # | |
Defined in Predicate.Misc type ExtractL3T (a, b, c, d) :: Type # extractL3C :: (a, b, c, d) -> ExtractL3T (a, b, c, d) # | |
ExtractL3C (a, b, c, d, e) # | |
Defined in Predicate.Misc type ExtractL3T (a, b, c, d, e) :: Type # extractL3C :: (a, b, c, d, e) -> ExtractL3T (a, b, c, d, e) # | |
ExtractL3C (a, b, c, d, e, f) # | |
Defined in Predicate.Misc type ExtractL3T (a, b, c, d, e, f) :: Type # extractL3C :: (a, b, c, d, e, f) -> ExtractL3T (a, b, c, d, e, f) # | |
ExtractL3C (a, b, c, d, e, f, g) # | |
Defined in Predicate.Misc type ExtractL3T (a, b, c, d, e, f, g) :: Type # 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) # | |
Defined in Predicate.Misc type ExtractL3T (a, b, c, d, e, f, g, h) :: Type # 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
type ExtractL4T tp #
extractL4C :: tp -> ExtractL4T tp #
Instances
ExtractL4C (a, b) # | |
Defined in Predicate.Misc type ExtractL4T (a, b) :: Type # extractL4C :: (a, b) -> ExtractL4T (a, b) # | |
ExtractL4C (a, b, c) # | |
Defined in Predicate.Misc type ExtractL4T (a, b, c) :: Type # extractL4C :: (a, b, c) -> ExtractL4T (a, b, c) # | |
ExtractL4C (a, b, c, d) # | |
Defined in Predicate.Misc type ExtractL4T (a, b, c, d) :: Type # extractL4C :: (a, b, c, d) -> ExtractL4T (a, b, c, d) # | |
ExtractL4C (a, b, c, d, e) # | |
Defined in Predicate.Misc type ExtractL4T (a, b, c, d, e) :: Type # extractL4C :: (a, b, c, d, e) -> ExtractL4T (a, b, c, d, e) # | |
ExtractL4C (a, b, c, d, e, f) # | |
Defined in Predicate.Misc type ExtractL4T (a, b, c, d, e, f) :: Type # extractL4C :: (a, b, c, d, e, f) -> ExtractL4T (a, b, c, d, e, f) # | |
ExtractL4C (a, b, c, d, e, f, g) # | |
Defined in Predicate.Misc type ExtractL4T (a, b, c, d, e, f, g) :: Type # 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) # | |
Defined in Predicate.Misc type ExtractL4T (a, b, c, d, e, f, g, h) :: Type # 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
type ExtractL5T tp #
extractL5C :: tp -> ExtractL5T tp #
Instances
ExtractL5C (a, b) # | |
Defined in Predicate.Misc type ExtractL5T (a, b) :: Type # extractL5C :: (a, b) -> ExtractL5T (a, b) # | |
ExtractL5C (a, b, c) # | |
Defined in Predicate.Misc type ExtractL5T (a, b, c) :: Type # extractL5C :: (a, b, c) -> ExtractL5T (a, b, c) # | |
ExtractL5C (a, b, c, d) # | |
Defined in Predicate.Misc type ExtractL5T (a, b, c, d) :: Type # extractL5C :: (a, b, c, d) -> ExtractL5T (a, b, c, d) # | |
ExtractL5C (a, b, c, d, e) # | |
Defined in Predicate.Misc type ExtractL5T (a, b, c, d, e) :: Type # extractL5C :: (a, b, c, d, e) -> ExtractL5T (a, b, c, d, e) # | |
ExtractL5C (a, b, c, d, e, f) # | |
Defined in Predicate.Misc type ExtractL5T (a, b, c, d, e, f) :: Type # extractL5C :: (a, b, c, d, e, f) -> ExtractL5T (a, b, c, d, e, f) # | |
ExtractL5C (a, b, c, d, e, f, g) # | |
Defined in Predicate.Misc type ExtractL5T (a, b, c, d, e, f, g) :: Type # 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) # | |
Defined in Predicate.Misc type ExtractL5T (a, b, c, d, e, f, g, h) :: Type # 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
type ExtractL6T tp #
extractL6C :: tp -> ExtractL6T tp #
Instances
ExtractL6C (a, b) # | |
Defined in Predicate.Misc type ExtractL6T (a, b) :: Type # extractL6C :: (a, b) -> ExtractL6T (a, b) # | |
ExtractL6C (a, b, c) # | |
Defined in Predicate.Misc type ExtractL6T (a, b, c) :: Type # extractL6C :: (a, b, c) -> ExtractL6T (a, b, c) # | |
ExtractL6C (a, b, c, d) # | |
Defined in Predicate.Misc type ExtractL6T (a, b, c, d) :: Type # extractL6C :: (a, b, c, d) -> ExtractL6T (a, b, c, d) # | |
ExtractL6C (a, b, c, d, e) # | |
Defined in Predicate.Misc type ExtractL6T (a, b, c, d, e) :: Type # extractL6C :: (a, b, c, d, e) -> ExtractL6T (a, b, c, d, e) # | |
ExtractL6C (a, b, c, d, e, f) # | |
Defined in Predicate.Misc type ExtractL6T (a, b, c, d, e, f) :: Type # extractL6C :: (a, b, c, d, e, f) -> ExtractL6T (a, b, c, d, e, f) # | |
ExtractL6C (a, b, c, d, e, f, g) # | |
Defined in Predicate.Misc type ExtractL6T (a, b, c, d, e, f, g) :: Type # 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) # | |
Defined in Predicate.Misc type ExtractL6T (a, b, c, d, e, f, g, h) :: Type # 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
type ExtractL7T tp #
extractL7C :: tp -> ExtractL7T tp #
Instances
ExtractL7C (a, b) # | |
Defined in Predicate.Misc type ExtractL7T (a, b) :: Type # extractL7C :: (a, b) -> ExtractL7T (a, b) # | |
ExtractL7C (a, b, c) # | |
Defined in Predicate.Misc type ExtractL7T (a, b, c) :: Type # extractL7C :: (a, b, c) -> ExtractL7T (a, b, c) # | |
ExtractL7C (a, b, c, d) # | |
Defined in Predicate.Misc type ExtractL7T (a, b, c, d) :: Type # extractL7C :: (a, b, c, d) -> ExtractL7T (a, b, c, d) # | |
ExtractL7C (a, b, c, d, e) # | |
Defined in Predicate.Misc type ExtractL7T (a, b, c, d, e) :: Type # extractL7C :: (a, b, c, d, e) -> ExtractL7T (a, b, c, d, e) # | |
ExtractL7C (a, b, c, d, e, f) # | |
Defined in Predicate.Misc type ExtractL7T (a, b, c, d, e, f) :: Type # extractL7C :: (a, b, c, d, e, f) -> ExtractL7T (a, b, c, d, e, f) # | |
ExtractL7C (a, b, c, d, e, f, g) # | |
Defined in Predicate.Misc type ExtractL7T (a, b, c, d, e, f, g) :: Type # 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) # | |
Defined in Predicate.Misc type ExtractL7T (a, b, c, d, e, f, g, h) :: Type # 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
type ExtractL8T tp #
extractL8C :: tp -> ExtractL8T tp #
Instances
ExtractL8C (a, b) # | |
Defined in Predicate.Misc type ExtractL8T (a, b) :: Type # extractL8C :: (a, b) -> ExtractL8T (a, b) # | |
ExtractL8C (a, b, c) # | |
Defined in Predicate.Misc type ExtractL8T (a, b, c) :: Type # extractL8C :: (a, b, c) -> ExtractL8T (a, b, c) # | |
ExtractL8C (a, b, c, d) # | |
Defined in Predicate.Misc type ExtractL8T (a, b, c, d) :: Type # extractL8C :: (a, b, c, d) -> ExtractL8T (a, b, c, d) # | |
ExtractL8C (a, b, c, d, e) # | |
Defined in Predicate.Misc type ExtractL8T (a, b, c, d, e) :: Type # extractL8C :: (a, b, c, d, e) -> ExtractL8T (a, b, c, d, e) # | |
ExtractL8C (a, b, c, d, e, f) # | |
Defined in Predicate.Misc type ExtractL8T (a, b, c, d, e, f) :: Type # extractL8C :: (a, b, c, d, e, f) -> ExtractL8T (a, b, c, d, e, f) # | |
ExtractL8C (a, b, c, d, e, f, g) # | |
Defined in Predicate.Misc type ExtractL8T (a, b, c, d, e, f, g) :: Type # 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) # | |
Defined in Predicate.Misc type ExtractL8T (a, b, c, d, e, f, g, h) :: Type # extractL8C :: (a, b, c, d, e, f, g, h) -> ExtractL8T (a, b, c, d, e, f, g, h) # |
primes
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
Regex options for Rescan Resplit Re etc
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 |
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
class GetReplaceFnSub (k :: ReplaceFnSub) where #
extract replacement options from typelevel
Instances
GetReplaceFnSub RPrepend # | |
Defined in Predicate.Misc | |
GetReplaceFnSub ROverWrite # | |
Defined in Predicate.Misc | |
GetReplaceFnSub RAppend # | |
Defined in Predicate.Misc |
data ReplaceFnSub #
simple regex string replacement options
Instances
displayROpts :: [String] -> String #
display regex options
colors
wrapper for a Show instance around Color
class GetColor (a :: Color) where #
get Color
from the typelevel
Instances
GetColor Black # | |
Defined in Predicate.Misc | |
GetColor Blue # | |
Defined in Predicate.Misc | |
GetColor Cyan # | |
Defined in Predicate.Misc | |
GetColor Default # | |
Defined in Predicate.Misc | |
GetColor Green # | |
Defined in Predicate.Misc | |
GetColor Magenta # | |
Defined in Predicate.Misc | |
GetColor Red # | |
Defined in Predicate.Misc | |
GetColor White # | |
Defined in Predicate.Misc | |
GetColor Yellow # | |
Defined in Predicate.Misc |
miscellaneous
class Bifunctor p => SwapC p where #
Instances
SwapC Either # | |
Defined in Predicate.Misc | |
SwapC (,) # | |
Defined in Predicate.Misc | |
SwapC Arg # | |
Defined in Predicate.Misc | |
SwapC These # | |
Defined in Predicate.Misc | |
SwapC ((,,) a) # | |
Defined in Predicate.Misc | |
SwapC ((,,,) a b) # | |
Defined in Predicate.Misc | |
SwapC ((,,,,) a b c) # | |
Defined in Predicate.Misc | |
SwapC ((,,,,,) a b c d) # | |
Defined in Predicate.Misc | |
SwapC ((,,,,,,) a b c d e) # | |
Defined in Predicate.Misc |
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) #
(~>) :: Bool -> Bool -> Bool infixr 1 #
boolean implication
>>>
True ~> False
False
>>>
True ~> True
True
>>>
False ~> False
True
>>>
False ~> True
True
errorInProgram :: HasCallStack => String -> x #
asProxyLeft :: proxy a -> proxy1 a -> proxy a #
asProxyRight :: proxy a -> proxy1 a -> proxy1 a #