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

Copyright(c) Grant Weyburne 2019
LicenseBSD-3
Maintainergbwey9@gmail.com
Safe HaskellNone
LanguageHaskell2010

UtilP

Description

 
Synopsis

Documentation

data TT a Source #

describes the evaluation tree for predicates

Constructors

TT

the child nodes

Fields

Instances
Foldable TT Source # 
Instance details

Defined in UtilP

Methods

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

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

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

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

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

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

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

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

toList :: TT a -> [a] #

null :: TT a -> Bool #

length :: TT a -> Int #

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

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

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

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

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

Show a => Show (TT a) Source # 
Instance details

Defined in UtilP

Methods

showsPrec :: Int -> TT a -> ShowS #

show :: TT a -> String #

showList :: [TT a] -> ShowS #

data BoolT a where Source #

contains the typed result from evaluating the expression tree to this point

Constructors

FailT 

Fields

FalseT 

Fields

TrueT 

Fields

PresentT 

Fields

  • :: a
     
  • -> BoolT a

    non predicate value

Instances
Foldable BoolT Source # 
Instance details

Defined in UtilP

Methods

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

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

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

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

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

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

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

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

toList :: BoolT a -> [a] #

null :: BoolT a -> Bool #

length :: BoolT a -> Int #

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

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

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

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

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

Eq a => Eq (BoolT a) Source # 
Instance details

Defined in UtilP

Methods

(==) :: BoolT a -> BoolT a -> Bool #

(/=) :: BoolT a -> BoolT a -> Bool #

Show a => Show (BoolT a) Source # 
Instance details

Defined in UtilP

Methods

showsPrec :: Int -> BoolT a -> ShowS #

show :: BoolT a -> String #

showList :: [BoolT a] -> ShowS #

Semigroup a => Semigroup (BoolT a) Source # 
Instance details

Defined in UtilP

Methods

(<>) :: BoolT a -> BoolT a -> BoolT a #

sconcat :: NonEmpty (BoolT a) -> BoolT a #

stimes :: Integral b => b -> BoolT a -> BoolT a #

Monoid a => Monoid (BoolT a) Source # 
Instance details

Defined in UtilP

Methods

mempty :: BoolT a #

mappend :: BoolT a -> BoolT a -> BoolT a #

mconcat :: [BoolT a] -> BoolT a #

tBool :: Lens (TT a) (TT b) (BoolT a) (BoolT b) Source #

boolT2P :: Lens' (BoolT a) BoolP Source #

a lens from typed BoolT to the untyped BoolP

data BoolP Source #

contains the untyped result from evaluating the expression tree to this point

Constructors

FailP String 
FalseP 
TrueP 
PresentP 
Instances
Eq BoolP Source # 
Instance details

Defined in UtilP

Methods

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

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

Show BoolP Source # 
Instance details

Defined in UtilP

Methods

showsPrec :: Int -> BoolP -> ShowS #

show :: BoolP -> String #

showList :: [BoolP] -> ShowS #

data PE Source #

Constructors

PE 

Fields

Instances
Show PE Source # 
Instance details

Defined in UtilP

Methods

showsPrec :: Int -> PE -> ShowS #

show :: PE -> String #

showList :: [PE] -> ShowS #

mkNode :: POpts -> BoolT a -> [String] -> [Holder] -> TT a Source #

creates a Node for the evaluation tree

mkNodeB :: POpts -> Bool -> [String] -> [Holder] -> TT Bool Source #

creates a Boolean node for a predicate type

partitionTTs :: [TT a] -> ([TT x], [TT a]) Source #

partition a tree into failures and non failures

getTTLR :: TT a -> Either (TT x) (TT a) Source #

partitionTTExtended :: (w, TT a) -> ([((w, TT x), String)], [(w, TT a)]) Source #

getValLR :: BoolT a -> Either String a Source #

get the value from BoolT or fail

fromTT :: TT a -> Tree PE Source #

