unison-runtime-0.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Unison.Runtime.MCode

Synopsis

Documentation

data Args' Source #

Constructors

Arg1 !Int 
Arg2 !Int !Int 
ArgN !(PrimArray Int) 
ArgR !Int !Int 

Instances

Instances details
Show Args' Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

showsPrec :: Int -> Args' -> ShowS #

show :: Args' -> String #

showList :: [Args'] -> ShowS #

data Args Source #

Instances

Instances details
Show Args Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

showsPrec :: Int -> Args -> ShowS #

show :: Args -> String #

showList :: [Args] -> ShowS #

Eq Args Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

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

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

Ord Args Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

compare :: Args -> Args -> Ordering #

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

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

(>) :: Args -> Args -> Bool #

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

max :: Args -> Args -> Args #

min :: Args -> Args -> Args #

data RefNums Source #

Constructors

RN 

Fields

data MLit Source #

Constructors

MI !Int 
MD !Double 
MT !Text 
MM !Referent 
MY !Reference 

Instances

Instances details
Show MLit Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

showsPrec :: Int -> MLit -> ShowS #

show :: MLit -> String #

showList :: [MLit] -> ShowS #

Eq MLit Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

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

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

Ord MLit Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

compare :: MLit -> MLit -> Ordering #

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

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

(>) :: MLit -> MLit -> Bool #

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

max :: MLit -> MLit -> MLit #

min :: MLit -> MLit -> MLit #

data GInstr comb Source #

Instances

Instances details
Foldable GInstr Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

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

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

foldMap' :: Monoid m => (a -> m) -> GInstr a -> m #

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

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

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

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

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

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

toList :: GInstr a -> [a] #

null :: GInstr a -> Bool #

length :: GInstr a -> Int #

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

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

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

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

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

Traversable GInstr Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

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

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

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

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

Functor GInstr Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

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

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

Show comb => Show (GInstr comb) Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

showsPrec :: Int -> GInstr comb -> ShowS #

show :: GInstr comb -> String #

showList :: [GInstr comb] -> ShowS #

Eq comb => Eq (GInstr comb) Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

(==) :: GInstr comb -> GInstr comb -> Bool #

(/=) :: GInstr comb -> GInstr comb -> Bool #

Ord comb => Ord (GInstr comb) Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

compare :: GInstr comb -> GInstr comb -> Ordering #

(<) :: GInstr comb -> GInstr comb -> Bool #

(<=) :: GInstr comb -> GInstr comb -> Bool #

(>) :: GInstr comb -> GInstr comb -> Bool #

(>=) :: GInstr comb -> GInstr comb -> Bool #

max :: GInstr comb -> GInstr comb -> GInstr comb #

min :: GInstr comb -> GInstr comb -> GInstr comb #

data GSection comb Source #

Constructors

App !Bool !(GRef comb) !Args 
Call !Bool !comb !Args 
Jump !Int !Args 
Match !Int !(GBranch comb) 
Yield !Args 
Ins !(GInstr comb) !(GSection comb) 
Let !(GSection comb) !comb 
Die String 
Exit 
DMatch !(Maybe Reference) !Int !(GBranch comb) 
NMatch !(Maybe Reference) !Int !(GBranch comb) 
RMatch !Int !(GSection comb) !(EnumMap Word64 (GBranch comb)) 

Bundled Patterns

pattern MatchT :: Int -> GSection comb -> Map Text (GSection comb) -> GSection comb 
pattern MatchW :: Int -> GSection comb -> EnumMap Word64 (GSection comb) -> GSection comb 

Instances

Instances details
Foldable GSection Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

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

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

foldMap' :: Monoid m => (a -> m) -> GSection a -> m #

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

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

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

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

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

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

toList :: GSection a -> [a] #

null :: GSection a -> Bool #

length :: GSection a -> Int #

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

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

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

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

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

Traversable GSection Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

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

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

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

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

Functor GSection Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

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

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

Show comb => Show (GSection comb) Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

showsPrec :: Int -> GSection comb -> ShowS #

show :: GSection comb -> String #

showList :: [GSection comb] -> ShowS #

Eq comb => Eq (GSection comb) Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

(==) :: GSection comb -> GSection comb -> Bool #

(/=) :: GSection comb -> GSection comb -> Bool #

Ord comb => Ord (GSection comb) Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

compare :: GSection comb -> GSection comb -> Ordering #

(<) :: GSection comb -> GSection comb -> Bool #

(<=) :: GSection comb -> GSection comb -> Bool #

(>) :: GSection comb -> GSection comb -> Bool #

(>=) :: GSection comb -> GSection comb -> Bool #

max :: GSection comb -> GSection comb -> GSection comb #

min :: GSection comb -> GSection comb -> GSection comb #

data GComb comb Source #

Constructors

Lam !Int !Int !Int !Int !(GSection comb) 

Instances

Instances details
Foldable GComb Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

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

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

foldMap' :: Monoid m => (a -> m) -> GComb a -> m #

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

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

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

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

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

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

toList :: GComb a -> [a] #

null :: GComb a -> Bool #

length :: GComb a -> Int #

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

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

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

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

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

Traversable GComb Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

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

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

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

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

Functor GComb Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

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

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

Show comb => Show (GComb comb) Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

showsPrec :: Int -> GComb comb -> ShowS #

show :: GComb comb -> String #

showList :: [GComb comb] -> ShowS #

Eq comb => Eq (GComb comb) Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

(==) :: GComb comb -> GComb comb -> Bool #

(/=) :: GComb comb -> GComb comb -> Bool #

Ord comb => Ord (GComb comb) Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

compare :: GComb comb -> GComb comb -> Ordering #

(<) :: GComb comb -> GComb comb -> Bool #

(<=) :: GComb comb -> GComb comb -> Bool #

(>) :: GComb comb -> GComb comb -> Bool #

(>=) :: GComb comb -> GComb comb -> Bool #

max :: GComb comb -> GComb comb -> GComb comb #

min :: GComb comb -> GComb comb -> GComb comb #

data RComb Source #

The fixed point of a GComb where all references to a Comb are themselves Combs.

Constructors

RComb 

Fields

Instances

Instances details
Show RComb Source #

RCombs can be infinitely recursive so we show the CombIx instead.

Instance details

Defined in Unison.Runtime.MCode

Methods

showsPrec :: Int -> RComb -> ShowS #

show :: RComb -> String #

showList :: [RComb] -> ShowS #

Eq RComb Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

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

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

Ord RComb Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

compare :: RComb -> RComb -> Ordering #

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

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

(>) :: RComb -> RComb -> Bool #

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

max :: RComb -> RComb -> RComb #

min :: RComb -> RComb -> RComb #

ForeignConvention (Ticket RClosure) Source # 
Instance details

Defined in Unison.Runtime.Foreign.Function

ForeignConvention (TVar RClosure) Source # 
Instance details

Defined in Unison.Runtime.Foreign.Function

Methods

readForeign :: [Int] -> [Int] -> Stack 'UN -> Stack 'BX -> IO ([Int], [Int], TVar RClosure) Source #

writeForeign :: Stack 'UN -> Stack 'BX -> TVar RClosure -> IO (Stack 'UN, Stack 'BX) Source #

ForeignConvention (IORef RClosure) Source # 
Instance details

Defined in Unison.Runtime.Foreign.Function

Methods

readForeign :: [Int] -> [Int] -> Stack 'UN -> Stack 'BX -> IO ([Int], [Int], IORef RClosure) Source #

writeForeign :: Stack 'UN -> Stack 'BX -> IORef RClosure -> IO (Stack 'UN, Stack 'BX) Source #

ForeignConvention (MVar RClosure) Source # 
Instance details

Defined in Unison.Runtime.Foreign.Function

Methods

readForeign :: [Int] -> [Int] -> Stack 'UN -> Stack 'BX -> IO ([Int], [Int], MVar RClosure) Source #

writeForeign :: Stack 'UN -> Stack 'BX -> MVar RClosure -> IO (Stack 'UN, Stack 'BX) Source #

ForeignConvention (Array RClosure) Source # 
Instance details

Defined in Unison.Runtime.Foreign.Function

Methods

readForeign :: [Int] -> [Int] -> Stack 'UN -> Stack 'BX -> IO ([Int], [Int], Array RClosure) Source #

writeForeign :: Stack 'UN -> Stack 'BX -> Array RClosure -> IO (Stack 'UN, Stack 'BX) Source #

ForeignConvention (Promise RClosure) Source # 
Instance details

Defined in Unison.Runtime.Foreign.Function

ForeignConvention (MutableArray s RClosure) Source # 
Instance details

Defined in Unison.Runtime.Foreign.Function

pattern RCombIx :: CombIx -> RComb Source #

Extract the CombIx from an RComb.

pattern RCombRef :: Reference -> RComb Source #

Extract the Reference from an RComb.

rCombToComb :: RComb -> Comb Source #

Convert an RComb to a Comb by forgetting the sections and keeping only the CombIx.

type GCombs comb = EnumMap Word64 (GComb comb) Source #

Map of combinators, parameterized by comb reference type

data CombIx Source #

Constructors

CIx !Reference !Word64 !Word64 

Instances

Instances details
Show CombIx Source # 
Instance details

Defined in Unison.Runtime.MCode

Eq CombIx Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

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

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

Ord CombIx Source # 
Instance details

Defined in Unison.Runtime.MCode

data GRef comb Source #

Constructors

Stk !Int 
Env !comb 
Dyn !Word64 

Instances

Instances details
Foldable GRef Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

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

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

foldMap' :: Monoid m => (a -> m) -> GRef a -> m #

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

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

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

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

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

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

toList :: GRef a -> [a] #

null :: GRef a -> Bool #

length :: GRef a -> Int #

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

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

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

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

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

Traversable GRef Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

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

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

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

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

Functor GRef Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

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

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

Show comb => Show (GRef comb) Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

showsPrec :: Int -> GRef comb -> ShowS #

show :: GRef comb -> String #

showList :: [GRef comb] -> ShowS #

Eq comb => Eq (GRef comb) Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

(==) :: GRef comb -> GRef comb -> Bool #

(/=) :: GRef comb -> GRef comb -> Bool #

Ord comb => Ord (GRef comb) Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

compare :: GRef comb -> GRef comb -> Ordering #

(<) :: GRef comb -> GRef comb -> Bool #

(<=) :: GRef comb -> GRef comb -> Bool #

(>) :: GRef comb -> GRef comb -> Bool #

(>=) :: GRef comb -> GRef comb -> Bool #

max :: GRef comb -> GRef comb -> GRef comb #

min :: GRef comb -> GRef comb -> GRef comb #

type Ref = GRef CombIx Source #

A reference to a combinator, parameterized by comb

data UPrim1 Source #

Instances

Instances details
Show UPrim1 Source # 
Instance details

Defined in Unison.Runtime.MCode

Eq UPrim1 Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

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

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

Ord UPrim1 Source # 
Instance details

Defined in Unison.Runtime.MCode

Tag UPrim1 Source # 
Instance details

Defined in Unison.Runtime.Serialize

data UPrim2 Source #

Instances

Instances details
Show UPrim2 Source # 
Instance details

Defined in Unison.Runtime.MCode

Eq UPrim2 Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

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

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

Ord UPrim2 Source # 
Instance details

Defined in Unison.Runtime.MCode

Tag UPrim2 Source # 
Instance details

Defined in Unison.Runtime.Serialize

data BPrim1 Source #

Instances

Instances details
Show BPrim1 Source # 
Instance details

Defined in Unison.Runtime.MCode

Eq BPrim1 Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

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

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

Ord BPrim1 Source # 
Instance details

Defined in Unison.Runtime.MCode

Tag BPrim1 Source # 
Instance details

Defined in Unison.Runtime.Serialize

data BPrim2 Source #

Instances

Instances details
Show BPrim2 Source # 
Instance details

Defined in Unison.Runtime.MCode

Eq BPrim2 Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

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

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

Ord BPrim2 Source # 
Instance details

Defined in Unison.Runtime.MCode

Tag BPrim2 Source # 
Instance details

Defined in Unison.Runtime.Serialize

data GBranch comb Source #

Constructors

Test1 !Word64 !(GSection comb) !(GSection comb) 
Test2 !Word64 !(GSection comb) !Word64 !(GSection comb) !(GSection comb) 
TestW !(GSection comb) !(EnumMap Word64 (GSection comb)) 
TestT !(GSection comb) !(Map Text (GSection comb)) 

Instances

Instances details
Foldable GBranch Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

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

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

foldMap' :: Monoid m => (a -> m) -> GBranch a -> m #

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

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

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

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

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

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

toList :: GBranch a -> [a] #

null :: GBranch a -> Bool #

length :: GBranch a -> Int #

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

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

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

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

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

Traversable GBranch Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

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

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

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

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

Functor GBranch Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

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

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

Show comb => Show (GBranch comb) Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

showsPrec :: Int -> GBranch comb -> ShowS #

show :: GBranch comb -> String #

showList :: [GBranch comb] -> ShowS #

Eq comb => Eq (GBranch comb) Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

(==) :: GBranch comb -> GBranch comb -> Bool #

(/=) :: GBranch comb -> GBranch comb -> Bool #

Ord comb => Ord (GBranch comb) Source # 
Instance details

Defined in Unison.Runtime.MCode

Methods

compare :: GBranch comb -> GBranch comb -> Ordering #

(<) :: GBranch comb -> GBranch comb -> Bool #

(<=) :: GBranch comb -> GBranch comb -> Bool #

(>) :: GBranch comb -> GBranch comb -> Bool #

(>=) :: GBranch comb -> GBranch comb -> Bool #

max :: GBranch comb -> GBranch comb -> GBranch comb #

min :: GBranch comb -> GBranch comb -> GBranch comb #

resolveCombs :: Maybe (EnumMap Word64 RCombs) -> EnumMap Word64 Combs -> EnumMap Word64 RCombs Source #

lazily replace all references to combinators with the combinators themselves, tying the knot recursively when necessary.