Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- minimizeCyclesOrCrash :: Var v => Term v a -> Term v a
- pattern TVar :: Var v => v -> Term ANormalF v
- pattern TLit :: Var v => Lit -> Term ANormalF v
- pattern TBLit :: Var v => Lit -> Term ANormalF v
- pattern TApp :: Var v => Func v -> [v] -> Term ANormalF v
- pattern TApv :: Var v => v -> [v] -> Term ANormalF v
- pattern TCom :: Var v => Reference -> [v] -> Term ANormalF v
- pattern TCon :: Var v => Reference -> CTag -> [v] -> Term ANormalF v
- pattern UFalse :: Var v => Term ANormalF v
- pattern UTrue :: Var v => Term ANormalF v
- pattern TKon :: Var v => v -> [v] -> Term ANormalF v
- pattern TReq :: Var v => Reference -> CTag -> [v] -> Term ANormalF v
- pattern TPrm :: Var v => POp -> [v] -> Term ANormalF v
- pattern TFOp :: Var v => ForeignFunc -> [v] -> Term ANormalF v
- pattern THnd :: Var v => [Reference] -> v -> Term ANormalF v -> Term ANormalF v
- pattern TLet :: Var v => Direction Word16 -> v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
- pattern TLetD :: Var v => v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
- pattern TFrc :: Var v => v -> Term ANormalF v
- pattern TLets :: Var v => Direction Word16 -> [v] -> [Mem] -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
- pattern TName :: Var v => v -> Either Reference v -> [v] -> Term ANormalF v -> Term ANormalF v
- pattern TBind :: Var v => Cte v -> ANormal v -> ANormal v
- pattern TBinds :: Var v => [Cte v] -> ANormal v -> ANormal v
- pattern TShift :: Var v => Reference -> v -> Term ANormalF v -> Term ANormalF v
- pattern TMatch :: Var v => v -> Branched (Term ANormalF v) -> Term ANormalF v
- data CompileExn = CE CallStack (Pretty ColorText)
- internalBug :: HasCallStack => String -> a
- data Mem
- data Lit
- data Cacheability
- data Direction a
- data SuperNormal v = Lambda {
- conventions :: [Mem]
- bound :: ANormal v
- arity :: SuperNormal v -> Int
- data SuperGroup v = Rec {
- group :: [(v, SuperNormal v)]
- entry :: SuperNormal v
- arities :: SuperGroup v -> [Int]
- data POp
- = ADDI
- | SUBI
- | MULI
- | DIVI
- | SGNI
- | NEGI
- | MODI
- | POWI
- | SHLI
- | SHRI
- | ANDI
- | IORI
- | XORI
- | COMI
- | INCI
- | DECI
- | LEQI
- | LESI
- | EQLI
- | NEQI
- | TRNC
- | ADDN
- | SUBN
- | DRPN
- | MULN
- | DIVN
- | MODN
- | TZRO
- | LZRO
- | POPC
- | POWN
- | SHLN
- | SHRN
- | ANDN
- | IORN
- | XORN
- | COMN
- | INCN
- | DECN
- | LEQN
- | LESN
- | EQLN
- | NEQN
- | ADDF
- | SUBF
- | MULF
- | DIVF
- | MINF
- | MAXF
- | LEQF
- | LESF
- | EQLF
- | NEQF
- | POWF
- | EXPF
- | SQRT
- | LOGF
- | LOGB
- | ABSF
- | CEIL
- | FLOR
- | TRNF
- | RNDF
- | COSF
- | ACOS
- | COSH
- | ACSH
- | SINF
- | ASIN
- | SINH
- | ASNH
- | TANF
- | ATAN
- | TANH
- | ATNH
- | ATN2
- | CATT
- | TAKT
- | DRPT
- | SIZT
- | IXOT
- | UCNS
- | USNC
- | EQLT
- | LEQT
- | PAKT
- | UPKT
- | CATS
- | TAKS
- | DRPS
- | SIZS
- | CONS
- | SNOC
- | IDXS
- | BLDS
- | VWLS
- | VWRS
- | SPLL
- | SPLR
- | PAKB
- | UPKB
- | TAKB
- | DRPB
- | IXOB
- | IDXB
- | SIZB
- | FLTB
- | CATB
- | ITOF
- | NTOF
- | ITOT
- | NTOT
- | TTOI
- | TTON
- | TTOF
- | FTOT
- | CAST
- | FORK
- | EQLU
- | CMPU
- | LEQU
- | LESU
- | EROR
- | MISS
- | CACH
- | LKUP
- | LOAD
- | CVLD
- | SDBX
- | VALU
- | TLTT
- | PRNT
- | INFO
- | TRCE
- | DBTX
- | ATOM
- | TFRC
- | SDBL
- | SDBV
- | REFN
- | REFR
- | REFW
- | RCAS
- | RRFC
- | TIKR
- | NOTB
- | ANDB
- | IORB
- close :: (Var v, Monoid a) => Set v -> Term v a -> Term v a
- saturate :: (Var v, Monoid a) => Map ConstructorReference Int -> Term v a -> Term v a
- float :: Var v => Monoid a => Map v Reference -> Term v a -> (Term v a, Map Reference Reference, [(Reference, Term v a)], [(Reference, Term v a)])
- floatGroup :: Var v => Monoid a => Map v Reference -> [(v, Term v a)] -> ([(v, Id)], [(Reference, Term v a)], [(Reference, Term v a)])
- lamLift :: Var v => Monoid a => Map v Reference -> Term v a -> (Term v a, Map Reference Reference, [(Reference, Term v a)], [(Reference, Term v a)])
- lamLiftGroup :: Var v => Monoid a => Map v Reference -> [(v, Term v a)] -> ([(v, Id)], [(Reference, Term v a)], [(Reference, Term v a)])
- litRef :: Lit -> Reference
- inlineAlias :: Var v => Monoid a => Term v a -> Term v a
- addDefaultCases :: Var v => Monoid a => Text -> Term v a -> Term v a
- data ANormalF v e where
- ALet (Direction Word16) [Mem] e e
- AName (Either Reference v) [v] e
- ALit Lit
- ABLit Lit
- AMatch v (Branched e)
- AShift Reference e
- AHnd [Reference] v e
- AApp (Func v) [v]
- AFrc v
- AVar v
- pattern AApv :: v -> [v] -> ANormalF v e
- pattern ACom :: Reference -> [v] -> ANormalF v e
- pattern ACon :: Reference -> CTag -> [v] -> ANormalF v e
- pattern AKon :: v -> [v] -> ANormalF v e
- pattern AReq :: Reference -> CTag -> [v] -> ANormalF v e
- pattern APrm :: POp -> [v] -> ANormalF v e
- pattern AFOp :: ForeignFunc -> [v] -> ANormalF v e
- type ANormal = Term ANormalF
- data RTag
- data CTag
- newtype PackedTag = PackedTag Word64
- class Tag t where
- data GroupRef = GR Reference Word64
- data Code = CodeRep (SuperGroup Symbol) Cacheability
- type ValList = [Value]
- data Value
- data Cont
- data BLit
- packTags :: RTag -> CTag -> PackedTag
- unpackTags :: PackedTag -> (RTag, CTag)
- maskTags :: PackedTag -> Word64
- type ANFM v = ReaderT (Set v) (State (Word64, Word16, [(v, SuperNormal v)]))
- data Branched e where
- MatchIntegral (EnumMap Word64 e) (Maybe e)
- MatchText (Map Text e) (Maybe e)
- MatchRequest (Map Reference (EnumMap CTag ([Mem], e))) e
- MatchEmpty
- MatchData Reference (EnumMap CTag ([Mem], e)) (Maybe e)
- MatchSum (EnumMap Word64 ([Mem], e))
- MatchNumeric Reference (EnumMap Word64 e) (Maybe e)
- pattern MatchDataCover :: Reference -> EnumMap CTag ([Mem], e) -> Branched e
- data Func v
- data SGEqv v
- = NumDefns (SuperGroup v) (SuperGroup v)
- | DefnConventions (SuperNormal v) (SuperNormal v)
- | Subterms (ANormal v) (ANormal v)
- equivocate :: Var v => SuperGroup v -> SuperGroup v -> Either (SGEqv v) ()
- superNormalize :: Var v => Term v a -> SuperGroup v
- anfTerm :: Var v => Term v a -> ANFM v (DNormal v)
- codeGroup :: Code -> SuperGroup Symbol
- valueTermLinks :: Value -> [Reference]
- valueLinks :: Monoid a => (Bool -> Reference -> a) -> Value -> a
- groupTermLinks :: Var v => SuperGroup v -> [Reference]
- buildInlineMap :: Var v => Map Reference (SuperGroup v) -> Map Reference (Int, ANormal v)
- inline :: Var v => Map Reference (Int, ANormal v) -> SuperGroup v -> SuperGroup v
- foldGroup :: Monoid m => (SuperGroup Symbol -> m) -> Code -> m
- foldGroupLinks :: (Monoid r, Var v) => (Bool -> Reference -> r) -> SuperGroup v -> r
- overGroup :: (SuperGroup Symbol -> SuperGroup Symbol) -> Code -> Code
- overGroupLinks :: Var v => (Bool -> Reference -> Reference) -> SuperGroup v -> SuperGroup v
- traverseGroup :: Applicative f => (SuperGroup Symbol -> f (SuperGroup Symbol)) -> Code -> f Code
- traverseGroupLinks :: (Applicative f, Var v) => (Bool -> Reference -> f Reference) -> SuperGroup v -> f (SuperGroup v)
- normalLinks :: (Applicative f, Var v) => (Bool -> Reference -> f Reference) -> SuperNormal v -> f (SuperNormal v)
- prettyGroup :: Var v => String -> SuperGroup v -> ShowS
- prettySuperNormal :: Var v => Int -> SuperNormal v -> ShowS
- prettyANF :: Var v => Bool -> Int -> ANormal v -> ShowS
Documentation
pattern TLet :: Var v => Direction Word16 -> v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v Source #
pattern TLetD :: Var v => v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v Source #
pattern TLets :: Var v => Direction Word16 -> [v] -> [Mem] -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v Source #
pattern TName :: Var v => v -> Either Reference v -> [v] -> Term ANormalF v -> Term ANormalF v Source #
data CompileExn Source #
Instances
Exception CompileExn Source # | |
Defined in Unison.Runtime.ANF toException :: CompileExn -> SomeException # fromException :: SomeException -> Maybe CompileExn # displayException :: CompileExn -> String # | |
Show CompileExn Source # | |
Defined in Unison.Runtime.ANF showsPrec :: Int -> CompileExn -> ShowS # show :: CompileExn -> String # showList :: [CompileExn] -> ShowS # |
internalBug :: HasCallStack => String -> a Source #
data Cacheability Source #
Whether the evaluation of a given definition is cacheable or not. i.e. it's a top-level pure value.
Instances
Show Cacheability Source # | |
Defined in Unison.Runtime.ANF showsPrec :: Int -> Cacheability -> ShowS # show :: Cacheability -> String # showList :: [Cacheability] -> ShowS # | |
Eq Cacheability Source # | |
Defined in Unison.Runtime.ANF (==) :: Cacheability -> Cacheability -> Bool # (/=) :: Cacheability -> Cacheability -> Bool # |
Instances
Foldable Direction Source # | |
Defined in Unison.Runtime.ANF fold :: Monoid m => Direction m -> m # foldMap :: Monoid m => (a -> m) -> Direction a -> m # foldMap' :: Monoid m => (a -> m) -> Direction a -> m # foldr :: (a -> b -> b) -> b -> Direction a -> b # foldr' :: (a -> b -> b) -> b -> Direction a -> b # foldl :: (b -> a -> b) -> b -> Direction a -> b # foldl' :: (b -> a -> b) -> b -> Direction a -> b # foldr1 :: (a -> a -> a) -> Direction a -> a # foldl1 :: (a -> a -> a) -> Direction a -> a # toList :: Direction a -> [a] # length :: Direction a -> Int # elem :: Eq a => a -> Direction a -> Bool # maximum :: Ord a => Direction a -> a # minimum :: Ord a => Direction a -> a # | |
Traversable Direction Source # | |
Functor Direction Source # | |
Semigroup a => Monoid (Direction a) Source # | |
Semigroup a => Semigroup (Direction a) Source # | |
Show a => Show (Direction a) Source # | |
Eq a => Eq (Direction a) Source # | |
Ord a => Ord (Direction a) Source # | |
Defined in Unison.Runtime.ANF |
data SuperNormal v Source #
Lambda | |
|
Instances
Show v => Show (SuperNormal v) Source # | |
Defined in Unison.Runtime.ANF showsPrec :: Int -> SuperNormal v -> ShowS # show :: SuperNormal v -> String # showList :: [SuperNormal v] -> ShowS # | |
Var v => Eq (SuperNormal v) Source # | |
Defined in Unison.Runtime.ANF (==) :: SuperNormal v -> SuperNormal v -> Bool # (/=) :: SuperNormal v -> SuperNormal v -> Bool # |
arity :: SuperNormal v -> Int Source #
data SuperGroup v Source #
Rec | |
|
Instances
Show v => Show (SuperGroup v) Source # | |
Defined in Unison.Runtime.ANF showsPrec :: Int -> SuperGroup v -> ShowS # show :: SuperGroup v -> String # showList :: [SuperGroup v] -> ShowS # | |
Var v => Eq (SuperGroup v) Source # | |
Defined in Unison.Runtime.ANF (==) :: SuperGroup v -> SuperGroup v -> Bool # (/=) :: SuperGroup v -> SuperGroup v -> Bool # |
arities :: SuperGroup v -> [Int] Source #
float :: Var v => Monoid a => Map v Reference -> Term v a -> (Term v a, Map Reference Reference, [(Reference, Term v a)], [(Reference, Term v a)]) Source #
floatGroup :: Var v => Monoid a => Map v Reference -> [(v, Term v a)] -> ([(v, Id)], [(Reference, Term v a)], [(Reference, Term v a)]) Source #
lamLift :: Var v => Monoid a => Map v Reference -> Term v a -> (Term v a, Map Reference Reference, [(Reference, Term v a)], [(Reference, Term v a)]) Source #
lamLiftGroup :: Var v => Monoid a => Map v Reference -> [(v, Term v a)] -> ([(v, Id)], [(Reference, Term v a)], [(Reference, Term v a)]) Source #
ALet (Direction Word16) [Mem] e e | |
AName (Either Reference v) [v] e | |
ALit Lit | |
ABLit Lit | |
AMatch v (Branched e) | |
AShift Reference e | |
AHnd [Reference] v e | |
AApp (Func v) [v] | |
AFrc v | |
AVar v |
pattern AApv :: v -> [v] -> ANormalF v e | |
pattern ACom :: Reference -> [v] -> ANormalF v e | |
pattern ACon :: Reference -> CTag -> [v] -> ANormalF v e | |
pattern AKon :: v -> [v] -> ANormalF v e | |
pattern AReq :: Reference -> CTag -> [v] -> ANormalF v e | |
pattern APrm :: POp -> [v] -> ANormalF v e | |
pattern AFOp :: ForeignFunc -> [v] -> ANormalF v e |
Instances
Bifoldable ANormalF Source # | |
Bifunctor ANormalF Source # | |
Align ANormalF Source # | |
Defined in Unison.Runtime.ANF | |
Foldable (ANormalF v) Source # | |
Defined in Unison.Runtime.ANF fold :: Monoid m => ANormalF v m -> m # foldMap :: Monoid m => (a -> m) -> ANormalF v a -> m # foldMap' :: Monoid m => (a -> m) -> ANormalF v a -> m # foldr :: (a -> b -> b) -> b -> ANormalF v a -> b # foldr' :: (a -> b -> b) -> b -> ANormalF v a -> b # foldl :: (b -> a -> b) -> b -> ANormalF v a -> b # foldl' :: (b -> a -> b) -> b -> ANormalF v a -> b # foldr1 :: (a -> a -> a) -> ANormalF v a -> a # foldl1 :: (a -> a -> a) -> ANormalF v a -> a # toList :: ANormalF v a -> [a] # null :: ANormalF v a -> Bool # length :: ANormalF v a -> Int # elem :: Eq a => a -> ANormalF v a -> Bool # maximum :: Ord a => ANormalF v a -> a # minimum :: Ord a => ANormalF v a -> a # | |
Traversable (ANormalF v) Source # | |
Defined in Unison.Runtime.ANF | |
Functor (ANormalF v) Source # | |
(Show e, Show v) => Show (ANormalF v e) Source # | |
(Eq e, Eq v) => Eq (ANormalF v e) Source # | |
A combined tag, which is a packed representation of an RTag and a CTag
type ValList = [Value] Source #
A list of either unboxed or boxed values. Each slot is one of unboxed or boxed but not both.
MatchIntegral (EnumMap Word64 e) (Maybe e) | |
MatchText (Map Text e) (Maybe e) | |
MatchRequest (Map Reference (EnumMap CTag ([Mem], e))) e | |
MatchEmpty | |
MatchData Reference (EnumMap CTag ([Mem], e)) (Maybe e) | |
MatchSum (EnumMap Word64 ([Mem], e)) | |
MatchNumeric Reference (EnumMap Word64 e) (Maybe e) |
Instances
Foldable Branched Source # | |
Defined in Unison.Runtime.ANF fold :: Monoid m => Branched m -> m # foldMap :: Monoid m => (a -> m) -> Branched a -> m # foldMap' :: Monoid m => (a -> m) -> Branched a -> m # foldr :: (a -> b -> b) -> b -> Branched a -> b # foldr' :: (a -> b -> b) -> b -> Branched a -> b # foldl :: (b -> a -> b) -> b -> Branched a -> b # foldl' :: (b -> a -> b) -> b -> Branched a -> b # foldr1 :: (a -> a -> a) -> Branched a -> a # foldl1 :: (a -> a -> a) -> Branched a -> a # elem :: Eq a => a -> Branched a -> Bool # maximum :: Ord a => Branched a -> a # minimum :: Ord a => Branched a -> a # | |
Traversable Branched Source # | |
Functor Branched Source # | |
Show e => Show (Branched e) Source # | |
Eq e => Eq (Branched e) Source # | |
FVar v | |
FComb !Reference | |
FCont v | |
FCon !Reference !CTag | |
FReq !Reference !CTag | |
FPrim (Either POp ForeignFunc) |
Instances
Foldable Func Source # | |
Defined in Unison.Runtime.ANF fold :: Monoid m => Func m -> m # foldMap :: Monoid m => (a -> m) -> Func a -> m # foldMap' :: Monoid m => (a -> m) -> Func a -> m # foldr :: (a -> b -> b) -> b -> Func a -> b # foldr' :: (a -> b -> b) -> b -> Func a -> b # foldl :: (b -> a -> b) -> b -> Func a -> b # foldl' :: (b -> a -> b) -> b -> Func a -> b # foldr1 :: (a -> a -> a) -> Func a -> a # foldl1 :: (a -> a -> a) -> Func a -> a # elem :: Eq a => a -> Func a -> Bool # maximum :: Ord a => Func a -> a # | |
Traversable Func Source # | |
Functor Func Source # | |
Show v => Show (Func v) Source # | |
Eq v => Eq (Func v) Source # | |
NumDefns (SuperGroup v) (SuperGroup v) | |
DefnConventions (SuperNormal v) (SuperNormal v) | |
Subterms (ANormal v) (ANormal v) |
equivocate :: Var v => SuperGroup v -> SuperGroup v -> Either (SGEqv v) () Source #
superNormalize :: Var v => Term v a -> SuperGroup v Source #
valueTermLinks :: Value -> [Reference] Source #
groupTermLinks :: Var v => SuperGroup v -> [Reference] Source #
inline :: Var v => Map Reference (Int, ANormal v) -> SuperGroup v -> SuperGroup v Source #
foldGroupLinks :: (Monoid r, Var v) => (Bool -> Reference -> r) -> SuperGroup v -> r Source #
overGroup :: (SuperGroup Symbol -> SuperGroup Symbol) -> Code -> Code Source #
overGroupLinks :: Var v => (Bool -> Reference -> Reference) -> SuperGroup v -> SuperGroup v Source #
traverseGroup :: Applicative f => (SuperGroup Symbol -> f (SuperGroup Symbol)) -> Code -> f Code Source #
traverseGroupLinks :: (Applicative f, Var v) => (Bool -> Reference -> f Reference) -> SuperGroup v -> f (SuperGroup v) Source #
normalLinks :: (Applicative f, Var v) => (Bool -> Reference -> f Reference) -> SuperNormal v -> f (SuperNormal v) Source #
prettyGroup :: Var v => String -> SuperGroup v -> ShowS Source #
prettySuperNormal :: Var v => Int -> SuperNormal v -> ShowS Source #