converts a typed tree to an untyped on for display

data Holder Source #

a monomorphic container of trees

Constructors

Holder 

Fields

fromTTH :: Holder -> Tree PE Source #

converts a typed tree into an untyped one

hh :: TT w -> Holder Source #

convenience method to wrap a typed tree

getValueLR :: POpts -> String -> TT a -> [Holder] -> Either (TT x) a Source #

see getValueLRImpl : add more detail to the tree if there are errors

getValueLRHide :: POpts -> String -> TT a -> [Holder] -> Either (TT x) a Source #

see getValueLRImpl : add less detail to the tree if there are errors

getValueLRImpl :: Bool -> POpts -> String -> TT a -> [Holder] -> Either (TT x) a Source #

a helper method to add extra context on failure to the tree or extract the value at the root of the tree

newtype PColor Source #

the color palette for displaying the expression tree

Constructors

PColor 

Fields

data POpts Source #

customizable options

Constructors

POpts 

Fields

Instances
Show POpts Source # 
Instance details

Defined in UtilP

Methods

showsPrec :: Int -> POpts -> ShowS #

show :: POpts -> String #

showList :: [POpts] -> ShowS #

data Disp Source #

display format for the tree

Constructors

NormalDisp

draw horizontal tree

Unicode

use unicode

Instances
Eq Disp Source # 
Instance details

Defined in UtilP

Methods

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

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

Show Disp Source # 
Instance details

Defined in UtilP

Methods

showsPrec :: Int -> Disp -> ShowS #

show :: Disp -> String #

showList :: [Disp] -> ShowS #

ol :: POpts Source #

skip colors and just return the summary

olc :: POpts Source #

skip the detail and just return the summary but keep the colors

o0 :: POpts Source #

displays the detailed evaluation tree without colors.

o2 :: POpts Source #

displays the detailed evaluation tree using colors.

o2n :: POpts Source #

same as o2 but for narrower display width

o3 :: POpts Source #

same as o2 but for larger display width

ou :: POpts Source #

displays the detailed evaluation tree using unicode and colors. (o2 works better on Windows)

oun :: POpts Source #

same as ou but for narrower display width

setw :: Int -> POpts -> POpts Source #

helper method to limit the width of the tree

setd :: Int -> POpts -> POpts Source #

helper method to set the debug level

setu :: POpts -> POpts Source #

set display to unicode and colors

setc :: (String, PColor) -> POpts -> POpts Source #

set a color palette

color0 :: (String, PColor) Source #

no colors are displayed

color palettes

italics dont work but underline does

color1 :: (String, PColor) Source #

default color palette

color palettes

italics dont work but underline does

color2 :: (String, PColor) Source #

color palettes

italics dont work but underline does

color3 :: (String, PColor) Source #

color palettes

italics dont work but underline does

color4 :: (String, PColor) Source #

color palettes

italics dont work but underline does

fixBoolT :: TT Bool -> TT Bool Source #

fix PresentT Bool to TrueT or FalseT

show01 :: (Show a1, Show a2) => POpts -> String -> a1 -> a2 -> String Source #

lit01 :: Show a1 => POpts -> String -> a1 -> String -> String Source #

show01' :: (Show a1, Show a2) => POpts -> String -> a1 -> String -> a2 -> String Source #

lit01' :: Show a1 => POpts -> String -> a1 -> String -> String -> String Source #

showLit0 :: POpts -> String -> String -> String Source #

display all data regardless of debug level

showLit1 :: POpts -> String -> String -> String Source #

more restrictive: only display data at debug level 1 or less

show0 :: Show a => POpts -> String -> a -> String Source #

show3 :: Show a => POpts -> String -> a -> String Source #

show1 :: Show a => POpts -> String -> a -> String Source #

showAImpl :: Show a => POpts -> Int -> String -> a -> String Source #

data ROpt Source #

Regex options for Rescan Resplit Re etc

Constructors

Anchored

Force pattern anchoring

Auto_callout

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

Caseless

Do caseless matching

Dollar_endonly

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 | Newline_any -- ^ Recognize any Unicode newline sequence | Newline_anycrlf -- ^ Recognize CR, LF, and CrlF as newline sequences

Newline_cr

Set CR as the newline sequence

Newline_crlf

Set CrlF as the newline sequence

Newline_lf

Set LF as the newline sequence

No_auto_capture

Disable numbered capturing parentheses (named ones available)

Ungreedy

Invert greediness of quantifiers

Utf8

Run in UTF--8 mode

No_utf8_check

Do not check the pattern for UTF-8 validity

Instances
Bounded ROpt Source # 
Instance details

Defined in UtilP

Enum ROpt Source # 
Instance details

Defined in UtilP

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 Source # 
Instance details

Defined in UtilP

Methods

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

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

Ord ROpt Source # 
Instance details

Defined in UtilP

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 #

Show ROpt Source # 
Instance details

Defined in UtilP

Methods

showsPrec :: Int -> ROpt -> ShowS #

show :: ROpt -> String #

showList :: [ROpt] -> ShowS #

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

Defined in UtilP

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

Defined in UtilP

compileRegex :: forall rs a. GetROpts rs => POpts -> String -> String -> [Holder] -> Either (TT a) Regex Source #

compile a regex using the type level symbol

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

extract the regex options from the type level list

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

Defined in UtilP

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

Defined in UtilP

class GetROpt (o :: ROpt) where Source #

convert type level regex option to the value level

Instances
GetROpt Anchored Source # 
Instance details

Defined in UtilP

GetROpt Auto_callout Source # 
Instance details

Defined in UtilP

GetROpt Caseless Source # 
Instance details

Defined in UtilP

GetROpt Dollar_endonly Source # 
Instance details

Defined in UtilP

GetROpt Dotall Source # 
Instance details

Defined in UtilP

GetROpt Dupnames Source # 
Instance details

Defined in UtilP

GetROpt Extended Source # 
Instance details

Defined in UtilP

GetROpt Extra Source # 
Instance details

Defined in UtilP

GetROpt Firstline Source # 
Instance details

Defined in UtilP

GetROpt Multiline Source # 
Instance details

Defined in UtilP

GetROpt Newline_cr Source # 
Instance details

Defined in UtilP

GetROpt Newline_crlf Source # 
Instance details

Defined in UtilP

GetROpt Newline_lf Source # 
Instance details

Defined in UtilP

GetROpt No_auto_capture Source # 
Instance details

Defined in UtilP

GetROpt Ungreedy Source # 
Instance details

Defined in UtilP

GetROpt Utf8 Source # 
Instance details

Defined in UtilP

GetROpt No_utf8_check Source # 
Instance details

Defined in UtilP

data RR Source #

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 RR

Constructors

RR String 
RR1 (String -> [String] -> String) 
RR2 (String -> String) 
RR3 ([String] -> String) 
Instances
Show RR Source # 
Instance details

Defined in UtilP

Methods

showsPrec :: Int -> RR -> ShowS #

show :: RR -> String #

showList :: [RR] -> ShowS #

splitAndAlign :: Show x => POpts -> [String] -> [((Int, x), TT a)] -> Either (TT w) ([a], [((Int, x), TT a)]) Source #

extract values from the trees or if there are errors returned a tree with added context

formatList :: forall x z. Show x => POpts -> [((Int, x), z)] -> String Source #

valsFromTTs :: [TT a] -> [a] Source #

extract all root values from a list of trees

_boolT :: Prism' (BoolT Bool) Bool Source #

prism from BoolT to Bool

evalBinStrict :: POpts -> String -> (Bool -> Bool -> Bool) -> TT Bool -> TT Bool -> TT Bool Source #

applies a boolean binary operation against the values from two boolean trees

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

type level Between

Equations

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

type NotZeroT v = FailIfT (v == 0) (Text "found zero value") Source #

makes zero invalid at the type level

type family NullT (x :: Symbol) :: Bool where ... Source #

typelevel Null on Symbol

Equations

NullT ("" :: Symbol) = True 
NullT _ = False 

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

helper method to fail with an error if the True

Equations

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

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

typelevel And

Equations

AndT False _ = False 
AndT True b1 = b1 

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

typelevel Or

Equations

OrT True _ = True 
OrT False b1 = b1 

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

typelevel Not

Equations

NotT True = False 
NotT False = True 

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

get a Nat from the typelevel

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

gets the Symbol from the typelevel

class GetNats as where Source #

get a list of Nats from the typelevel

Methods

getNats :: [Int] Source #

Instances
GetNats ([] :: [k]) Source # 
Instance details

Defined in UtilP

Methods

getNats :: [Int] Source #

(KnownNat n, GetNats ns) => GetNats (n ': ns :: [Nat]) Source # 
Instance details

Defined in UtilP

Methods

getNats :: [Int] Source #

class GetSymbs ns where Source #

get a list of Symbols from the typelevel

Methods

getSymbs :: [String] Source #

Instances
GetSymbs ([] :: [k]) Source # 
Instance details

Defined in UtilP

Methods

getSymbs :: [String] Source #

(KnownSymbol s, GetSymbs ss) => GetSymbs (s ': ss :: [Symbol]) Source # 
Instance details

Defined in UtilP

Methods

getSymbs :: [String] Source #

getLen :: forall xs. GetLen xs => Int Source #

class GetLen (xs :: [k]) where Source #

gets length of a typelevel list

Methods

getLenP :: Proxy (xs :: [k]) -> Int Source #

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

Defined in UtilP

Methods

getLenP :: Proxy [] -> Int Source #

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

Defined in UtilP

Methods

getLenP :: Proxy (x ': xs) -> Int Source #

class GetThese (th :: These x y) where Source #

Methods

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

Instances
GetThese (That y2 :: These x y1) Source # 
Instance details

Defined in UtilP

Methods

getThese :: Proxy (That y2) -> (String, These w v -> Bool) Source #

GetThese (This x2 :: These x1 y) Source # 
Instance details

Defined in UtilP

Methods

getThese :: Proxy (This x2) -> (String, These w v -> Bool) Source #

GetThese (These x2 y2 :: These x1 y1) Source # 
Instance details

Defined in UtilP

Methods

getThese :: Proxy (These0 x2 y2) -> (String, These w v -> Bool) Source #

class GetOrdering (cmp :: Ordering) where Source #

get ordering from the typelevel

Instances
GetOrdering LT Source # 
Instance details

Defined in UtilP

GetOrdering EQ Source # 
Instance details

Defined in UtilP

GetOrdering GT Source # 
Instance details

Defined in UtilP

class GetBool (a :: Bool) where Source #

get bool from the typelevel

Methods

getBool :: Bool Source #

Instances
GetBool False Source # 
Instance details

Defined in UtilP

Methods

getBool :: Bool Source #

GetBool True Source # 
Instance details

Defined in UtilP

Methods

getBool :: Bool Source #

data N Source #

Constructors

S N 
Z 

type family ToN (n :: Nat) :: N where ... Source #

inductive numbers

Equations

ToN 0 = Z 
ToN n = S (ToN (n - 1)) 

type family FromN (n :: N) :: Nat where ... Source #

converts an inductive number to Nat

Equations

FromN Z = 0 
FromN (S n) = 1 + FromN n 

class GetNatN (n :: N) where Source #

extract N from the type level to Int

Methods

getNatN :: Int Source #

Instances
GetNatN Z Source # 
Instance details

Defined in UtilP

Methods

getNatN :: Int Source #

GetNatN n => GetNatN (S n) Source # 
Instance details

Defined in UtilP

Methods

getNatN :: Int Source #

getN :: Typeable t => Proxy (t :: N) -> Int Source #

data OrderingP Source #

Constructors

Cgt 
Cge 
Ceq 
Cle 
Clt 
Cne 
Instances
Bounded OrderingP Source # 
Instance details

Defined in UtilP

Enum OrderingP Source # 
Instance details

Defined in UtilP

Eq OrderingP Source # 
Instance details

Defined in UtilP

Show OrderingP Source # 
Instance details

Defined in UtilP

class GetOrd (k :: OrderingP) where Source #

Methods

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

Instances
GetOrd Cgt Source # 
Instance details

Defined in UtilP

Methods

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

GetOrd Cge Source # 
Instance details

Defined in UtilP

Methods

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

GetOrd Ceq Source # 
Instance details

Defined in UtilP

Methods

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

GetOrd Cle Source # 
Instance details

Defined in UtilP

Methods

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

GetOrd Clt Source # 
Instance details

Defined in UtilP

Methods

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

GetOrd Cne Source # 
Instance details

Defined in UtilP

Methods

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

colorMe :: POpts -> BoolP -> String -> String Source #

colors the result of the predicate based on the current color palette

prtTTIO :: POpts -> IO (TT a) -> IO () Source #

prtTT :: POpts -> Identity (TT a) -> IO () Source #

prtTT' :: MonadEval m => POpts -> m (TT a) -> IO () Source #

prtTree :: POpts -> Tree PE -> IO () Source #

fixLite :: forall a. Show a => POpts -> a -> Tree PE -> String Source #

fixit :: ((Int, x), TT a) -> TT a Source #

prefixMsg :: String -> TT a -> TT a Source #

showNat :: forall n. KnownNat n => String Source #

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

showTProxy :: forall p. Typeable (Proxy p) => String Source #

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

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 ... Source #

Equations

IntersperseT s '[] = "" 
IntersperseT s '[x] = x 
IntersperseT s (x ': (y ': xs)) = (x `AppendSymbol` s) `AppendSymbol` IntersperseT s (y ': xs) 

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

Equations

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

type NEmptyT k = ('[] :| '[] :: NonEmpty [k]) Source #

type family TupleListT (n :: N) a where ... Source #

Equations

TupleListT Z a = () 
TupleListT (S n) a = (a, TupleListT n a) 

class TupleListD (n :: N) a where Source #

Methods

tupleListD :: Bool -> [a] -> Either String (TupleListT n a) Source #

Instances
TupleListD Z a Source # 
Instance details

Defined in UtilP

Methods

tupleListD :: Bool -> [a] -> Either String (TupleListT Z a) Source #

TupleListD n a => TupleListD (S n) a Source # 
Instance details

Defined in UtilP

Methods

tupleListD :: Bool -> [a] -> Either String (TupleListT (S n) a) Source #

class ReverseTupleC x where Source #

Associated Types

type ReverseTupleP x Source #

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

Defined in UtilP

Associated Types

type ReverseTupleP () :: Type Source #

Methods

reverseTupleC :: () -> ReverseTupleP () Source #

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

Defined in UtilP

Associated Types

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

Methods

reverseTupleC :: (a, (b, (c, (d, (e, (f, (g, (h, (i, (j, (k, (l, ())))))))))))) -> ReverseTupleP (a, (b, (c, (d, (e, (f, (g, (h, (i, (j, (k, (l, ())))))))))))) Source #

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

Defined in UtilP

Associated Types

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

Methods

reverseTupleC :: (a, (b, (c, (d, (e, (f, (g, (h, (i, (j, (k, ()))))))))))) -> ReverseTupleP (a, (b, (c, (d, (e, (f, (g, (h, (i, (j, (k, ()))))))))))) Source #

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

Defined in UtilP

Associated Types

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

Methods

reverseTupleC :: (a, (b, (c, (d, (e, (f, (g, (h, (i, (j, ())))))))))) -> ReverseTupleP (a, (b, (c, (d, (e, (f, (g, (h, (i, (j, ())))))))))) Source #

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

Defined in UtilP

Associated Types

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

Methods

reverseTupleC :: (a, (b, (c, (d, (e, (f, (g, (h, (i, ()))))))))) -> ReverseTupleP (a, (b, (c, (d, (e, (f, (g, (h, (i, ()))))))))) Source #

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

Defined in UtilP

Associated Types

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

Methods

reverseTupleC :: (a, (b, (c, (d, (e, (f, (g, (h, ())))))))) -> ReverseTupleP (a, (b, (c, (d, (e, (f, (g, (h, ())))))))) Source #

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

Defined in UtilP

Associated Types

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

Methods

reverseTupleC :: (a, (b, (c, (d, (e, (f, (g, ()))))))) -> ReverseTupleP (a, (b, (c, (d, (e, (f, (g, ()))))))) Source #

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

Defined in UtilP

Associated Types

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

Methods

reverseTupleC :: (a, (b, (c, (d, (e, (f, ())))))) -> ReverseTupleP (a, (b, (c, (d, (e, (f, ())))))) Source #

ReverseTupleC (a, (b, (c, (d, (e, ()))))) Source # 
Instance details

Defined in UtilP

Associated Types

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

Methods

reverseTupleC :: (a, (b, (c, (d, (e, ()))))) -> ReverseTupleP (a, (b, (c, (d, (e, ()))))) Source #

ReverseTupleC (a, (b, (c, (d, ())))) Source # 
Instance details

Defined in UtilP

Associated Types

type ReverseTupleP (a, (b, (c, (d, ())))) :: Type Source #

Methods

reverseTupleC :: (a, (b, (c, (d, ())))) -> ReverseTupleP (a, (b, (c, (d, ())))) Source #

ReverseTupleC (a, (b, (c, ()))) Source # 
Instance details

Defined in UtilP

Associated Types

type ReverseTupleP (a, (b, (c, ()))) :: Type Source #

Methods

reverseTupleC :: (a, (b, (c, ()))) -> ReverseTupleP (a, (b, (c, ()))) Source #

ReverseTupleC (a, (b, ())) Source # 
Instance details

Defined in UtilP

Associated Types

type ReverseTupleP (a, (b, ())) :: Type Source #

Methods

reverseTupleC :: (a, (b, ())) -> ReverseTupleP (a, (b, ())) Source #

ReverseTupleC (a, ()) Source # 
Instance details

Defined in UtilP

Associated Types

type ReverseTupleP (a, ()) :: Type Source #

Methods

reverseTupleC :: (a, ()) -> ReverseTupleP (a, ()) Source #

type family ArrT (as :: Type) :: Type where ... Source #

Equations

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

type family TupleLenT (t :: Type) :: Nat where ... Source #

Equations

TupleLenT () = 0 
TupleLenT (_, ts) = 1 + TupleLenT ts 
TupleLenT t = TypeError (Text "TupleLenT: expected a valid inductive tuple" :$$: (Text "t = " :<>: ShowType t)) 

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

Equations

p %% q = p q 

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

Equations

p %& q = q p 

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

Equations

FlipT d p q = d q p 

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

Equations

IfT True t f = t 
IfT False t f = f 

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

Equations

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

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

Equations

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

type family ConsT s where ... Source #

Equations

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

class Monad m => MonadEval m where Source #

Methods

runIO :: IO a -> m (Maybe a) Source #

catchit :: Exception e => a -> m (Either String a) Source #

catchitNF :: (Exception e, NFData a) => a -> m (Either String a) Source #

liftEval :: m a -> IO a Source #

Instances
MonadEval IO Source # 
Instance details

Defined in UtilP

Methods

runIO :: IO a -> IO (Maybe a) Source #

catchit :: Exception e => a -> IO (Either String a) Source #

catchitNF :: (Exception e, NFData a) => a -> IO (Either String a) Source #

liftEval :: IO a -> IO a Source #

MonadEval Identity Source # 
Instance details

Defined in UtilP