{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE ViewPatterns #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
module Unison.Runtime.Builtin
( builtinTermNumbering,
builtinTypeNumbering,
builtinTermBackref,
builtinTypeBackref,
builtinArities,
builtinInlineInfo,
numberedTermLookup,
Sandbox (..),
baseSandboxInfo,
unitValue,
natValue,
builtinForeignNames,
sandboxedForeignFuncs,
)
where
import Control.Monad.State.Strict (State, execState, modify)
import Data.Map qualified as Map
import Data.Set (insert)
import Data.Set qualified as Set
import Data.Text qualified
import Unison.ABT.Normalized hiding (TTm)
import Unison.Builtin.Decls qualified as Ty
import Unison.Prelude hiding (Text, some)
import Unison.Reference
import Unison.Runtime.ANF as ANF
import Unison.Runtime.Builtin.Types
import Unison.Runtime.Foreign.Function.Type (ForeignFunc (..), foreignFuncBuiltinName)
import Unison.Runtime.Stack (UnboxedTypeTag (..), Val (..), unboxedTypeTagToInt)
import Unison.Runtime.Stack qualified as Closure
import Unison.Symbol
import Unison.Type qualified as Ty
import Unison.Util.EnumContainers as EC
import Unison.Util.Text qualified as Util.Text
import Unison.Var
freshes :: (Var v) => Int -> [v]
freshes :: forall v. Var v => Int -> [v]
freshes = Set v -> Int -> [v]
forall v. Var v => Set v -> Int -> [v]
freshes' Set v
forall a. Monoid a => a
mempty
freshes' :: (Var v) => Set v -> Int -> [v]
freshes' :: forall v. Var v => Set v -> Int -> [v]
freshes' Set v
avoid0 = Set v -> [v] -> Int -> [v]
forall {t} {a}. (Num t, Var a, Eq t) => Set a -> [a] -> t -> [a]
go Set v
avoid0 []
where
go :: Set a -> [a] -> t -> [a]
go Set a
_ [a]
vs t
0 = [a]
vs
go Set a
avoid [a]
vs t
n =
let v :: a
v = Set a -> a -> a
forall v. Var v => Set v -> v -> v
freshIn Set a
avoid (a -> a) -> a -> a
forall a b. (a -> b) -> a -> b
$ Type -> a
forall v. Var v => Type -> v
typed Type
ANFBlank
in Set a -> [a] -> t -> [a]
go (a -> Set a -> Set a
forall a. Ord a => a -> Set a -> Set a
insert a
v Set a
avoid) (a
v a -> [a] -> [a]
forall a. a -> [a] -> [a]
: [a]
vs) (t
n t -> t -> t
forall a. Num a => a -> a -> a
- t
1)
class Fresh t where fresh :: t
fresh1 :: (Var v) => v
fresh1 :: forall v. Var v => v
fresh1 = [v] -> v
forall a. HasCallStack => [a] -> a
head ([v] -> v) -> [v] -> v
forall a b. (a -> b) -> a -> b
$ Int -> [v]
forall v. Var v => Int -> [v]
freshes Int
1
instance (Var v) => Fresh (v, v) where
fresh :: (v, v)
fresh = (v
v1, v
v2)
where
[v
v1, v
v2] = Int -> [v]
forall v. Var v => Int -> [v]
freshes Int
2
instance (Var v) => Fresh (v, v, v) where
fresh :: (v, v, v)
fresh = (v
v1, v
v2, v
v3)
where
[v
v1, v
v2, v
v3] = Int -> [v]
forall v. Var v => Int -> [v]
freshes Int
3
instance (Var v) => Fresh (v, v, v, v) where
fresh :: (v, v, v, v)
fresh = (v
v1, v
v2, v
v3, v
v4)
where
[v
v1, v
v2, v
v3, v
v4] = Int -> [v]
forall v. Var v => Int -> [v]
freshes Int
4
instance (Var v) => Fresh (v, v, v, v, v) where
fresh :: (v, v, v, v, v)
fresh = (v
v1, v
v2, v
v3, v
v4, v
v5)
where
[v
v1, v
v2, v
v3, v
v4, v
v5] = Int -> [v]
forall v. Var v => Int -> [v]
freshes Int
5
instance (Var v) => Fresh (v, v, v, v, v, v) where
fresh :: (v, v, v, v, v, v)
fresh = (v
v1, v
v2, v
v3, v
v4, v
v5, v
v6)
where
[v
v1, v
v2, v
v3, v
v4, v
v5, v
v6] = Int -> [v]
forall v. Var v => Int -> [v]
freshes Int
6
instance (Var v) => Fresh (v, v, v, v, v, v, v) where
fresh :: (v, v, v, v, v, v, v)
fresh = (v
v1, v
v2, v
v3, v
v4, v
v5, v
v6, v
v7)
where
[v
v1, v
v2, v
v3, v
v4, v
v5, v
v6, v
v7] = Int -> [v]
forall v. Var v => Int -> [v]
freshes Int
7
instance (Var v) => Fresh (v, v, v, v, v, v, v, v) where
fresh :: (v, v, v, v, v, v, v, v)
fresh = (v
v1, v
v2, v
v3, v
v4, v
v5, v
v6, v
v7, v
v8)
where
[v
v1, v
v2, v
v3, v
v4, v
v5, v
v6, v
v7, v
v8] = Int -> [v]
forall v. Var v => Int -> [v]
freshes Int
8
instance (Var v) => Fresh (v, v, v, v, v, v, v, v, v) where
fresh :: (v, v, v, v, v, v, v, v, v)
fresh = (v
v1, v
v2, v
v3, v
v4, v
v5, v
v6, v
v7, v
v8, v
v9)
where
[v
v1, v
v2, v
v3, v
v4, v
v5, v
v6, v
v7, v
v8, v
v9] = Int -> [v]
forall v. Var v => Int -> [v]
freshes Int
9
instance (Var v) => Fresh (v, v, v, v, v, v, v, v, v, v) where
fresh :: (v, v, v, v, v, v, v, v, v, v)
fresh = (v
v1, v
v2, v
v3, v
v4, v
v5, v
v6, v
v7, v
v8, v
v9, v
v10)
where
[v
v1, v
v2, v
v3, v
v4, v
v5, v
v6, v
v7, v
v8, v
v9, v
v10] = Int -> [v]
forall v. Var v => Int -> [v]
freshes Int
10
instance (Var v) => Fresh (v, v, v, v, v, v, v, v, v, v, v) where
fresh :: (v, v, v, v, v, v, v, v, v, v, v)
fresh = (v
v1, v
v2, v
v3, v
v4, v
v5, v
v6, v
v7, v
v8, v
v9, v
v10, v
v11)
where
[v
v1, v
v2, v
v3, v
v4, v
v5, v
v6, v
v7, v
v8, v
v9, v
v10, v
v11] = Int -> [v]
forall v. Var v => Int -> [v]
freshes Int
11
instance (Var v) => Fresh (v, v, v, v, v, v, v, v, v, v, v, v, v) where
fresh :: (v, v, v, v, v, v, v, v, v, v, v, v, v)
fresh = (v
v1, v
v2, v
v3, v
v4, v
v5, v
v6, v
v7, v
v8, v
v9, v
v10, v
v11, v
v12, v
v13)
where
[v
v1, v
v2, v
v3, v
v4, v
v5, v
v6, v
v7, v
v8, v
v9, v
v10, v
v11, v
v12, v
v13] = Int -> [v]
forall v. Var v => Int -> [v]
freshes Int
13
instance (Var v) => Fresh (v, v, v, v, v, v, v, v, v, v, v, v, v, v) where
fresh :: (v, v, v, v, v, v, v, v, v, v, v, v, v, v)
fresh = (v
v1, v
v2, v
v3, v
v4, v
v5, v
v6, v
v7, v
v8, v
v9, v
v10, v
v11, v
v12, v
v13, v
v14)
where
[v
v1, v
v2, v
v3, v
v4, v
v5, v
v6, v
v7, v
v8, v
v9, v
v10, v
v11, v
v12, v
v13, v
v14] = Int -> [v]
forall v. Var v => Int -> [v]
freshes Int
14
fls, tru :: (Var v) => ANormal v
fls :: forall v. Var v => ANormal v
fls = Reference -> CTag -> [v] -> Term ANormalF v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.booleanRef CTag
0 []
tru :: forall v. Var v => ANormal v
tru = Reference -> CTag -> [v] -> Term ANormalF v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.booleanRef CTag
1 []
none :: (Var v) => ANormal v
none :: forall v. Var v => ANormal v
none = Reference -> CTag -> [v] -> Term ANormalF v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.optionalRef (Word64 -> CTag
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word64
Ty.noneId) []
some, left, right :: (Var v) => v -> ANormal v
some :: forall v. Var v => v -> ANormal v
some v
a = Reference -> CTag -> [v] -> Term ANormalF v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.optionalRef (Word64 -> CTag
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word64
Ty.someId) [v
a]
left :: forall v. Var v => v -> ANormal v
left v
x = Reference -> CTag -> [v] -> Term ANormalF v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.eitherRef (Word64 -> CTag
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word64
Ty.eitherLeftId) [v
x]
right :: forall v. Var v => v -> ANormal v
right v
x = Reference -> CTag -> [v] -> Term ANormalF v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.eitherRef (Word64 -> CTag
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word64
Ty.eitherRightId) [v
x]
seqViewEmpty :: (Var v) => ANormal v
seqViewEmpty :: forall v. Var v => ANormal v
seqViewEmpty = Reference -> CTag -> [v] -> Term ANormalF v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.seqViewRef (Word64 -> CTag
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word64
Ty.seqViewEmpty) []
seqViewElem :: (Var v) => v -> v -> ANormal v
seqViewElem :: forall v. Var v => v -> v -> ANormal v
seqViewElem v
l v
r = Reference -> CTag -> [v] -> Term ANormalF v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.seqViewRef (Word64 -> CTag
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word64
Ty.seqViewElem) [v
l, v
r]
unenum :: (Var v) => Int -> v -> Reference -> v -> ANormal v -> ANormal v
unenum :: forall v.
Var v =>
Int -> v -> Reference -> v -> ANormal v -> ANormal v
unenum Int
n v
v0 Reference
r v
v ANormal v
nx =
v -> Branched (ANormal v) -> ANormal v
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch v
v0 (Branched (ANormal v) -> ANormal v)
-> Branched (ANormal v) -> ANormal v
forall a b. (a -> b) -> a -> b
$ Reference
-> EnumMap CTag ([Mem], ANormal v)
-> Maybe (ANormal v)
-> Branched (ANormal v)
forall e.
Reference -> EnumMap CTag ([Mem], e) -> Maybe e -> Branched e
MatchData Reference
r EnumMap CTag ([Mem], ANormal v)
cases Maybe (ANormal v)
forall a. Maybe a
Nothing
where
mkCase :: Int -> (CTag, ([Mem], ANormal v))
mkCase Int
i = (Int -> CTag
forall a. Enum a => Int -> a
toEnum Int
i, ([], v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
v Mem
UN (Lit -> ANormal v
forall v. Var v => Lit -> Term ANormalF v
TLit (Lit -> ANormal v) -> (Int64 -> Lit) -> Int64 -> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int64 -> Lit
I (Int64 -> ANormal v) -> Int64 -> ANormal v
forall a b. (a -> b) -> a -> b
$ Int -> Int64
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
i) ANormal v
nx))
cases :: EnumMap CTag ([Mem], ANormal v)
cases = [(CTag, ([Mem], ANormal v))] -> EnumMap CTag ([Mem], ANormal v)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList ([(CTag, ([Mem], ANormal v))] -> EnumMap CTag ([Mem], ANormal v))
-> ([Int] -> [(CTag, ([Mem], ANormal v))])
-> [Int]
-> EnumMap CTag ([Mem], ANormal v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int -> (CTag, ([Mem], ANormal v)))
-> [Int] -> [(CTag, ([Mem], ANormal v))]
forall a b. (a -> b) -> [a] -> [b]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Int -> (CTag, ([Mem], ANormal v))
mkCase ([Int] -> EnumMap CTag ([Mem], ANormal v))
-> [Int] -> EnumMap CTag ([Mem], ANormal v)
forall a b. (a -> b) -> a -> b
$ [Int
0 .. Int
n Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
1]
unop0 :: (Var v) => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 :: forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
n [v] -> ANormal v
f =
[Mem] -> ANormal v -> SuperNormal v
forall v. [Mem] -> ANormal v -> SuperNormal v
Lambda [Mem
BX]
(ANormal v -> SuperNormal v)
-> (ANormal v -> ANormal v) -> ANormal v -> SuperNormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [v] -> ANormal v -> ANormal v
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [v
x0]
(ANormal v -> SuperNormal v) -> ANormal v -> SuperNormal v
forall a b. (a -> b) -> a -> b
$ [v] -> ANormal v
f [v]
xs
where
xs :: [v]
xs@(v
x0 : [v]
_) = Int -> [v]
forall v. Var v => Int -> [v]
freshes (Int
1 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
n)
binop0 :: (Var v) => Int -> ([v] -> ANormal v) -> SuperNormal v
binop0 :: forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
binop0 Int
n [v] -> ANormal v
f =
[Mem] -> ANormal v -> SuperNormal v
forall v. [Mem] -> ANormal v -> SuperNormal v
Lambda [Mem
BX, Mem
BX]
(ANormal v -> SuperNormal v)
-> (ANormal v -> ANormal v) -> ANormal v -> SuperNormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [v] -> ANormal v -> ANormal v
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [v
x0, v
y0]
(ANormal v -> SuperNormal v) -> ANormal v -> SuperNormal v
forall a b. (a -> b) -> a -> b
$ [v] -> ANormal v
f [v]
xs
where
xs :: [v]
xs@(v
x0 : v
y0 : [v]
_) = Int -> [v]
forall v. Var v => Int -> [v]
freshes (Int
2 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
n)
unop :: (Var v) => POp -> SuperNormal v
unop :: forall v. Var v => POp -> SuperNormal v
unop POp
pop =
Int -> ([v] -> ANormal v) -> SuperNormal v
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
0 (([v] -> ANormal v) -> SuperNormal v)
-> ([v] -> ANormal v) -> SuperNormal v
forall a b. (a -> b) -> a -> b
$ \[v
x] ->
(POp -> [v] -> ANormal v
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
pop [v
x])
binop ::
(Var v) =>
POp ->
SuperNormal v
binop :: forall v. Var v => POp -> SuperNormal v
binop POp
pop =
Int -> ([v] -> ANormal v) -> SuperNormal v
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
binop0 Int
0 (([v] -> ANormal v) -> SuperNormal v)
-> ([v] -> ANormal v) -> SuperNormal v
forall a b. (a -> b) -> a -> b
$ \[v
x, v
y] -> POp -> [v] -> ANormal v
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
pop [v
x, v
y]
binopSwap :: (Var v) => POp -> SuperNormal v
binopSwap :: forall v. Var v => POp -> SuperNormal v
binopSwap POp
pop =
Int -> ([v] -> ANormal v) -> SuperNormal v
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
binop0 Int
0 (([v] -> ANormal v) -> SuperNormal v)
-> ([v] -> ANormal v) -> SuperNormal v
forall a b. (a -> b) -> a -> b
$ \[v
x, v
y] -> POp -> [v] -> ANormal v
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
pop [v
y, v
x]
addi, subi, muli, divi, modi, shli, shri, powi :: (Var v) => SuperNormal v
addi :: forall v. Var v => SuperNormal v
addi = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
ADDI
subi :: forall v. Var v => SuperNormal v
subi = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
SUBI
muli :: forall v. Var v => SuperNormal v
muli = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
MULI
divi :: forall v. Var v => SuperNormal v
divi = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
DIVI
modi :: forall v. Var v => SuperNormal v
modi = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
MODI
shli :: forall v. Var v => SuperNormal v
shli = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
SHLI
shri :: forall v. Var v => SuperNormal v
shri = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
SHRI
powi :: forall v. Var v => SuperNormal v
powi = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
POWI
addn, subn, muln, divn, modn, shln, shrn, pown, dropn :: (Var v) => SuperNormal v
addn :: forall v. Var v => SuperNormal v
addn = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
ADDN
subn :: forall v. Var v => SuperNormal v
subn = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
SUBN
muln :: forall v. Var v => SuperNormal v
muln = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
MULN
divn :: forall v. Var v => SuperNormal v
divn = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
DIVN
modn :: forall v. Var v => SuperNormal v
modn = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
MODN
shln :: forall v. Var v => SuperNormal v
shln = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
SHLN
shrn :: forall v. Var v => SuperNormal v
shrn = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
SHRN
pown :: forall v. Var v => SuperNormal v
pown = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
POWN
dropn :: forall v. Var v => SuperNormal v
dropn = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
DRPN
eqi, eqn, lti, ltn, lei, len :: (Var v) => SuperNormal v
eqi :: forall v. Var v => SuperNormal v
eqi = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
EQLI
lti :: forall v. Var v => SuperNormal v
lti = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
LESI
lei :: forall v. Var v => SuperNormal v
lei = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
LEQI
eqn :: forall v. Var v => SuperNormal v
eqn = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
EQLN
ltn :: forall v. Var v => SuperNormal v
ltn = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
LESN
len :: forall v. Var v => SuperNormal v
len = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
LEQN
gti, gtn, gei, gen :: (Var v) => SuperNormal v
gti :: forall v. Var v => SuperNormal v
gti = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binopSwap POp
LESI
gei :: forall v. Var v => SuperNormal v
gei = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binopSwap POp
LEQI
gtn :: forall v. Var v => SuperNormal v
gtn = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binopSwap POp
LESN
gen :: forall v. Var v => SuperNormal v
gen = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binopSwap POp
LEQN
inci, incn :: (Var v) => SuperNormal v
inci :: forall v. Var v => SuperNormal v
inci = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
INCI
incn :: forall v. Var v => SuperNormal v
incn = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
INCN
sgni, negi :: (Var v) => SuperNormal v
sgni :: forall v. Var v => SuperNormal v
sgni = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
SGNI
negi :: forall v. Var v => SuperNormal v
negi = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
NEGI
lzeron, tzeron, lzeroi, tzeroi, popn, popi :: (Var v) => SuperNormal v
lzeron :: forall v. Var v => SuperNormal v
lzeron = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
LZRO
tzeron :: forall v. Var v => SuperNormal v
tzeron = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
TZRO
popn :: forall v. Var v => SuperNormal v
popn = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
POPC
popi :: forall v. Var v => SuperNormal v
popi = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
POPC
lzeroi :: forall v. Var v => SuperNormal v
lzeroi = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
LZRO
tzeroi :: forall v. Var v => SuperNormal v
tzeroi = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
TZRO
andn, orn, xorn, compln, andi, ori, xori, compli :: (Var v) => SuperNormal v
andn :: forall v. Var v => SuperNormal v
andn = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
ANDN
orn :: forall v. Var v => SuperNormal v
orn = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
IORN
xorn :: forall v. Var v => SuperNormal v
xorn = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
XORN
compln :: forall v. Var v => SuperNormal v
compln = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
COMN
andi :: forall v. Var v => SuperNormal v
andi = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
ANDI
ori :: forall v. Var v => SuperNormal v
ori = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
IORI
xori :: forall v. Var v => SuperNormal v
xori = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
XORI
compli :: forall v. Var v => SuperNormal v
compli = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
COMI
addf,
subf,
mulf,
divf,
powf,
sqrtf,
logf,
logbf ::
(Var v) => SuperNormal v
addf :: forall v. Var v => SuperNormal v
addf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
ADDF
subf :: forall v. Var v => SuperNormal v
subf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
SUBF
mulf :: forall v. Var v => SuperNormal v
mulf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
MULF
divf :: forall v. Var v => SuperNormal v
divf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
DIVF
powf :: forall v. Var v => SuperNormal v
powf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
POWF
sqrtf :: forall v. Var v => SuperNormal v
sqrtf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
SQRT
logf :: forall v. Var v => SuperNormal v
logf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
LOGF
logbf :: forall v. Var v => SuperNormal v
logbf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
LOGB
expf, absf :: (Var v) => SuperNormal v
expf :: forall v. Var v => SuperNormal v
expf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
EXPF
absf :: forall v. Var v => SuperNormal v
absf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
ABSF
cosf, sinf, tanf, acosf, asinf, atanf :: (Var v) => SuperNormal v
cosf :: forall v. Var v => SuperNormal v
cosf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
COSF
sinf :: forall v. Var v => SuperNormal v
sinf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
SINF
tanf :: forall v. Var v => SuperNormal v
tanf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
TANF
acosf :: forall v. Var v => SuperNormal v
acosf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
ACOS
asinf :: forall v. Var v => SuperNormal v
asinf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
ASIN
atanf :: forall v. Var v => SuperNormal v
atanf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
ATAN
coshf,
sinhf,
tanhf,
acoshf,
asinhf,
atanhf,
atan2f ::
(Var v) => SuperNormal v
coshf :: forall v. Var v => SuperNormal v
coshf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
COSH
sinhf :: forall v. Var v => SuperNormal v
sinhf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
SINH
tanhf :: forall v. Var v => SuperNormal v
tanhf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
TANH
acoshf :: forall v. Var v => SuperNormal v
acoshf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
ACSH
asinhf :: forall v. Var v => SuperNormal v
asinhf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
ASNH
atanhf :: forall v. Var v => SuperNormal v
atanhf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
ATNH
atan2f :: forall v. Var v => SuperNormal v
atan2f = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
ATN2
ltf, gtf, lef, gef, eqf, neqf :: (Var v) => SuperNormal v
ltf :: forall v. Var v => SuperNormal v
ltf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
LESF
gtf :: forall v. Var v => SuperNormal v
gtf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binopSwap POp
LESF
lef :: forall v. Var v => SuperNormal v
lef = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
LEQF
gef :: forall v. Var v => SuperNormal v
gef = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binopSwap POp
LEQF
eqf :: forall v. Var v => SuperNormal v
eqf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
EQLF
neqf :: forall v. Var v => SuperNormal v
neqf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
NEQF
minf, maxf :: (Var v) => SuperNormal v
minf :: forall v. Var v => SuperNormal v
minf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
MINF
maxf :: forall v. Var v => SuperNormal v
maxf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
binop POp
MAXF
ceilf, floorf, truncf, roundf, i2f, n2f :: (Var v) => SuperNormal v
ceilf :: forall v. Var v => SuperNormal v
ceilf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
CEIL
floorf :: forall v. Var v => SuperNormal v
floorf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
FLOR
truncf :: forall v. Var v => SuperNormal v
truncf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
TRNF
roundf :: forall v. Var v => SuperNormal v
roundf = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
RNDF
i2f :: forall v. Var v => SuperNormal v
i2f = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
ITOF
n2f :: forall v. Var v => SuperNormal v
n2f = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
NTOF
trni :: (Var v) => SuperNormal v
trni :: forall v. Var v => SuperNormal v
trni = POp -> SuperNormal v
forall v. Var v => POp -> SuperNormal v
unop POp
TRNC
modular :: (Var v) => POp -> (Bool -> ANormal v) -> SuperNormal v
modular :: forall v. Var v => POp -> (Bool -> ANormal v) -> SuperNormal v
modular POp
pop Bool -> ANormal v
ret =
Int -> ([v] -> ANormal v) -> SuperNormal v
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
2 (([v] -> ANormal v) -> SuperNormal v)
-> ([v] -> ANormal v) -> SuperNormal v
forall a b. (a -> b) -> a -> b
$ \[v
x, v
m, v
t] ->
v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
t Mem
UN (Lit -> ANormal v
forall v. Var v => Lit -> Term ANormalF v
TLit (Lit -> ANormal v) -> Lit -> ANormal v
forall a b. (a -> b) -> a -> b
$ Int64 -> Lit
I Int64
2)
(ANormal v -> ANormal v)
-> (Branched (ANormal v) -> ANormal v)
-> Branched (ANormal v)
-> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
m Mem
UN (POp -> [v] -> ANormal v
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
pop [v
x, v
t])
(ANormal v -> ANormal v)
-> (Branched (ANormal v) -> ANormal v)
-> Branched (ANormal v)
-> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Branched (ANormal v) -> ANormal v
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch v
m
(Branched (ANormal v) -> ANormal v)
-> Branched (ANormal v) -> ANormal v
forall a b. (a -> b) -> a -> b
$ EnumMap Word64 (ANormal v)
-> Maybe (ANormal v) -> Branched (ANormal v)
forall e. EnumMap Word64 e -> Maybe e -> Branched e
MatchIntegral
(Word64 -> ANormal v -> EnumMap Word64 (ANormal v)
forall k a. EnumKey k => k -> a -> EnumMap k a
mapSingleton Word64
1 (ANormal v -> EnumMap Word64 (ANormal v))
-> ANormal v -> EnumMap Word64 (ANormal v)
forall a b. (a -> b) -> a -> b
$ Bool -> ANormal v
ret Bool
True)
(ANormal v -> Maybe (ANormal v)
forall a. a -> Maybe a
Just (ANormal v -> Maybe (ANormal v)) -> ANormal v -> Maybe (ANormal v)
forall a b. (a -> b) -> a -> b
$ Bool -> ANormal v
ret Bool
False)
evni, evnn, oddi, oddn :: (Var v) => SuperNormal v
evni :: forall v. Var v => SuperNormal v
evni = POp -> (Bool -> ANormal v) -> SuperNormal v
forall v. Var v => POp -> (Bool -> ANormal v) -> SuperNormal v
modular POp
MODI (\Bool
b -> if Bool
b then ANormal v
forall v. Var v => ANormal v
fls else ANormal v
forall v. Var v => ANormal v
tru)
oddi :: forall v. Var v => SuperNormal v
oddi = POp -> (Bool -> ANormal v) -> SuperNormal v
forall v. Var v => POp -> (Bool -> ANormal v) -> SuperNormal v
modular POp
MODI (\Bool
b -> if Bool
b then ANormal v
forall v. Var v => ANormal v
tru else ANormal v
forall v. Var v => ANormal v
fls)
evnn :: forall v. Var v => SuperNormal v
evnn = POp -> (Bool -> ANormal v) -> SuperNormal v
forall v. Var v => POp -> (Bool -> ANormal v) -> SuperNormal v
modular POp
MODN (\Bool
b -> if Bool
b then ANormal v
forall v. Var v => ANormal v
fls else ANormal v
forall v. Var v => ANormal v
tru)
oddn :: forall v. Var v => SuperNormal v
oddn = POp -> (Bool -> ANormal v) -> SuperNormal v
forall v. Var v => POp -> (Bool -> ANormal v) -> SuperNormal v
modular POp
MODN (\Bool
b -> if Bool
b then ANormal v
forall v. Var v => ANormal v
tru else ANormal v
forall v. Var v => ANormal v
fls)
appendt, taket, dropt, indext, indexb, sizet, unconst, unsnoct :: (Var v) => SuperNormal v
appendt :: forall v. Var v => SuperNormal v
appendt = Int -> ([v] -> ANormal v) -> SuperNormal v
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
binop0 Int
0 (([v] -> ANormal v) -> SuperNormal v)
-> ([v] -> ANormal v) -> SuperNormal v
forall a b. (a -> b) -> a -> b
$ \[v
x, v
y] -> POp -> [v] -> ANormal v
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
CATT [v
x, v
y]
taket :: forall v. Var v => SuperNormal v
taket = Int -> ([v] -> ANormal v) -> SuperNormal v
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
binop0 Int
0 (([v] -> ANormal v) -> SuperNormal v)
-> ([v] -> ANormal v) -> SuperNormal v
forall a b. (a -> b) -> a -> b
$ \[v
x, v
y] ->
POp -> [v] -> ANormal v
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
TAKT [v
x, v
y]
dropt :: forall v. Var v => SuperNormal v
dropt = Int -> ([v] -> ANormal v) -> SuperNormal v
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
binop0 Int
0 (([v] -> ANormal v) -> SuperNormal v)
-> ([v] -> ANormal v) -> SuperNormal v
forall a b. (a -> b) -> a -> b
$ \[v
x, v
y] ->
POp -> [v] -> ANormal v
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
DRPT [v
x, v
y]
atb :: SuperNormal Symbol
atb = Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
binop0 Int
2 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
n, Symbol
b, Symbol
t, Symbol
r] ->
Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
t Mem
UN (POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
IDXB [Symbol
n, Symbol
b])
(ANormal Symbol -> ANormal Symbol)
-> (EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Branched (ANormal Symbol) -> ANormal Symbol
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch Symbol
t
(Branched (ANormal Symbol) -> ANormal Symbol)
-> (EnumMap Word64 ([Mem], ANormal Symbol)
-> Branched (ANormal Symbol))
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], ANormal Symbol) -> Branched (ANormal Symbol)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum
(EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$ [(Word64, ([Mem], ANormal Symbol))]
-> EnumMap Word64 ([Mem], ANormal Symbol)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ (Word64
0, ([], ANormal Symbol
forall v. Var v => ANormal v
none)),
( Word64
1,
( [Mem
UN],
Symbol -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs Symbol
r (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$ Symbol -> ANormal Symbol
forall v. Var v => v -> ANormal v
some Symbol
r
)
)
]
indext :: forall v. Var v => SuperNormal v
indext = Int -> ([v] -> ANormal v) -> SuperNormal v
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
binop0 Int
2 (([v] -> ANormal v) -> SuperNormal v)
-> ([v] -> ANormal v) -> SuperNormal v
forall a b. (a -> b) -> a -> b
$ \[v
x, v
y, v
t, v
r] ->
v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
t Mem
UN (POp -> [v] -> ANormal v
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
IXOT [v
x, v
y])
(ANormal v -> ANormal v)
-> (EnumMap Word64 ([Mem], ANormal v) -> ANormal v)
-> EnumMap Word64 ([Mem], ANormal v)
-> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Branched (ANormal v) -> ANormal v
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch v
t
(Branched (ANormal v) -> ANormal v)
-> (EnumMap Word64 ([Mem], ANormal v) -> Branched (ANormal v))
-> EnumMap Word64 ([Mem], ANormal v)
-> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], ANormal v) -> Branched (ANormal v)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum
(EnumMap Word64 ([Mem], ANormal v) -> ANormal v)
-> EnumMap Word64 ([Mem], ANormal v) -> ANormal v
forall a b. (a -> b) -> a -> b
$ [(Word64, ([Mem], ANormal v))] -> EnumMap Word64 ([Mem], ANormal v)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ (Word64
0, ([], ANormal v
forall v. Var v => ANormal v
none)),
( Word64
1,
( [Mem
UN],
v -> ANormal v -> ANormal v
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs v
r (ANormal v -> ANormal v) -> ANormal v -> ANormal v
forall a b. (a -> b) -> a -> b
$ v -> ANormal v
forall v. Var v => v -> ANormal v
some v
r
)
)
]
indexb :: forall v. Var v => SuperNormal v
indexb = Int -> ([v] -> ANormal v) -> SuperNormal v
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
binop0 Int
2 (([v] -> ANormal v) -> SuperNormal v)
-> ([v] -> ANormal v) -> SuperNormal v
forall a b. (a -> b) -> a -> b
$ \[v
x, v
y, v
t, v
r] ->
v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
t Mem
UN (POp -> [v] -> ANormal v
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
IXOB [v
x, v
y])
(ANormal v -> ANormal v)
-> (EnumMap Word64 ([Mem], ANormal v) -> ANormal v)
-> EnumMap Word64 ([Mem], ANormal v)
-> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Branched (ANormal v) -> ANormal v
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch v
t
(Branched (ANormal v) -> ANormal v)
-> (EnumMap Word64 ([Mem], ANormal v) -> Branched (ANormal v))
-> EnumMap Word64 ([Mem], ANormal v)
-> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], ANormal v) -> Branched (ANormal v)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum
(EnumMap Word64 ([Mem], ANormal v) -> ANormal v)
-> EnumMap Word64 ([Mem], ANormal v) -> ANormal v
forall a b. (a -> b) -> a -> b
$ [(Word64, ([Mem], ANormal v))] -> EnumMap Word64 ([Mem], ANormal v)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ (Word64
0, ([], ANormal v
forall v. Var v => ANormal v
none)),
( Word64
1,
( [Mem
UN],
v -> ANormal v -> ANormal v
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs v
r (ANormal v -> ANormal v) -> ANormal v -> ANormal v
forall a b. (a -> b) -> a -> b
$ v -> ANormal v
forall v. Var v => v -> ANormal v
some v
r
)
)
]
sizet :: forall v. Var v => SuperNormal v
sizet = Int -> ([v] -> ANormal v) -> SuperNormal v
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
0 (([v] -> ANormal v) -> SuperNormal v)
-> ([v] -> ANormal v) -> SuperNormal v
forall a b. (a -> b) -> a -> b
$ \[v
x] -> POp -> [v] -> ANormal v
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
SIZT [v
x]
unconst :: forall v. Var v => SuperNormal v
unconst = Int -> ([v] -> ANormal v) -> SuperNormal v
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
6 (([v] -> ANormal v) -> SuperNormal v)
-> ([v] -> ANormal v) -> SuperNormal v
forall a b. (a -> b) -> a -> b
$ \[v
x, v
t, v
c, v
y, v
p, v
u, v
yp] ->
v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
t Mem
UN (POp -> [v] -> ANormal v
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
UCNS [v
x])
(ANormal v -> ANormal v)
-> (EnumMap Word64 ([Mem], ANormal v) -> ANormal v)
-> EnumMap Word64 ([Mem], ANormal v)
-> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Branched (ANormal v) -> ANormal v
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch v
t
(Branched (ANormal v) -> ANormal v)
-> (EnumMap Word64 ([Mem], ANormal v) -> Branched (ANormal v))
-> EnumMap Word64 ([Mem], ANormal v)
-> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], ANormal v) -> Branched (ANormal v)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum
(EnumMap Word64 ([Mem], ANormal v) -> ANormal v)
-> EnumMap Word64 ([Mem], ANormal v) -> ANormal v
forall a b. (a -> b) -> a -> b
$ [(Word64, ([Mem], ANormal v))] -> EnumMap Word64 ([Mem], ANormal v)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ (Word64
0, ([], ANormal v
forall v. Var v => ANormal v
none)),
( Word64
1,
( [Mem
UN, Mem
BX],
[v] -> ANormal v -> ANormal v
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [v
c, v
y]
(ANormal v -> ANormal v)
-> (ANormal v -> ANormal v) -> ANormal v -> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
u Mem
BX (Reference -> CTag -> [v] -> ANormal v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.unitRef CTag
0 [])
(ANormal v -> ANormal v)
-> (ANormal v -> ANormal v) -> ANormal v -> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
yp Mem
BX (Reference -> CTag -> [v] -> ANormal v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.pairRef CTag
0 [v
y, v
u])
(ANormal v -> ANormal v)
-> (ANormal v -> ANormal v) -> ANormal v -> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
p Mem
BX (Reference -> CTag -> [v] -> ANormal v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.pairRef CTag
0 [v
c, v
yp])
(ANormal v -> ANormal v) -> ANormal v -> ANormal v
forall a b. (a -> b) -> a -> b
$ v -> ANormal v
forall v. Var v => v -> ANormal v
some v
p
)
)
]
unsnoct :: forall v. Var v => SuperNormal v
unsnoct = Int -> ([v] -> ANormal v) -> SuperNormal v
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
6 (([v] -> ANormal v) -> SuperNormal v)
-> ([v] -> ANormal v) -> SuperNormal v
forall a b. (a -> b) -> a -> b
$ \[v
x, v
t, v
c, v
y, v
p, v
u, v
cp] ->
v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
t Mem
UN (POp -> [v] -> ANormal v
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
USNC [v
x])
(ANormal v -> ANormal v)
-> (EnumMap Word64 ([Mem], ANormal v) -> ANormal v)
-> EnumMap Word64 ([Mem], ANormal v)
-> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Branched (ANormal v) -> ANormal v
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch v
t
(Branched (ANormal v) -> ANormal v)
-> (EnumMap Word64 ([Mem], ANormal v) -> Branched (ANormal v))
-> EnumMap Word64 ([Mem], ANormal v)
-> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], ANormal v) -> Branched (ANormal v)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum
(EnumMap Word64 ([Mem], ANormal v) -> ANormal v)
-> EnumMap Word64 ([Mem], ANormal v) -> ANormal v
forall a b. (a -> b) -> a -> b
$ [(Word64, ([Mem], ANormal v))] -> EnumMap Word64 ([Mem], ANormal v)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ (Word64
0, ([], ANormal v
forall v. Var v => ANormal v
none)),
( Word64
1,
( [Mem
BX, Mem
UN],
[v] -> ANormal v -> ANormal v
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [v
y, v
c]
(ANormal v -> ANormal v)
-> (ANormal v -> ANormal v) -> ANormal v -> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
u Mem
BX (Reference -> CTag -> [v] -> ANormal v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.unitRef CTag
0 [])
(ANormal v -> ANormal v)
-> (ANormal v -> ANormal v) -> ANormal v -> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
cp Mem
BX (Reference -> CTag -> [v] -> ANormal v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.pairRef CTag
0 [v
c, v
u])
(ANormal v -> ANormal v)
-> (ANormal v -> ANormal v) -> ANormal v -> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
p Mem
BX (Reference -> CTag -> [v] -> ANormal v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.pairRef CTag
0 [v
y, v
cp])
(ANormal v -> ANormal v) -> ANormal v -> ANormal v
forall a b. (a -> b) -> a -> b
$ v -> ANormal v
forall v. Var v => v -> ANormal v
some v
p
)
)
]
appends, conss, snocs :: (Var v) => SuperNormal v
appends :: forall v. Var v => SuperNormal v
appends = Int -> ([v] -> ANormal v) -> SuperNormal v
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
binop0 Int
0 (([v] -> ANormal v) -> SuperNormal v)
-> ([v] -> ANormal v) -> SuperNormal v
forall a b. (a -> b) -> a -> b
$ \[v
x, v
y] -> POp -> [v] -> ANormal v
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
CATS [v
x, v
y]
conss :: forall v. Var v => SuperNormal v
conss = Int -> ([v] -> ANormal v) -> SuperNormal v
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
binop0 Int
0 (([v] -> ANormal v) -> SuperNormal v)
-> ([v] -> ANormal v) -> SuperNormal v
forall a b. (a -> b) -> a -> b
$ \[v
x, v
y] -> POp -> [v] -> ANormal v
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
CONS [v
x, v
y]
snocs :: forall v. Var v => SuperNormal v
snocs = Int -> ([v] -> ANormal v) -> SuperNormal v
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
binop0 Int
0 (([v] -> ANormal v) -> SuperNormal v)
-> ([v] -> ANormal v) -> SuperNormal v
forall a b. (a -> b) -> a -> b
$ \[v
x, v
y] -> POp -> [v] -> ANormal v
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
SNOC [v
x, v
y]
takes, drops, sizes, ats, emptys :: (Var v) => SuperNormal v
takes :: forall v. Var v => SuperNormal v
takes = Int -> ([v] -> ANormal v) -> SuperNormal v
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
binop0 Int
0 (([v] -> ANormal v) -> SuperNormal v)
-> ([v] -> ANormal v) -> SuperNormal v
forall a b. (a -> b) -> a -> b
$ \[v
x, v
y] -> POp -> [v] -> ANormal v
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
TAKS [v
x, v
y]
drops :: forall v. Var v => SuperNormal v
drops = Int -> ([v] -> ANormal v) -> SuperNormal v
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
binop0 Int
0 (([v] -> ANormal v) -> SuperNormal v)
-> ([v] -> ANormal v) -> SuperNormal v
forall a b. (a -> b) -> a -> b
$ \[v
x, v
y] -> POp -> [v] -> ANormal v
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
DRPS [v
x, v
y]
sizes :: forall v. Var v => SuperNormal v
sizes = Int -> ([v] -> ANormal v) -> SuperNormal v
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
0 (([v] -> ANormal v) -> SuperNormal v)
-> ([v] -> ANormal v) -> SuperNormal v
forall a b. (a -> b) -> a -> b
$ \[v
x] -> (POp -> [v] -> ANormal v
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
SIZS [v
x])
ats :: forall v. Var v => SuperNormal v
ats = Int -> ([v] -> ANormal v) -> SuperNormal v
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
binop0 Int
2 (([v] -> ANormal v) -> SuperNormal v)
-> ([v] -> ANormal v) -> SuperNormal v
forall a b. (a -> b) -> a -> b
$ \[v
x, v
y, v
t, v
r] ->
v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
t Mem
UN (POp -> [v] -> ANormal v
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
IDXS [v
x, v
y])
(ANormal v -> ANormal v)
-> (EnumMap Word64 ([Mem], ANormal v) -> ANormal v)
-> EnumMap Word64 ([Mem], ANormal v)
-> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Branched (ANormal v) -> ANormal v
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch v
t
(Branched (ANormal v) -> ANormal v)
-> (EnumMap Word64 ([Mem], ANormal v) -> Branched (ANormal v))
-> EnumMap Word64 ([Mem], ANormal v)
-> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], ANormal v) -> Branched (ANormal v)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum
(EnumMap Word64 ([Mem], ANormal v) -> ANormal v)
-> EnumMap Word64 ([Mem], ANormal v) -> ANormal v
forall a b. (a -> b) -> a -> b
$ [(Word64, ([Mem], ANormal v))] -> EnumMap Word64 ([Mem], ANormal v)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ (Word64
0, ([], ANormal v
forall v. Var v => ANormal v
none)),
(Word64
1, ([Mem
BX], v -> ANormal v -> ANormal v
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs v
r (ANormal v -> ANormal v) -> ANormal v -> ANormal v
forall a b. (a -> b) -> a -> b
$ v -> ANormal v
forall v. Var v => v -> ANormal v
some v
r))
]
emptys :: forall v. Var v => SuperNormal v
emptys = [Mem] -> ANormal v -> SuperNormal v
forall v. [Mem] -> ANormal v -> SuperNormal v
Lambda [] (ANormal v -> SuperNormal v) -> ANormal v -> SuperNormal v
forall a b. (a -> b) -> a -> b
$ POp -> [v] -> ANormal v
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
BLDS []
viewls, viewrs :: (Var v) => SuperNormal v
viewls :: forall v. Var v => SuperNormal v
viewls = Int -> ([v] -> ANormal v) -> SuperNormal v
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
3 (([v] -> ANormal v) -> SuperNormal v)
-> ([v] -> ANormal v) -> SuperNormal v
forall a b. (a -> b) -> a -> b
$ \[v
s, v
u, v
h, v
t] ->
v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
u Mem
UN (POp -> [v] -> ANormal v
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
VWLS [v
s])
(ANormal v -> ANormal v)
-> (EnumMap Word64 ([Mem], ANormal v) -> ANormal v)
-> EnumMap Word64 ([Mem], ANormal v)
-> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Branched (ANormal v) -> ANormal v
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch v
u
(Branched (ANormal v) -> ANormal v)
-> (EnumMap Word64 ([Mem], ANormal v) -> Branched (ANormal v))
-> EnumMap Word64 ([Mem], ANormal v)
-> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], ANormal v) -> Branched (ANormal v)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum
(EnumMap Word64 ([Mem], ANormal v) -> ANormal v)
-> EnumMap Word64 ([Mem], ANormal v) -> ANormal v
forall a b. (a -> b) -> a -> b
$ [(Word64, ([Mem], ANormal v))] -> EnumMap Word64 ([Mem], ANormal v)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ (Word64
0, ([], ANormal v
forall v. Var v => ANormal v
seqViewEmpty)),
(Word64
1, ([Mem
BX, Mem
BX], [v] -> ANormal v -> ANormal v
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [v
h, v
t] (ANormal v -> ANormal v) -> ANormal v -> ANormal v
forall a b. (a -> b) -> a -> b
$ v -> v -> ANormal v
forall v. Var v => v -> v -> ANormal v
seqViewElem v
h v
t))
]
viewrs :: forall v. Var v => SuperNormal v
viewrs = Int -> ([v] -> ANormal v) -> SuperNormal v
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
3 (([v] -> ANormal v) -> SuperNormal v)
-> ([v] -> ANormal v) -> SuperNormal v
forall a b. (a -> b) -> a -> b
$ \[v
s, v
u, v
i, v
l] ->
v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
u Mem
UN (POp -> [v] -> ANormal v
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
VWRS [v
s])
(ANormal v -> ANormal v)
-> (EnumMap Word64 ([Mem], ANormal v) -> ANormal v)
-> EnumMap Word64 ([Mem], ANormal v)
-> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Branched (ANormal v) -> ANormal v
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch v
u
(Branched (ANormal v) -> ANormal v)
-> (EnumMap Word64 ([Mem], ANormal v) -> Branched (ANormal v))
-> EnumMap Word64 ([Mem], ANormal v)
-> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], ANormal v) -> Branched (ANormal v)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum
(EnumMap Word64 ([Mem], ANormal v) -> ANormal v)
-> EnumMap Word64 ([Mem], ANormal v) -> ANormal v
forall a b. (a -> b) -> a -> b
$ [(Word64, ([Mem], ANormal v))] -> EnumMap Word64 ([Mem], ANormal v)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ (Word64
0, ([], ANormal v
forall v. Var v => ANormal v
seqViewEmpty)),
(Word64
1, ([Mem
BX, Mem
BX], [v] -> ANormal v -> ANormal v
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [v
i, v
l] (ANormal v -> ANormal v) -> ANormal v -> ANormal v
forall a b. (a -> b) -> a -> b
$ v -> v -> ANormal v
forall v. Var v => v -> v -> ANormal v
seqViewElem v
i v
l))
]
splitls, splitrs :: (Var v) => SuperNormal v
splitls :: forall v. Var v => SuperNormal v
splitls = Int -> ([v] -> ANormal v) -> SuperNormal v
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
binop0 Int
3 (([v] -> ANormal v) -> SuperNormal v)
-> ([v] -> ANormal v) -> SuperNormal v
forall a b. (a -> b) -> a -> b
$ \[v
n, v
s, v
t, v
l, v
r] ->
v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
t Mem
UN (POp -> [v] -> ANormal v
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
SPLL [v
n, v
s])
(ANormal v -> ANormal v)
-> (EnumMap Word64 ([Mem], ANormal v) -> ANormal v)
-> EnumMap Word64 ([Mem], ANormal v)
-> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Branched (ANormal v) -> ANormal v
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch v
t
(Branched (ANormal v) -> ANormal v)
-> (EnumMap Word64 ([Mem], ANormal v) -> Branched (ANormal v))
-> EnumMap Word64 ([Mem], ANormal v)
-> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], ANormal v) -> Branched (ANormal v)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum
(EnumMap Word64 ([Mem], ANormal v) -> ANormal v)
-> EnumMap Word64 ([Mem], ANormal v) -> ANormal v
forall a b. (a -> b) -> a -> b
$ [(Word64, ([Mem], ANormal v))] -> EnumMap Word64 ([Mem], ANormal v)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ (Word64
0, ([], ANormal v
forall v. Var v => ANormal v
seqViewEmpty)),
(Word64
1, ([Mem
BX, Mem
BX], [v] -> ANormal v -> ANormal v
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [v
l, v
r] (ANormal v -> ANormal v) -> ANormal v -> ANormal v
forall a b. (a -> b) -> a -> b
$ v -> v -> ANormal v
forall v. Var v => v -> v -> ANormal v
seqViewElem v
l v
r))
]
splitrs :: forall v. Var v => SuperNormal v
splitrs = Int -> ([v] -> ANormal v) -> SuperNormal v
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
binop0 Int
3 (([v] -> ANormal v) -> SuperNormal v)
-> ([v] -> ANormal v) -> SuperNormal v
forall a b. (a -> b) -> a -> b
$ \[v
n, v
s, v
t, v
l, v
r] ->
v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
t Mem
UN (POp -> [v] -> ANormal v
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
SPLR [v
n, v
s])
(ANormal v -> ANormal v)
-> (EnumMap Word64 ([Mem], ANormal v) -> ANormal v)
-> EnumMap Word64 ([Mem], ANormal v)
-> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Branched (ANormal v) -> ANormal v
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch v
t
(Branched (ANormal v) -> ANormal v)
-> (EnumMap Word64 ([Mem], ANormal v) -> Branched (ANormal v))
-> EnumMap Word64 ([Mem], ANormal v)
-> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], ANormal v) -> Branched (ANormal v)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum
(EnumMap Word64 ([Mem], ANormal v) -> ANormal v)
-> EnumMap Word64 ([Mem], ANormal v) -> ANormal v
forall a b. (a -> b) -> a -> b
$ [(Word64, ([Mem], ANormal v))] -> EnumMap Word64 ([Mem], ANormal v)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ (Word64
0, ([], ANormal v
forall v. Var v => ANormal v
seqViewEmpty)),
(Word64
1, ([Mem
BX, Mem
BX], [v] -> ANormal v -> ANormal v
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [v
l, v
r] (ANormal v -> ANormal v) -> ANormal v -> ANormal v
forall a b. (a -> b) -> a -> b
$ v -> v -> ANormal v
forall v. Var v => v -> v -> ANormal v
seqViewElem v
l v
r))
]
eqt, neqt, leqt, geqt, lesst, great :: SuperNormal Symbol
eqt :: SuperNormal Symbol
eqt = POp -> SuperNormal Symbol
forall v. Var v => POp -> SuperNormal v
binop POp
EQLT
neqt :: SuperNormal Symbol
neqt = Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
binop0 Int
1 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
x, Symbol
y, Symbol
b] ->
Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
b Mem
UN (POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
EQLT [Symbol
x, Symbol
y]) (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$
POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
NOTB [Symbol
b]
leqt :: SuperNormal Symbol
leqt = POp -> SuperNormal Symbol
forall v. Var v => POp -> SuperNormal v
binop POp
LEQT
geqt :: SuperNormal Symbol
geqt = POp -> SuperNormal Symbol
forall v. Var v => POp -> SuperNormal v
binopSwap POp
LEQT
lesst :: SuperNormal Symbol
lesst = Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
binop0 Int
1 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
x, Symbol
y, Symbol
b] ->
Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
b Mem
UN (POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
LEQT [Symbol
y, Symbol
x]) (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$
POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
NOTB [Symbol
b]
great :: SuperNormal Symbol
great = Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
binop0 Int
1 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
x, Symbol
y, Symbol
b] ->
Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
b Mem
UN (POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
LEQT [Symbol
x, Symbol
y]) (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$
POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
NOTB [Symbol
b]
packt, unpackt :: SuperNormal Symbol
packt :: SuperNormal Symbol
packt = Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
0 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
s] -> POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
PAKT [Symbol
s]
unpackt :: SuperNormal Symbol
unpackt = Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
0 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
t] -> POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
UPKT [Symbol
t]
packb, unpackb, emptyb, appendb :: SuperNormal Symbol
packb :: SuperNormal Symbol
packb = Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
0 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
s] -> POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
PAKB [Symbol
s]
unpackb :: SuperNormal Symbol
unpackb = Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
0 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
b] -> POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
UPKB [Symbol
b]
emptyb :: SuperNormal Symbol
emptyb =
[Mem] -> ANormal Symbol -> SuperNormal Symbol
forall v. [Mem] -> ANormal v -> SuperNormal v
Lambda []
(ANormal Symbol -> SuperNormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> SuperNormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
es Mem
BX (POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
BLDS [])
(ANormal Symbol -> SuperNormal Symbol)
-> ANormal Symbol -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
PAKB [Symbol
es]
where
es :: Symbol
es = Symbol
forall v. Var v => v
fresh1
appendb :: SuperNormal Symbol
appendb = Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
binop0 Int
0 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
x, Symbol
y] -> POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
CATB [Symbol
x, Symbol
y]
takeb, dropb, atb, sizeb, flattenb :: SuperNormal Symbol
takeb :: SuperNormal Symbol
takeb = Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
binop0 Int
0 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
n, Symbol
b] -> POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
TAKB [Symbol
n, Symbol
b]
dropb :: SuperNormal Symbol
dropb = Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
binop0 Int
0 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
n, Symbol
b] -> POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
DRPB [Symbol
n, Symbol
b]
sizeb :: SuperNormal Symbol
sizeb = Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
0 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
b] -> (POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
SIZB [Symbol
b])
flattenb :: SuperNormal Symbol
flattenb = Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
0 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
b] -> POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
FLTB [Symbol
b]
i2t, n2t, f2t :: SuperNormal Symbol
i2t :: SuperNormal Symbol
i2t = Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
0 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
n] -> POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
ITOT [Symbol
n]
n2t :: SuperNormal Symbol
n2t = Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
0 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
n] -> POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
NTOT [Symbol
n]
f2t :: SuperNormal Symbol
f2t = Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
0 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
f] -> POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
FTOT [Symbol
f]
t2i, t2n, t2f :: SuperNormal Symbol
t2i :: SuperNormal Symbol
t2i = Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
2 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
x, Symbol
t, Symbol
n] ->
Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
t Mem
UN (POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
TTOI [Symbol
x])
(ANormal Symbol -> ANormal Symbol)
-> (EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Branched (ANormal Symbol) -> ANormal Symbol
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch Symbol
t
(Branched (ANormal Symbol) -> ANormal Symbol)
-> (EnumMap Word64 ([Mem], ANormal Symbol)
-> Branched (ANormal Symbol))
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], ANormal Symbol) -> Branched (ANormal Symbol)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum
(EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$ [(Word64, ([Mem], ANormal Symbol))]
-> EnumMap Word64 ([Mem], ANormal Symbol)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ (Word64
0, ([], ANormal Symbol
forall v. Var v => ANormal v
none)),
( Word64
1,
( [Mem
UN],
Symbol -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs Symbol
n (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$ Symbol -> ANormal Symbol
forall v. Var v => v -> ANormal v
some Symbol
n
)
)
]
t2n :: SuperNormal Symbol
t2n = Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
2 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
x, Symbol
t, Symbol
n] ->
Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
t Mem
UN (POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
TTON [Symbol
x])
(ANormal Symbol -> ANormal Symbol)
-> (EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Branched (ANormal Symbol) -> ANormal Symbol
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch Symbol
t
(Branched (ANormal Symbol) -> ANormal Symbol)
-> (EnumMap Word64 ([Mem], ANormal Symbol)
-> Branched (ANormal Symbol))
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], ANormal Symbol) -> Branched (ANormal Symbol)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum
(EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$ [(Word64, ([Mem], ANormal Symbol))]
-> EnumMap Word64 ([Mem], ANormal Symbol)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ (Word64
0, ([], ANormal Symbol
forall v. Var v => ANormal v
none)),
( Word64
1,
( [Mem
UN],
Symbol -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs Symbol
n (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$ Symbol -> ANormal Symbol
forall v. Var v => v -> ANormal v
some Symbol
n
)
)
]
t2f :: SuperNormal Symbol
t2f = Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
2 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
x, Symbol
t, Symbol
f] ->
Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
t Mem
UN (POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
TTOF [Symbol
x])
(ANormal Symbol -> ANormal Symbol)
-> (EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Branched (ANormal Symbol) -> ANormal Symbol
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch Symbol
t
(Branched (ANormal Symbol) -> ANormal Symbol)
-> (EnumMap Word64 ([Mem], ANormal Symbol)
-> Branched (ANormal Symbol))
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], ANormal Symbol) -> Branched (ANormal Symbol)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum
(EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$ [(Word64, ([Mem], ANormal Symbol))]
-> EnumMap Word64 ([Mem], ANormal Symbol)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ (Word64
0, ([], ANormal Symbol
forall v. Var v => ANormal v
none)),
( Word64
1,
( [Mem
UN],
Symbol -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs Symbol
f (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$ Symbol -> ANormal Symbol
forall v. Var v => v -> ANormal v
some Symbol
f
)
)
]
equ :: SuperNormal Symbol
equ :: SuperNormal Symbol
equ = POp -> SuperNormal Symbol
forall v. Var v => POp -> SuperNormal v
binop POp
EQLU
cmpu :: SuperNormal Symbol
cmpu :: SuperNormal Symbol
cmpu = POp -> SuperNormal Symbol
forall v. Var v => POp -> SuperNormal v
binop POp
CMPU
ltu :: SuperNormal Symbol
ltu :: SuperNormal Symbol
ltu = POp -> SuperNormal Symbol
forall v. Var v => POp -> SuperNormal v
binop POp
LESU
gtu :: SuperNormal Symbol
gtu :: SuperNormal Symbol
gtu = POp -> SuperNormal Symbol
forall v. Var v => POp -> SuperNormal v
binopSwap POp
LESU
geu :: SuperNormal Symbol
geu :: SuperNormal Symbol
geu = POp -> SuperNormal Symbol
forall v. Var v => POp -> SuperNormal v
binopSwap POp
LEQU
leu :: SuperNormal Symbol
leu :: SuperNormal Symbol
leu = POp -> SuperNormal Symbol
forall v. Var v => POp -> SuperNormal v
binop POp
LEQU
notb :: SuperNormal Symbol
notb :: SuperNormal Symbol
notb = POp -> SuperNormal Symbol
forall v. Var v => POp -> SuperNormal v
unop POp
NOTB
orb :: SuperNormal Symbol
orb :: SuperNormal Symbol
orb = POp -> SuperNormal Symbol
forall v. Var v => POp -> SuperNormal v
binop POp
IORB
andb :: SuperNormal Symbol
andb :: SuperNormal Symbol
andb = POp -> SuperNormal Symbol
forall v. Var v => POp -> SuperNormal v
binop POp
ANDB
coerceType :: UnboxedTypeTag -> SuperNormal Symbol
coerceType :: UnboxedTypeTag -> SuperNormal Symbol
coerceType UnboxedTypeTag
destType =
Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
1 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
v, Symbol
tag] ->
Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
tag Mem
UN (Lit -> ANormal Symbol
forall v. Var v => Lit -> Term ANormalF v
TLit (Lit -> ANormal Symbol) -> Lit -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$ Int64 -> Lit
I (Int64 -> Lit) -> Int64 -> Lit
forall a b. (a -> b) -> a -> b
$ Int -> Int64
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Int64) -> Int -> Int64
forall a b. (a -> b) -> a -> b
$ UnboxedTypeTag -> Int
unboxedTypeTagToInt UnboxedTypeTag
destType) (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$
POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
CAST [Symbol
v, Symbol
tag]
poly'coerce :: SuperNormal Symbol
poly'coerce :: SuperNormal Symbol
poly'coerce = Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
0 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
x] -> Symbol -> ANormal Symbol
forall v. Var v => v -> Term ANormalF v
TVar Symbol
x
jumpk :: SuperNormal Symbol
jumpk :: SuperNormal Symbol
jumpk = Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
binop0 Int
0 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
k, Symbol
a] -> Symbol -> [Symbol] -> ANormal Symbol
forall v. Var v => v -> [v] -> Term ANormalF v
TKon Symbol
k [Symbol
a]
scope'run :: SuperNormal Symbol
scope'run :: SuperNormal Symbol
scope'run =
Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
1 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
e, Symbol
un] ->
Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
un Mem
BX (Reference -> CTag -> [Symbol] -> ANormal Symbol
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.unitRef CTag
0 []) (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$
Func Symbol -> [Symbol] -> ANormal Symbol
forall v. Var v => Func v -> [v] -> Term ANormalF v
TApp (Symbol -> Func Symbol
forall v. v -> Func v
FVar Symbol
e) [Symbol
un]
fork'comp :: SuperNormal Symbol
fork'comp :: SuperNormal Symbol
fork'comp =
[Mem] -> ANormal Symbol -> SuperNormal Symbol
forall v. [Mem] -> ANormal v -> SuperNormal v
Lambda [Mem
BX]
(ANormal Symbol -> SuperNormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> SuperNormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs Symbol
act
(ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
unit Mem
BX (Reference -> CTag -> [Symbol] -> ANormal Symbol
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.unitRef CTag
0 [])
(ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol
-> Either Reference Symbol
-> [Symbol]
-> ANormal Symbol
-> ANormal Symbol
forall v.
Var v =>
v
-> Either Reference v -> [v] -> Term ANormalF v -> Term ANormalF v
TName Symbol
lz (Symbol -> Either Reference Symbol
forall a b. b -> Either a b
Right Symbol
act) [Symbol
unit]
(ANormal Symbol -> SuperNormal Symbol)
-> ANormal Symbol -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
FORK [Symbol
lz]
where
(Symbol
act, Symbol
unit, Symbol
lz) = (Symbol, Symbol, Symbol)
forall t. Fresh t => t
fresh
try'eval :: SuperNormal Symbol
try'eval :: SuperNormal Symbol
try'eval =
[Mem] -> ANormal Symbol -> SuperNormal Symbol
forall v. [Mem] -> ANormal v -> SuperNormal v
Lambda [Mem
BX]
(ANormal Symbol -> SuperNormal Symbol)
-> (EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> SuperNormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs Symbol
act
(ANormal Symbol -> ANormal Symbol)
-> (EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
unit Mem
BX (Reference -> CTag -> [Symbol] -> ANormal Symbol
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.unitRef CTag
0 [])
(ANormal Symbol -> ANormal Symbol)
-> (EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol
-> Either Reference Symbol
-> [Symbol]
-> ANormal Symbol
-> ANormal Symbol
forall v.
Var v =>
v
-> Either Reference v -> [v] -> Term ANormalF v -> Term ANormalF v
TName Symbol
lz (Symbol -> Either Reference Symbol
forall a b. b -> Either a b
Right Symbol
act) [Symbol
unit]
(ANormal Symbol -> ANormal Symbol)
-> (EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
ta Mem
UN (POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
TFRC [Symbol
lz])
(ANormal Symbol -> ANormal Symbol)
-> (EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Branched (ANormal Symbol) -> ANormal Symbol
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch Symbol
ta
(Branched (ANormal Symbol) -> ANormal Symbol)
-> (EnumMap Word64 ([Mem], ANormal Symbol)
-> Branched (ANormal Symbol))
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], ANormal Symbol) -> Branched (ANormal Symbol)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum
(EnumMap Word64 ([Mem], ANormal Symbol) -> SuperNormal Symbol)
-> EnumMap Word64 ([Mem], ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ [(Word64, ([Mem], ANormal Symbol))]
-> EnumMap Word64 ([Mem], ANormal Symbol)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ Symbol
-> Symbol
-> Symbol
-> Symbol
-> Symbol
-> (Word64, ([Mem], ANormal Symbol))
forall v.
Var v =>
v -> v -> v -> v -> v -> (Word64, ([Mem], ANormal v))
exnCase Symbol
lnk Symbol
msg Symbol
xtra Symbol
any Symbol
fail,
(Word64
1, ([Mem
BX], Symbol -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs Symbol
r (Symbol -> ANormal Symbol
forall v. Var v => v -> Term ANormalF v
TVar Symbol
r)))
]
where
(Symbol
act, Symbol
unit, Symbol
lz, Symbol
ta, Symbol
lnk, Symbol
msg, Symbol
xtra, Symbol
any, Symbol
fail, Symbol
r) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol,
Symbol, Symbol)
forall t. Fresh t => t
fresh
bug :: Util.Text.Text -> SuperNormal Symbol
bug :: Text -> SuperNormal Symbol
bug Text
name =
Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
1 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
x, Symbol
n] ->
Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
n Mem
BX (Lit -> ANormal Symbol
forall v. Var v => Lit -> Term ANormalF v
TLit (Lit -> ANormal Symbol) -> Lit -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$ Text -> Lit
T Text
name) (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$
POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
EROR [Symbol
n, Symbol
x]
watch :: SuperNormal Symbol
watch :: SuperNormal Symbol
watch =
Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
binop0 Int
0 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
t, Symbol
v] ->
Direction Word16
-> [Symbol]
-> [Mem]
-> ANormal Symbol
-> ANormal Symbol
-> ANormal Symbol
forall v.
Var v =>
Direction Word16
-> [v]
-> [Mem]
-> Term ANormalF v
-> Term ANormalF v
-> Term ANormalF v
TLets Direction Word16
forall a. Direction a
Direct [] [] (POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
PRNT [Symbol
t]) (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$
Symbol -> ANormal Symbol
forall v. Var v => v -> Term ANormalF v
TVar Symbol
v
raise :: SuperNormal Symbol
raise :: SuperNormal Symbol
raise =
Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
3 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
r, Symbol
f, Symbol
n, Symbol
k] ->
Symbol -> Branched (ANormal Symbol) -> ANormal Symbol
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch Symbol
r
(Branched (ANormal Symbol) -> ANormal Symbol)
-> (EnumMap CTag ([Mem], ANormal Symbol)
-> Branched (ANormal Symbol))
-> EnumMap CTag ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Map Reference (EnumMap CTag ([Mem], ANormal Symbol))
-> ANormal Symbol -> Branched (ANormal Symbol))
-> ANormal Symbol
-> Map Reference (EnumMap CTag ([Mem], ANormal Symbol))
-> Branched (ANormal Symbol)
forall a b c. (a -> b -> c) -> b -> a -> c
flip Map Reference (EnumMap CTag ([Mem], ANormal Symbol))
-> ANormal Symbol -> Branched (ANormal Symbol)
forall e.
Map Reference (EnumMap CTag ([Mem], e)) -> e -> Branched e
MatchRequest (Symbol -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs Symbol
f (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$ Symbol -> ANormal Symbol
forall v. Var v => v -> Term ANormalF v
TVar Symbol
f)
(Map Reference (EnumMap CTag ([Mem], ANormal Symbol))
-> Branched (ANormal Symbol))
-> (EnumMap CTag ([Mem], ANormal Symbol)
-> Map Reference (EnumMap CTag ([Mem], ANormal Symbol)))
-> EnumMap CTag ([Mem], ANormal Symbol)
-> Branched (ANormal Symbol)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Reference
-> EnumMap CTag ([Mem], ANormal Symbol)
-> Map Reference (EnumMap CTag ([Mem], ANormal Symbol))
forall k a. k -> a -> Map k a
Map.singleton Reference
Ty.exceptionRef
(EnumMap CTag ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap CTag ([Mem], ANormal Symbol) -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$ CTag
-> ([Mem], ANormal Symbol) -> EnumMap CTag ([Mem], ANormal Symbol)
forall k a. EnumKey k => k -> a -> EnumMap k a
mapSingleton
CTag
0
( [Mem
BX],
Symbol -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs Symbol
f
(ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Reference -> Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
Reference -> v -> Term ANormalF v -> Term ANormalF v
TShift Reference
Ty.exceptionRef Symbol
k
(ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
n Mem
BX (Lit -> ANormal Symbol
forall v. Var v => Lit -> Term ANormalF v
TLit (Lit -> ANormal Symbol) -> Lit -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$ Text -> Lit
T Text
"builtin.raise")
(ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$ POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
EROR [Symbol
n, Symbol
f]
)
gen'trace :: SuperNormal Symbol
gen'trace :: SuperNormal Symbol
gen'trace =
Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
binop0 Int
0 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
t, Symbol
v] ->
Direction Word16
-> [Symbol]
-> [Mem]
-> ANormal Symbol
-> ANormal Symbol
-> ANormal Symbol
forall v.
Var v =>
Direction Word16
-> [v]
-> [Mem]
-> Term ANormalF v
-> Term ANormalF v
-> Term ANormalF v
TLets Direction Word16
forall a. Direction a
Direct [] [] (POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
TRCE [Symbol
t, Symbol
v]) (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$
Reference -> CTag -> [Symbol] -> ANormal Symbol
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.unitRef CTag
0 []
debug'text :: SuperNormal Symbol
debug'text :: SuperNormal Symbol
debug'text =
Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
3 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
c, Symbol
r, Symbol
t, Symbol
e] ->
Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
r Mem
UN (POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
DBTX [Symbol
c])
(ANormal Symbol -> ANormal Symbol)
-> (EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Branched (ANormal Symbol) -> ANormal Symbol
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch Symbol
r
(Branched (ANormal Symbol) -> ANormal Symbol)
-> (EnumMap Word64 ([Mem], ANormal Symbol)
-> Branched (ANormal Symbol))
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], ANormal Symbol) -> Branched (ANormal Symbol)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum
(EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$ [(Word64, ([Mem], ANormal Symbol))]
-> EnumMap Word64 ([Mem], ANormal Symbol)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ (Word64
0, ([], ANormal Symbol
forall v. Var v => ANormal v
none)),
(Word64
1, ([Mem
BX], Symbol -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs Symbol
t (ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
e Mem
BX (Symbol -> ANormal Symbol
forall v. Var v => v -> ANormal v
left Symbol
t) (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$ Symbol -> ANormal Symbol
forall v. Var v => v -> ANormal v
some Symbol
e)),
(Word64
2, ([Mem
BX], Symbol -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs Symbol
t (ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
e Mem
BX (Symbol -> ANormal Symbol
forall v. Var v => v -> ANormal v
right Symbol
t) (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$ Symbol -> ANormal Symbol
forall v. Var v => v -> ANormal v
some Symbol
e))
]
code'missing :: SuperNormal Symbol
code'missing :: SuperNormal Symbol
code'missing = POp -> SuperNormal Symbol
forall v. Var v => POp -> SuperNormal v
unop POp
MISS
code'cache :: SuperNormal Symbol
code'cache :: SuperNormal Symbol
code'cache = Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
0 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
new] -> POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
CACH [Symbol
new]
code'lookup :: SuperNormal Symbol
code'lookup :: SuperNormal Symbol
code'lookup =
Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
2 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
link, Symbol
t, Symbol
r] ->
Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
t Mem
UN (POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
LKUP [Symbol
link])
(ANormal Symbol -> ANormal Symbol)
-> (EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Branched (ANormal Symbol) -> ANormal Symbol
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch Symbol
t
(Branched (ANormal Symbol) -> ANormal Symbol)
-> (EnumMap Word64 ([Mem], ANormal Symbol)
-> Branched (ANormal Symbol))
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], ANormal Symbol) -> Branched (ANormal Symbol)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum
(EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$ [(Word64, ([Mem], ANormal Symbol))]
-> EnumMap Word64 ([Mem], ANormal Symbol)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ (Word64
0, ([], ANormal Symbol
forall v. Var v => ANormal v
none)),
(Word64
1, ([Mem
BX], Symbol -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs Symbol
r (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$ Symbol -> ANormal Symbol
forall v. Var v => v -> ANormal v
some Symbol
r))
]
code'validate :: SuperNormal Symbol
code'validate :: SuperNormal Symbol
code'validate =
Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
6 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
item, Symbol
t, Symbol
ref, Symbol
msg, Symbol
extra, Symbol
any, Symbol
fail] ->
Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
t Mem
UN (POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
CVLD [Symbol
item])
(ANormal Symbol -> ANormal Symbol)
-> (EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Branched (ANormal Symbol) -> ANormal Symbol
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch Symbol
t
(Branched (ANormal Symbol) -> ANormal Symbol)
-> (EnumMap Word64 ([Mem], ANormal Symbol)
-> Branched (ANormal Symbol))
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], ANormal Symbol) -> Branched (ANormal Symbol)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum
(EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$ [(Word64, ([Mem], ANormal Symbol))]
-> EnumMap Word64 ([Mem], ANormal Symbol)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ ( Word64
1,
([Mem
BX, Mem
BX, Mem
BX],)
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ([Mem], ANormal Symbol)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Symbol] -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [Symbol
ref, Symbol
msg, Symbol
extra]
(ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
any Mem
BX (Reference -> CTag -> [Symbol] -> ANormal Symbol
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.anyRef CTag
0 [Symbol
extra])
(ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
fail Mem
BX (Reference -> CTag -> [Symbol] -> ANormal Symbol
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.failureRef CTag
0 [Symbol
ref, Symbol
msg, Symbol
any])
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> ANormal Symbol -> ([Mem], ANormal Symbol)
forall a b. (a -> b) -> a -> b
$ Symbol -> ANormal Symbol
forall v. Var v => v -> ANormal v
some Symbol
fail
),
( Word64
0,
([],) (ANormal Symbol -> ([Mem], ANormal Symbol))
-> ANormal Symbol -> ([Mem], ANormal Symbol)
forall a b. (a -> b) -> a -> b
$
ANormal Symbol
forall v. Var v => ANormal v
none
)
]
term'link'to'text :: SuperNormal Symbol
term'link'to'text :: SuperNormal Symbol
term'link'to'text =
Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
0 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
link] -> POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
TLTT [Symbol
link]
value'load :: SuperNormal Symbol
value'load :: SuperNormal Symbol
value'load =
Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
2 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
vlu, Symbol
t, Symbol
r] ->
Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
t Mem
UN (POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
LOAD [Symbol
vlu])
(ANormal Symbol -> ANormal Symbol)
-> (EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Branched (ANormal Symbol) -> ANormal Symbol
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch Symbol
t
(Branched (ANormal Symbol) -> ANormal Symbol)
-> (EnumMap Word64 ([Mem], ANormal Symbol)
-> Branched (ANormal Symbol))
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], ANormal Symbol) -> Branched (ANormal Symbol)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum
(EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$ [(Word64, ([Mem], ANormal Symbol))]
-> EnumMap Word64 ([Mem], ANormal Symbol)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ (Word64
0, ([Mem
BX], Symbol -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs Symbol
r (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$ Symbol -> ANormal Symbol
forall v. Var v => v -> ANormal v
left Symbol
r)),
(Word64
1, ([Mem
BX], Symbol -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs Symbol
r (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$ Symbol -> ANormal Symbol
forall v. Var v => v -> ANormal v
right Symbol
r))
]
value'create :: SuperNormal Symbol
value'create :: SuperNormal Symbol
value'create = Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
0 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
x] -> POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
VALU [Symbol
x]
check'sandbox :: SuperNormal Symbol
check'sandbox :: SuperNormal Symbol
check'sandbox = POp -> SuperNormal Symbol
forall v. Var v => POp -> SuperNormal v
binop POp
SDBX
sandbox'links :: SuperNormal Symbol
sandbox'links :: SuperNormal Symbol
sandbox'links = [Mem] -> ANormal Symbol -> SuperNormal Symbol
forall v. [Mem] -> ANormal v -> SuperNormal v
Lambda [Mem
BX] (ANormal Symbol -> SuperNormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> SuperNormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs Symbol
ln (ANormal Symbol -> SuperNormal Symbol)
-> ANormal Symbol -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
SDBL [Symbol
ln]
where
ln :: Symbol
ln = Symbol
forall v. Var v => v
fresh1
value'sandbox :: SuperNormal Symbol
value'sandbox :: SuperNormal Symbol
value'sandbox =
[Mem] -> ANormal Symbol -> SuperNormal Symbol
forall v. [Mem] -> ANormal v -> SuperNormal v
Lambda [Mem
BX, Mem
BX]
(ANormal Symbol -> SuperNormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> SuperNormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Symbol] -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [Symbol
refs, Symbol
val]
(ANormal Symbol -> SuperNormal Symbol)
-> ANormal Symbol -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
SDBV [Symbol
refs, Symbol
val]
where
(Symbol
refs, Symbol
val) = (Symbol, Symbol)
forall t. Fresh t => t
fresh
stm'atomic :: SuperNormal Symbol
stm'atomic :: SuperNormal Symbol
stm'atomic =
[Mem] -> ANormal Symbol -> SuperNormal Symbol
forall v. [Mem] -> ANormal v -> SuperNormal v
Lambda [Mem
BX]
(ANormal Symbol -> SuperNormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> SuperNormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs Symbol
act
(ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
unit Mem
BX (Reference -> CTag -> [Symbol] -> ANormal Symbol
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.unitRef CTag
0 [])
(ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol
-> Either Reference Symbol
-> [Symbol]
-> ANormal Symbol
-> ANormal Symbol
forall v.
Var v =>
v
-> Either Reference v -> [v] -> Term ANormalF v -> Term ANormalF v
TName Symbol
lz (Symbol -> Either Reference Symbol
forall a b. b -> Either a b
Right Symbol
act) [Symbol
unit]
(ANormal Symbol -> SuperNormal Symbol)
-> ANormal Symbol -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
ATOM [Symbol
lz]
where
(Symbol
act, Symbol
unit, Symbol
lz) = (Symbol, Symbol, Symbol)
forall t. Fresh t => t
fresh
type ForeignOp = ForeignFunc -> ([Mem], ANormal Symbol)
standard'handle :: ForeignOp
standard'handle :: ForeignOp
standard'handle ForeignFunc
instr =
([Mem
BX],)
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ([Mem], ANormal Symbol)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Symbol] -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [Symbol
h0]
(ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int
-> Symbol
-> Reference
-> Symbol
-> ANormal Symbol
-> ANormal Symbol
forall v.
Var v =>
Int -> v -> Reference -> v -> ANormal v -> ANormal v
unenum Int
3 Symbol
h0 Reference
Ty.stdHandleRef Symbol
h
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> ANormal Symbol -> ([Mem], ANormal Symbol)
forall a b. (a -> b) -> a -> b
$ ForeignFunc -> [Symbol] -> ANormal Symbol
forall v. Var v => ForeignFunc -> [v] -> Term ANormalF v
TFOp ForeignFunc
instr [Symbol
h]
where
(Symbol
h0, Symbol
h) = (Symbol, Symbol)
forall t. Fresh t => t
fresh
any'construct :: SuperNormal Symbol
any'construct :: SuperNormal Symbol
any'construct =
Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
0 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
v] ->
Reference -> CTag -> [Symbol] -> ANormal Symbol
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.anyRef CTag
0 [Symbol
v]
any'extract :: SuperNormal Symbol
=
Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
1 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$
\[Symbol
v, Symbol
v1] ->
Symbol -> Branched (ANormal Symbol) -> ANormal Symbol
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch Symbol
v (Branched (ANormal Symbol) -> ANormal Symbol)
-> Branched (ANormal Symbol) -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$
Reference
-> EnumMap CTag ([Mem], ANormal Symbol)
-> Maybe (ANormal Symbol)
-> Branched (ANormal Symbol)
forall e.
Reference -> EnumMap CTag ([Mem], e) -> Maybe e -> Branched e
MatchData Reference
Ty.anyRef (CTag
-> ([Mem], ANormal Symbol) -> EnumMap CTag ([Mem], ANormal Symbol)
forall k a. EnumKey k => k -> a -> EnumMap k a
mapSingleton CTag
0 (([Mem], ANormal Symbol) -> EnumMap CTag ([Mem], ANormal Symbol))
-> ([Mem], ANormal Symbol) -> EnumMap CTag ([Mem], ANormal Symbol)
forall a b. (a -> b) -> a -> b
$ ([Mem
BX], Symbol -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs Symbol
v1 (Symbol -> ANormal Symbol
forall v. Var v => v -> Term ANormalF v
TVar Symbol
v1))) Maybe (ANormal Symbol)
forall a. Maybe a
Nothing
ref'read :: SuperNormal Symbol
ref'read :: SuperNormal Symbol
ref'read =
Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
0 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
ref] -> (POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
REFR [Symbol
ref])
ref'write :: SuperNormal Symbol
ref'write :: SuperNormal Symbol
ref'write =
Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
binop0 Int
0 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ \[Symbol
ref, Symbol
val] -> (POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
REFW [Symbol
ref, Symbol
val])
ref'cas :: SuperNormal Symbol
ref'cas :: SuperNormal Symbol
ref'cas =
[Mem] -> ANormal Symbol -> SuperNormal Symbol
forall v. [Mem] -> ANormal v -> SuperNormal v
Lambda [Mem
BX, Mem
BX, Mem
BX]
(ANormal Symbol -> SuperNormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> SuperNormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Symbol] -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [Symbol
x, Symbol
y, Symbol
z]
(ANormal Symbol -> SuperNormal Symbol)
-> ANormal Symbol -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
RCAS [Symbol
x, Symbol
y, Symbol
z]
where
(Symbol
x, Symbol
y, Symbol
z) = (Symbol, Symbol, Symbol)
forall t. Fresh t => t
fresh
ref'ticket'read :: SuperNormal Symbol
ref'ticket'read :: SuperNormal Symbol
ref'ticket'read = Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
0 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
TIKR
ref'readForCas :: SuperNormal Symbol
ref'readForCas :: SuperNormal Symbol
ref'readForCas = Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
0 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
RRFC
ref'new :: SuperNormal Symbol
ref'new :: SuperNormal Symbol
ref'new = Int -> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall v. Var v => Int -> ([v] -> ANormal v) -> SuperNormal v
unop0 Int
0 (([Symbol] -> ANormal Symbol) -> SuperNormal Symbol)
-> ([Symbol] -> ANormal Symbol) -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
REFN
seek'handle :: ForeignOp
seek'handle :: ForeignOp
seek'handle ForeignFunc
instr =
([Mem
BX, Mem
BX, Mem
BX],)
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ([Mem], ANormal Symbol)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Symbol] -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [Symbol
arg1, Symbol
arg2, Symbol
arg3]
(ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int
-> Symbol
-> Reference
-> Symbol
-> ANormal Symbol
-> ANormal Symbol
forall v.
Var v =>
Int -> v -> Reference -> v -> ANormal v -> ANormal v
unenum Int
3 Symbol
arg2 Reference
Ty.seekModeRef Symbol
seek
(ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
result Mem
UN (ForeignFunc -> [Symbol] -> ANormal Symbol
forall v. Var v => ForeignFunc -> [v] -> Term ANormalF v
TFOp ForeignFunc
instr [Symbol
arg1, Symbol
seek, Symbol
arg3])
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> ANormal Symbol -> ([Mem], ANormal Symbol)
forall a b. (a -> b) -> a -> b
$ Symbol
-> Symbol -> Symbol -> Symbol -> Symbol -> Symbol -> ANormal Symbol
forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outIoFailUnit Symbol
stack1 Symbol
stack2 Symbol
stack3 Symbol
unit Symbol
fail Symbol
result
where
(Symbol
arg1, Symbol
arg2, Symbol
arg3, Symbol
seek, Symbol
stack1, Symbol
stack2, Symbol
stack3, Symbol
unit, Symbol
fail, Symbol
result) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol,
Symbol, Symbol)
forall t. Fresh t => t
fresh
no'buf, line'buf, block'buf, sblock'buf :: (Enum e) => e
no'buf :: forall e. Enum e => e
no'buf = Int -> e
forall a. Enum a => Int -> a
toEnum (Int -> e) -> Int -> e
forall a b. (a -> b) -> a -> b
$ Word64 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word64
Ty.bufferModeNoBufferingId
line'buf :: forall e. Enum e => e
line'buf = Int -> e
forall a. Enum a => Int -> a
toEnum (Int -> e) -> Int -> e
forall a b. (a -> b) -> a -> b
$ Word64 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word64
Ty.bufferModeLineBufferingId
block'buf :: forall e. Enum e => e
block'buf = Int -> e
forall a. Enum a => Int -> a
toEnum (Int -> e) -> Int -> e
forall a b. (a -> b) -> a -> b
$ Word64 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word64
Ty.bufferModeBlockBufferingId
sblock'buf :: forall e. Enum e => e
sblock'buf = Int -> e
forall a. Enum a => Int -> a
toEnum (Int -> e) -> Int -> e
forall a b. (a -> b) -> a -> b
$ Word64 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word64
Ty.bufferModeSizedBlockBufferingId
infixr 0 -->
(-->) :: a -> b -> (a, b)
a
x --> :: forall a b. a -> b -> (a, b)
--> b
y = (a
x, b
y)
time'zone :: ForeignOp
time'zone :: ForeignOp
time'zone ForeignFunc
instr =
([Mem
BX],)
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ([Mem], ANormal Symbol)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Symbol] -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [Symbol
secs]
(ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Direction Word16
-> [Symbol]
-> [Mem]
-> ANormal Symbol
-> ANormal Symbol
-> ANormal Symbol
forall v.
Var v =>
Direction Word16
-> [v]
-> [Mem]
-> Term ANormalF v
-> Term ANormalF v
-> Term ANormalF v
TLets Direction Word16
forall a. Direction a
Direct [Symbol
offset, Symbol
summer, Symbol
name] [Mem
UN, Mem
UN, Mem
BX] (ForeignFunc -> [Symbol] -> ANormal Symbol
forall v. Var v => ForeignFunc -> [v] -> Term ANormalF v
TFOp ForeignFunc
instr [Symbol
secs])
(ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
un Mem
BX (Reference -> CTag -> [Symbol] -> ANormal Symbol
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.unitRef CTag
0 [])
(ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
p2 Mem
BX (Reference -> CTag -> [Symbol] -> ANormal Symbol
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.pairRef CTag
0 [Symbol
name, Symbol
un])
(ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
p1 Mem
BX (Reference -> CTag -> [Symbol] -> ANormal Symbol
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.pairRef CTag
0 [Symbol
summer, Symbol
p2])
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> ANormal Symbol -> ([Mem], ANormal Symbol)
forall a b. (a -> b) -> a -> b
$ Reference -> CTag -> [Symbol] -> ANormal Symbol
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.pairRef CTag
0 [Symbol
offset, Symbol
p1]
where
(Symbol
secs, Symbol
offset, Symbol
summer, Symbol
name, Symbol
un, Symbol
p2, Symbol
p1) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol)
forall t. Fresh t => t
fresh
start'process :: ForeignOp
start'process :: ForeignOp
start'process ForeignFunc
instr =
([Mem
BX, Mem
BX],)
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ([Mem], ANormal Symbol)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Symbol] -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [Symbol
exe, Symbol
args]
(ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Direction Word16
-> [Symbol]
-> [Mem]
-> ANormal Symbol
-> ANormal Symbol
-> ANormal Symbol
forall v.
Var v =>
Direction Word16
-> [v]
-> [Mem]
-> Term ANormalF v
-> Term ANormalF v
-> Term ANormalF v
TLets Direction Word16
forall a. Direction a
Direct [Symbol
hin, Symbol
hout, Symbol
herr, Symbol
hproc] [Mem
BX, Mem
BX, Mem
BX, Mem
BX] (ForeignFunc -> [Symbol] -> ANormal Symbol
forall v. Var v => ForeignFunc -> [v] -> Term ANormalF v
TFOp ForeignFunc
instr [Symbol
exe, Symbol
args])
(ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
un Mem
BX (Reference -> CTag -> [Symbol] -> ANormal Symbol
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.unitRef CTag
0 [])
(ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
p3 Mem
BX (Reference -> CTag -> [Symbol] -> ANormal Symbol
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.pairRef CTag
0 [Symbol
hproc, Symbol
un])
(ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
p2 Mem
BX (Reference -> CTag -> [Symbol] -> ANormal Symbol
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.pairRef CTag
0 [Symbol
herr, Symbol
p3])
(ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
p1 Mem
BX (Reference -> CTag -> [Symbol] -> ANormal Symbol
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.pairRef CTag
0 [Symbol
hout, Symbol
p2])
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> ANormal Symbol -> ([Mem], ANormal Symbol)
forall a b. (a -> b) -> a -> b
$ Reference -> CTag -> [Symbol] -> ANormal Symbol
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.pairRef CTag
0 [Symbol
hin, Symbol
p1]
where
(Symbol
exe, Symbol
args, Symbol
hin, Symbol
hout, Symbol
herr, Symbol
hproc, Symbol
un, Symbol
p3, Symbol
p2, Symbol
p1) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol,
Symbol, Symbol)
forall t. Fresh t => t
fresh
set'buffering :: ForeignOp
set'buffering :: ForeignOp
set'buffering ForeignFunc
instr =
([Mem
BX, Mem
BX],)
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> (EnumMap CTag ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap CTag ([Mem], ANormal Symbol)
-> ([Mem], ANormal Symbol)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Symbol] -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [Symbol
handle, Symbol
bmode]
(ANormal Symbol -> ANormal Symbol)
-> (EnumMap CTag ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap CTag ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Branched (ANormal Symbol) -> ANormal Symbol
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch Symbol
bmode
(Branched (ANormal Symbol) -> ANormal Symbol)
-> (EnumMap CTag ([Mem], ANormal Symbol)
-> Branched (ANormal Symbol))
-> EnumMap CTag ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Reference
-> EnumMap CTag ([Mem], ANormal Symbol)
-> Branched (ANormal Symbol)
forall e. Reference -> EnumMap CTag ([Mem], e) -> Branched e
MatchDataCover Reference
Ty.bufferModeRef
(EnumMap CTag ([Mem], ANormal Symbol) -> ([Mem], ANormal Symbol))
-> EnumMap CTag ([Mem], ANormal Symbol) -> ([Mem], ANormal Symbol)
forall a b. (a -> b) -> a -> b
$ [(CTag, ([Mem], ANormal Symbol))]
-> EnumMap CTag ([Mem], ANormal Symbol)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ CTag
forall e. Enum e => e
no'buf CTag -> ([Mem], ANormal Symbol) -> (CTag, ([Mem], ANormal Symbol))
forall a b. a -> b -> (a, b)
--> [] [Mem] -> ANormal Symbol -> ([Mem], ANormal Symbol)
forall a b. a -> b -> (a, b)
--> Word64 -> ANormal Symbol
k1 Word64
forall e. Enum e => e
no'buf,
CTag
forall e. Enum e => e
line'buf CTag -> ([Mem], ANormal Symbol) -> (CTag, ([Mem], ANormal Symbol))
forall a b. a -> b -> (a, b)
--> [] [Mem] -> ANormal Symbol -> ([Mem], ANormal Symbol)
forall a b. a -> b -> (a, b)
--> Word64 -> ANormal Symbol
k1 Word64
forall e. Enum e => e
line'buf,
CTag
forall e. Enum e => e
block'buf CTag -> ([Mem], ANormal Symbol) -> (CTag, ([Mem], ANormal Symbol))
forall a b. a -> b -> (a, b)
--> [] [Mem] -> ANormal Symbol -> ([Mem], ANormal Symbol)
forall a b. a -> b -> (a, b)
--> Word64 -> ANormal Symbol
k1 Word64
forall e. Enum e => e
block'buf,
CTag
forall e. Enum e => e
sblock'buf
CTag -> ([Mem], ANormal Symbol) -> (CTag, ([Mem], ANormal Symbol))
forall a b. a -> b -> (a, b)
--> [Mem
BX]
[Mem] -> ANormal Symbol -> ([Mem], ANormal Symbol)
forall a b. a -> b -> (a, b)
--> Symbol -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs Symbol
n
(ANormal Symbol -> ANormal Symbol)
-> (EnumMap CTag ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap CTag ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Branched (ANormal Symbol) -> ANormal Symbol
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch Symbol
n
(Branched (ANormal Symbol) -> ANormal Symbol)
-> (EnumMap CTag ([Mem], ANormal Symbol)
-> Branched (ANormal Symbol))
-> EnumMap CTag ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Reference
-> EnumMap CTag ([Mem], ANormal Symbol)
-> Branched (ANormal Symbol)
forall e. Reference -> EnumMap CTag ([Mem], e) -> Branched e
MatchDataCover Reference
Ty.bufferModeRef
(EnumMap CTag ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap CTag ([Mem], ANormal Symbol) -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$ [(CTag, ([Mem], ANormal Symbol))]
-> EnumMap CTag ([Mem], ANormal Symbol)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ CTag
0
CTag -> ([Mem], ANormal Symbol) -> (CTag, ([Mem], ANormal Symbol))
forall a b. a -> b -> (a, b)
--> [Mem
UN]
[Mem] -> ANormal Symbol -> ([Mem], ANormal Symbol)
forall a b. a -> b -> (a, b)
--> Symbol -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs Symbol
w
(ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
tag Mem
UN (Lit -> ANormal Symbol
forall v. Var v => Lit -> Term ANormalF v
TLit (Word64 -> Lit
N Word64
forall e. Enum e => e
sblock'buf))
(ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$ [Symbol] -> ANormal Symbol
k2 [Symbol
tag, Symbol
w]
]
]
where
k1 :: Word64 -> ANormal Symbol
k1 Word64
num =
Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
tag Mem
UN (Lit -> ANormal Symbol
forall v. Var v => Lit -> Term ANormalF v
TLit (Word64 -> Lit
N Word64
num)) (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$
[Symbol] -> ANormal Symbol
k2 [Symbol
tag]
k2 :: [Symbol] -> ANormal Symbol
k2 [Symbol]
args =
Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
r Mem
UN (ForeignFunc -> [Symbol] -> ANormal Symbol
forall v. Var v => ForeignFunc -> [v] -> Term ANormalF v
TFOp ForeignFunc
instr (Symbol
handle Symbol -> [Symbol] -> [Symbol]
forall a. a -> [a] -> [a]
: [Symbol]
args)) (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$
Symbol
-> Symbol -> Symbol -> Symbol -> Symbol -> Symbol -> ANormal Symbol
forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outIoFailUnit Symbol
s1 Symbol
s2 Symbol
s3 Symbol
u Symbol
f Symbol
r
(Symbol
handle, Symbol
bmode, Symbol
tag, Symbol
n, Symbol
w, Symbol
s1, Symbol
s2, Symbol
s3, Symbol
u, Symbol
f, Symbol
r) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol,
Symbol, Symbol, Symbol)
forall t. Fresh t => t
fresh
get'buffering'output :: forall v. (Var v) => v -> v -> v -> v -> v -> v -> v -> v -> ANormal v
get'buffering'output :: forall v.
Var v =>
v -> v -> v -> v -> v -> v -> v -> v -> ANormal v
get'buffering'output v
eitherResult v
stack1 v
stack2 v
stack3 v
resultTag v
anyVar v
failVar v
successVar =
v -> Branched (Term ANormalF v) -> Term ANormalF v
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch v
eitherResult (Branched (Term ANormalF v) -> Term ANormalF v)
-> (EnumMap Word64 ([Mem], Term ANormalF v)
-> Branched (Term ANormalF v))
-> EnumMap Word64 ([Mem], Term ANormalF v)
-> Term ANormalF v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], Term ANormalF v)
-> Branched (Term ANormalF v)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum (EnumMap Word64 ([Mem], Term ANormalF v) -> Term ANormalF v)
-> EnumMap Word64 ([Mem], Term ANormalF v) -> Term ANormalF v
forall a b. (a -> b) -> a -> b
$
[(Word64, ([Mem], Term ANormalF v))]
-> EnumMap Word64 ([Mem], Term ANormalF v)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ v -> v -> v -> v -> v -> (Word64, ([Mem], Term ANormalF v))
forall v.
Var v =>
v -> v -> v -> v -> v -> (Word64, ([Mem], ANormal v))
failureCase v
stack1 v
stack2 v
stack3 v
anyVar v
failVar,
( Word64
1,
([Mem
UN],)
(Term ANormalF v -> ([Mem], Term ANormalF v))
-> (EnumMap Word64 ([Mem], Term ANormalF v) -> Term ANormalF v)
-> EnumMap Word64 ([Mem], Term ANormalF v)
-> ([Mem], Term ANormalF v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Term ANormalF v -> Term ANormalF v
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs v
resultTag
(Term ANormalF v -> Term ANormalF v)
-> (EnumMap Word64 ([Mem], Term ANormalF v) -> Term ANormalF v)
-> EnumMap Word64 ([Mem], Term ANormalF v)
-> Term ANormalF v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Branched (Term ANormalF v) -> Term ANormalF v
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch v
resultTag
(Branched (Term ANormalF v) -> Term ANormalF v)
-> (EnumMap Word64 ([Mem], Term ANormalF v)
-> Branched (Term ANormalF v))
-> EnumMap Word64 ([Mem], Term ANormalF v)
-> Term ANormalF v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], Term ANormalF v)
-> Branched (Term ANormalF v)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum
(EnumMap Word64 ([Mem], Term ANormalF v)
-> ([Mem], Term ANormalF v))
-> EnumMap Word64 ([Mem], Term ANormalF v)
-> ([Mem], Term ANormalF v)
forall a b. (a -> b) -> a -> b
$ [(Word64, ([Mem], Term ANormalF v))]
-> EnumMap Word64 ([Mem], Term ANormalF v)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ Word64
forall e. Enum e => e
no'buf
Word64
-> ([Mem], Term ANormalF v) -> (Word64, ([Mem], Term ANormalF v))
forall a b. a -> b -> (a, b)
--> []
[Mem] -> Term ANormalF v -> ([Mem], Term ANormalF v)
forall a b. a -> b -> (a, b)
--> v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
successVar Mem
BX (Reference -> CTag -> [v] -> Term ANormalF v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.bufferModeRef CTag
forall e. Enum e => e
no'buf [])
(Term ANormalF v -> Term ANormalF v)
-> Term ANormalF v -> Term ANormalF v
forall a b. (a -> b) -> a -> b
$ v -> Term ANormalF v
forall v. Var v => v -> ANormal v
right v
successVar,
Word64
forall e. Enum e => e
line'buf
Word64
-> ([Mem], Term ANormalF v) -> (Word64, ([Mem], Term ANormalF v))
forall a b. a -> b -> (a, b)
--> []
[Mem] -> Term ANormalF v -> ([Mem], Term ANormalF v)
forall a b. a -> b -> (a, b)
--> v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
successVar Mem
BX (Reference -> CTag -> [v] -> Term ANormalF v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.bufferModeRef CTag
forall e. Enum e => e
line'buf [])
(Term ANormalF v -> Term ANormalF v)
-> Term ANormalF v -> Term ANormalF v
forall a b. (a -> b) -> a -> b
$ v -> Term ANormalF v
forall v. Var v => v -> ANormal v
right v
successVar,
Word64
forall e. Enum e => e
block'buf
Word64
-> ([Mem], Term ANormalF v) -> (Word64, ([Mem], Term ANormalF v))
forall a b. a -> b -> (a, b)
--> []
[Mem] -> Term ANormalF v -> ([Mem], Term ANormalF v)
forall a b. a -> b -> (a, b)
--> v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
successVar Mem
BX (Reference -> CTag -> [v] -> Term ANormalF v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.bufferModeRef CTag
forall e. Enum e => e
block'buf [])
(Term ANormalF v -> Term ANormalF v)
-> Term ANormalF v -> Term ANormalF v
forall a b. (a -> b) -> a -> b
$ v -> Term ANormalF v
forall v. Var v => v -> ANormal v
right v
successVar,
Word64
forall e. Enum e => e
sblock'buf
Word64
-> ([Mem], Term ANormalF v) -> (Word64, ([Mem], Term ANormalF v))
forall a b. a -> b -> (a, b)
--> [Mem
UN]
[Mem] -> Term ANormalF v -> ([Mem], Term ANormalF v)
forall a b. a -> b -> (a, b)
--> v -> Term ANormalF v -> Term ANormalF v
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs v
stack1
(Term ANormalF v -> Term ANormalF v)
-> (Term ANormalF v -> Term ANormalF v)
-> Term ANormalF v
-> Term ANormalF v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
successVar Mem
BX (Reference -> CTag -> [v] -> Term ANormalF v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.bufferModeRef CTag
forall e. Enum e => e
sblock'buf [v
stack1])
(Term ANormalF v -> Term ANormalF v)
-> Term ANormalF v -> Term ANormalF v
forall a b. (a -> b) -> a -> b
$ v -> Term ANormalF v
forall v. Var v => v -> ANormal v
right v
successVar
]
)
]
get'buffering :: ForeignOp
get'buffering :: ForeignOp
get'buffering =
Symbol -> Symbol -> ANormal Symbol -> ForeignOp
forall v.
Var v =>
v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
in1 Symbol
arg1 Symbol
eitherResult (ANormal Symbol -> ForeignOp) -> ANormal Symbol -> ForeignOp
forall a b. (a -> b) -> a -> b
$
Symbol
-> Symbol
-> Symbol
-> Symbol
-> Symbol
-> Symbol
-> Symbol
-> Symbol
-> ANormal Symbol
forall v.
Var v =>
v -> v -> v -> v -> v -> v -> v -> v -> ANormal v
get'buffering'output Symbol
eitherResult Symbol
n Symbol
n2 Symbol
n3 Symbol
resultTag Symbol
anyVar Symbol
failVar Symbol
successVar
where
(Symbol
arg1, Symbol
eitherResult, Symbol
n, Symbol
n2, Symbol
n3, Symbol
resultTag, Symbol
anyVar, Symbol
failVar, Symbol
successVar) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol,
Symbol)
forall t. Fresh t => t
fresh
crypto'hash :: ForeignOp
crypto'hash :: ForeignOp
crypto'hash ForeignFunc
instr =
([Mem
BX, Mem
BX],)
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ([Mem], ANormal Symbol)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Symbol] -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [Symbol
alg, Symbol
x]
(ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
vl Mem
BX (POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
VALU [Symbol
x])
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> ANormal Symbol -> ([Mem], ANormal Symbol)
forall a b. (a -> b) -> a -> b
$ ForeignFunc -> [Symbol] -> ANormal Symbol
forall v. Var v => ForeignFunc -> [v] -> Term ANormalF v
TFOp ForeignFunc
instr [Symbol
alg, Symbol
vl]
where
(Symbol
alg, Symbol
x, Symbol
vl) = (Symbol, Symbol, Symbol)
forall t. Fresh t => t
fresh
murmur'hash :: ForeignOp
murmur'hash :: ForeignOp
murmur'hash ForeignFunc
instr =
([Mem
BX],)
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ([Mem], ANormal Symbol)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Symbol] -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [Symbol
x]
(ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
vl Mem
BX (POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
VALU [Symbol
x])
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> ANormal Symbol -> ([Mem], ANormal Symbol)
forall a b. (a -> b) -> a -> b
$ ForeignFunc -> [Symbol] -> ANormal Symbol
forall v. Var v => ForeignFunc -> [v] -> Term ANormalF v
TFOp ForeignFunc
instr [Symbol
vl]
where
(Symbol
x, Symbol
vl) = (Symbol, Symbol)
forall t. Fresh t => t
fresh
crypto'hmac :: ForeignOp
crypto'hmac :: ForeignOp
crypto'hmac ForeignFunc
instr =
([Mem
BX, Mem
BX, Mem
BX],)
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ([Mem], ANormal Symbol)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Symbol] -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [Symbol
alg, Symbol
by, Symbol
x]
(ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
vl Mem
BX (POp -> [Symbol] -> ANormal Symbol
forall v. Var v => POp -> [v] -> Term ANormalF v
TPrm POp
VALU [Symbol
x])
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> ANormal Symbol -> ([Mem], ANormal Symbol)
forall a b. (a -> b) -> a -> b
$ ForeignFunc -> [Symbol] -> ANormal Symbol
forall v. Var v => ForeignFunc -> [v] -> Term ANormalF v
TFOp ForeignFunc
instr [Symbol
alg, Symbol
by, Symbol
vl]
where
(Symbol
alg, Symbol
by, Symbol
x, Symbol
vl) = (Symbol, Symbol, Symbol, Symbol)
forall t. Fresh t => t
fresh
inUnit :: forall v. (Var v) => v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
inUnit :: forall v.
Var v =>
v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
inUnit v
unit v
result ANormal v
cont ForeignFunc
instr =
([Mem
BX], v -> ANormal v -> ANormal v
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs v
unit (ANormal v -> ANormal v) -> ANormal v -> ANormal v
forall a b. (a -> b) -> a -> b
$ v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
result Mem
UN (ForeignFunc -> [v] -> ANormal v
forall v. Var v => ForeignFunc -> [v] -> Term ANormalF v
TFOp ForeignFunc
instr []) ANormal v
cont)
inN :: forall v. (Var v) => [v] -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
inN :: forall v.
Var v =>
[v] -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
inN [v]
args v
result ANormal v
cont ForeignFunc
instr =
([v]
args [v] -> Mem -> [Mem]
forall (f :: * -> *) a b. Functor f => f a -> b -> f b
$> Mem
BX,)
(ANormal v -> ([Mem], ANormal v))
-> (ANormal v -> ANormal v) -> ANormal v -> ([Mem], ANormal v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [v] -> ANormal v -> ANormal v
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [v]
args
(ANormal v -> ([Mem], ANormal v))
-> ANormal v -> ([Mem], ANormal v)
forall a b. (a -> b) -> a -> b
$ v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
result Mem
UN (ForeignFunc -> [v] -> ANormal v
forall v. Var v => ForeignFunc -> [v] -> Term ANormalF v
TFOp ForeignFunc
instr [v]
args) ANormal v
cont
in1 :: forall v. (Var v) => v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
in1 :: forall v.
Var v =>
v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
in1 v
arg v
result ANormal v
cont ForeignFunc
instr = [v] -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
forall v.
Var v =>
[v] -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
inN [v
arg] v
result ANormal v
cont ForeignFunc
instr
in2 :: forall v. (Var v) => v -> v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
in2 :: forall v.
Var v =>
v -> v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
in2 v
arg1 v
arg2 v
result ANormal v
cont ForeignFunc
instr = [v] -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
forall v.
Var v =>
[v] -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
inN [v
arg1, v
arg2] v
result ANormal v
cont ForeignFunc
instr
in3 :: forall v. (Var v) => v -> v -> v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
in3 :: forall v.
Var v =>
v -> v -> v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
in3 v
arg1 v
arg2 v
arg3 v
result ANormal v
cont ForeignFunc
instr = [v] -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
forall v.
Var v =>
[v] -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
inN [v
arg1, v
arg2, v
arg3] v
result ANormal v
cont ForeignFunc
instr
inMaybeBx :: forall v. (Var v) => v -> v -> v -> v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
inMaybeBx :: forall v.
Var v =>
v
-> v
-> v
-> v
-> v
-> ANormal v
-> ForeignFunc
-> ([Mem], ANormal v)
inMaybeBx v
arg1 v
arg2 v
arg3 v
mb v
result ANormal v
cont ForeignFunc
instr =
([Mem
BX, Mem
BX],)
(ANormal v -> ([Mem], ANormal v))
-> (EnumMap CTag ([Mem], ANormal v) -> ANormal v)
-> EnumMap CTag ([Mem], ANormal v)
-> ([Mem], ANormal v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [v] -> ANormal v -> ANormal v
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [v
arg1, v
arg2]
(ANormal v -> ANormal v)
-> (EnumMap CTag ([Mem], ANormal v) -> ANormal v)
-> EnumMap CTag ([Mem], ANormal v)
-> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Branched (ANormal v) -> ANormal v
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch v
arg1
(Branched (ANormal v) -> ANormal v)
-> (EnumMap CTag ([Mem], ANormal v) -> Branched (ANormal v))
-> EnumMap CTag ([Mem], ANormal v)
-> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (EnumMap CTag ([Mem], ANormal v)
-> Maybe (ANormal v) -> Branched (ANormal v))
-> Maybe (ANormal v)
-> EnumMap CTag ([Mem], ANormal v)
-> Branched (ANormal v)
forall a b c. (a -> b -> c) -> b -> a -> c
flip (Reference
-> EnumMap CTag ([Mem], ANormal v)
-> Maybe (ANormal v)
-> Branched (ANormal v)
forall e.
Reference -> EnumMap CTag ([Mem], e) -> Maybe e -> Branched e
MatchData Reference
Ty.optionalRef) Maybe (ANormal v)
forall a. Maybe a
Nothing
(EnumMap CTag ([Mem], ANormal v) -> ([Mem], ANormal v))
-> EnumMap CTag ([Mem], ANormal v) -> ([Mem], ANormal v)
forall a b. (a -> b) -> a -> b
$ [(CTag, ([Mem], ANormal v))] -> EnumMap CTag ([Mem], ANormal v)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ ( Word64 -> CTag
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word64
Ty.noneId,
( [],
v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
mb Mem
UN (Lit -> ANormal v
forall v. Var v => Lit -> Term ANormalF v
TLit (Lit -> ANormal v) -> Lit -> ANormal v
forall a b. (a -> b) -> a -> b
$ Int64 -> Lit
I Int64
0) (ANormal v -> ANormal v) -> ANormal v -> ANormal v
forall a b. (a -> b) -> a -> b
$
v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
result Mem
UN (ForeignFunc -> [v] -> ANormal v
forall v. Var v => ForeignFunc -> [v] -> Term ANormalF v
TFOp ForeignFunc
instr [v
mb, v
arg2]) ANormal v
cont
)
),
(Word64 -> CTag
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word64
Ty.someId, ([Mem
BX], v -> ANormal v -> ANormal v
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs v
arg3 (ANormal v -> ANormal v)
-> (ANormal v -> ANormal v) -> ANormal v -> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
mb Mem
UN (Lit -> ANormal v
forall v. Var v => Lit -> Term ANormalF v
TLit (Lit -> ANormal v) -> Lit -> ANormal v
forall a b. (a -> b) -> a -> b
$ Int64 -> Lit
I Int64
1) (ANormal v -> ANormal v) -> ANormal v -> ANormal v
forall a b. (a -> b) -> a -> b
$ v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
result Mem
UN (ForeignFunc -> [v] -> ANormal v
forall v. Var v => ForeignFunc -> [v] -> Term ANormalF v
TFOp ForeignFunc
instr [v
mb, v
arg3, v
arg2]) ANormal v
cont))
]
set'echo :: ForeignOp
set'echo :: ForeignOp
set'echo ForeignFunc
instr =
([Mem
BX, Mem
BX],)
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ([Mem], ANormal Symbol)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Symbol] -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [Symbol
arg1, Symbol
arg2]
(ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
result Mem
UN (ForeignFunc -> [Symbol] -> ANormal Symbol
forall v. Var v => ForeignFunc -> [v] -> Term ANormalF v
TFOp ForeignFunc
instr [Symbol
arg1, Symbol
arg2])
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> ANormal Symbol -> ([Mem], ANormal Symbol)
forall a b. (a -> b) -> a -> b
$ Symbol
-> Symbol -> Symbol -> Symbol -> Symbol -> Symbol -> ANormal Symbol
forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outIoFailUnit Symbol
stack1 Symbol
stack2 Symbol
stack3 Symbol
unit Symbol
fail Symbol
result
where
(Symbol
arg1, Symbol
arg2, Symbol
stack1, Symbol
stack2, Symbol
stack3, Symbol
unit, Symbol
fail, Symbol
result) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol)
forall t. Fresh t => t
fresh
inIomr :: forall v. (Var v) => v -> v -> v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
inIomr :: forall v.
Var v =>
v -> v -> v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
inIomr v
arg1 v
arg2 v
fm v
result ANormal v
cont ForeignFunc
instr =
([Mem
BX, Mem
BX],)
(ANormal v -> ([Mem], ANormal v))
-> (ANormal v -> ANormal v) -> ANormal v -> ([Mem], ANormal v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [v] -> ANormal v -> ANormal v
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [v
arg1, v
arg2]
(ANormal v -> ANormal v)
-> (ANormal v -> ANormal v) -> ANormal v -> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> v -> Reference -> v -> ANormal v -> ANormal v
forall v.
Var v =>
Int -> v -> Reference -> v -> ANormal v -> ANormal v
unenum Int
4 v
arg2 Reference
Ty.fileModeRef v
fm
(ANormal v -> ([Mem], ANormal v))
-> ANormal v -> ([Mem], ANormal v)
forall a b. (a -> b) -> a -> b
$ v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
result Mem
UN (ForeignFunc -> [v] -> ANormal v
forall v. Var v => ForeignFunc -> [v] -> Term ANormalF v
TFOp ForeignFunc
instr [v
arg1, v
fm]) ANormal v
cont
outMaybe :: forall v. (Var v) => v -> v -> ANormal v
outMaybe :: forall v. Var v => v -> v -> ANormal v
outMaybe v
tag v
result =
v -> Branched (Term ANormalF v) -> Term ANormalF v
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch v
tag (Branched (Term ANormalF v) -> Term ANormalF v)
-> (EnumMap Word64 ([Mem], Term ANormalF v)
-> Branched (Term ANormalF v))
-> EnumMap Word64 ([Mem], Term ANormalF v)
-> Term ANormalF v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], Term ANormalF v)
-> Branched (Term ANormalF v)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum (EnumMap Word64 ([Mem], Term ANormalF v) -> Term ANormalF v)
-> EnumMap Word64 ([Mem], Term ANormalF v) -> Term ANormalF v
forall a b. (a -> b) -> a -> b
$
[(Word64, ([Mem], Term ANormalF v))]
-> EnumMap Word64 ([Mem], Term ANormalF v)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ (Word64
0, ([], Term ANormalF v
forall v. Var v => ANormal v
none)),
(Word64
1, ([Mem
BX], v -> Term ANormalF v -> Term ANormalF v
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs v
result (Term ANormalF v -> Term ANormalF v)
-> Term ANormalF v -> Term ANormalF v
forall a b. (a -> b) -> a -> b
$ v -> Term ANormalF v
forall v. Var v => v -> ANormal v
some v
result))
]
outMaybeNTup :: forall v. (Var v) => v -> v -> v -> v -> v -> v -> ANormal v
outMaybeNTup :: forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outMaybeNTup v
a v
b v
u v
bp v
p v
result =
v -> Branched (Term ANormalF v) -> Term ANormalF v
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch v
result (Branched (Term ANormalF v) -> Term ANormalF v)
-> (EnumMap Word64 ([Mem], Term ANormalF v)
-> Branched (Term ANormalF v))
-> EnumMap Word64 ([Mem], Term ANormalF v)
-> Term ANormalF v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], Term ANormalF v)
-> Branched (Term ANormalF v)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum (EnumMap Word64 ([Mem], Term ANormalF v) -> Term ANormalF v)
-> EnumMap Word64 ([Mem], Term ANormalF v) -> Term ANormalF v
forall a b. (a -> b) -> a -> b
$
[(Word64, ([Mem], Term ANormalF v))]
-> EnumMap Word64 ([Mem], Term ANormalF v)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ (Word64
0, ([], Term ANormalF v
forall v. Var v => ANormal v
none)),
( Word64
1,
( [Mem
UN, Mem
BX],
[v] -> Term ANormalF v -> Term ANormalF v
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [v
a, v
b]
(Term ANormalF v -> Term ANormalF v)
-> (Term ANormalF v -> Term ANormalF v)
-> Term ANormalF v
-> Term ANormalF v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
u Mem
BX (Reference -> CTag -> [v] -> Term ANormalF v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.unitRef CTag
0 [])
(Term ANormalF v -> Term ANormalF v)
-> (Term ANormalF v -> Term ANormalF v)
-> Term ANormalF v
-> Term ANormalF v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
bp Mem
BX (Reference -> CTag -> [v] -> Term ANormalF v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.pairRef CTag
0 [v
b, v
u])
(Term ANormalF v -> Term ANormalF v)
-> (Term ANormalF v -> Term ANormalF v)
-> Term ANormalF v
-> Term ANormalF v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
p Mem
BX (Reference -> CTag -> [v] -> Term ANormalF v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.pairRef CTag
0 [v
a, v
bp])
(Term ANormalF v -> Term ANormalF v)
-> Term ANormalF v -> Term ANormalF v
forall a b. (a -> b) -> a -> b
$ v -> Term ANormalF v
forall v. Var v => v -> ANormal v
some v
p
)
)
]
outMaybeTup :: (Var v) => v -> v -> v -> v -> v -> v -> ANormal v
outMaybeTup :: forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outMaybeTup v
a v
b v
u v
bp v
ap v
result =
v -> Branched (Term ANormalF v) -> Term ANormalF v
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch v
result (Branched (Term ANormalF v) -> Term ANormalF v)
-> (EnumMap Word64 ([Mem], Term ANormalF v)
-> Branched (Term ANormalF v))
-> EnumMap Word64 ([Mem], Term ANormalF v)
-> Term ANormalF v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], Term ANormalF v)
-> Branched (Term ANormalF v)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum (EnumMap Word64 ([Mem], Term ANormalF v) -> Term ANormalF v)
-> EnumMap Word64 ([Mem], Term ANormalF v) -> Term ANormalF v
forall a b. (a -> b) -> a -> b
$
[(Word64, ([Mem], Term ANormalF v))]
-> EnumMap Word64 ([Mem], Term ANormalF v)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ (Word64
0, ([], Term ANormalF v
forall v. Var v => ANormal v
none)),
( Word64
1,
( [Mem
BX, Mem
BX],
[v] -> Term ANormalF v -> Term ANormalF v
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [v
a, v
b]
(Term ANormalF v -> Term ANormalF v)
-> (Term ANormalF v -> Term ANormalF v)
-> Term ANormalF v
-> Term ANormalF v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
u Mem
BX (Reference -> CTag -> [v] -> Term ANormalF v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.unitRef CTag
0 [])
(Term ANormalF v -> Term ANormalF v)
-> (Term ANormalF v -> Term ANormalF v)
-> Term ANormalF v
-> Term ANormalF v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
bp Mem
BX (Reference -> CTag -> [v] -> Term ANormalF v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.pairRef CTag
0 [v
b, v
u])
(Term ANormalF v -> Term ANormalF v)
-> (Term ANormalF v -> Term ANormalF v)
-> Term ANormalF v
-> Term ANormalF v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
ap Mem
BX (Reference -> CTag -> [v] -> Term ANormalF v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.pairRef CTag
0 [v
a, v
bp])
(Term ANormalF v -> Term ANormalF v)
-> Term ANormalF v -> Term ANormalF v
forall a b. (a -> b) -> a -> b
$ v -> Term ANormalF v
forall v. Var v => v -> ANormal v
some v
ap
)
)
]
outIoFail :: forall v. (Var v) => v -> v -> v -> v -> v -> v -> ANormal v
outIoFail :: forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outIoFail v
stack1 v
stack2 v
stack3 v
any v
fail v
result =
v -> Branched (Term ANormalF v) -> Term ANormalF v
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch v
result (Branched (Term ANormalF v) -> Term ANormalF v)
-> (EnumMap Word64 ([Mem], Term ANormalF v)
-> Branched (Term ANormalF v))
-> EnumMap Word64 ([Mem], Term ANormalF v)
-> Term ANormalF v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], Term ANormalF v)
-> Branched (Term ANormalF v)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum (EnumMap Word64 ([Mem], Term ANormalF v) -> Term ANormalF v)
-> EnumMap Word64 ([Mem], Term ANormalF v) -> Term ANormalF v
forall a b. (a -> b) -> a -> b
$
[(Word64, ([Mem], Term ANormalF v))]
-> EnumMap Word64 ([Mem], Term ANormalF v)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ v -> v -> v -> v -> v -> (Word64, ([Mem], Term ANormalF v))
forall v.
Var v =>
v -> v -> v -> v -> v -> (Word64, ([Mem], ANormal v))
failureCase v
stack1 v
stack2 v
stack3 v
any v
fail,
(Word64
1, ([Mem
BX], v -> Term ANormalF v -> Term ANormalF v
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs v
stack1 (Term ANormalF v -> Term ANormalF v)
-> Term ANormalF v -> Term ANormalF v
forall a b. (a -> b) -> a -> b
$ v -> Term ANormalF v
forall v. Var v => v -> ANormal v
right v
stack1))
]
outIoFailChar :: forall v. (Var v) => v -> v -> v -> v -> v -> v -> ANormal v
outIoFailChar :: forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outIoFailChar v
stack1 v
stack2 v
stack3 v
fail v
extra v
result =
v -> Branched (Term ANormalF v) -> Term ANormalF v
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch v
result (Branched (Term ANormalF v) -> Term ANormalF v)
-> (EnumMap Word64 ([Mem], Term ANormalF v)
-> Branched (Term ANormalF v))
-> EnumMap Word64 ([Mem], Term ANormalF v)
-> Term ANormalF v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], Term ANormalF v)
-> Branched (Term ANormalF v)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum (EnumMap Word64 ([Mem], Term ANormalF v) -> Term ANormalF v)
-> EnumMap Word64 ([Mem], Term ANormalF v) -> Term ANormalF v
forall a b. (a -> b) -> a -> b
$
[(Word64, ([Mem], Term ANormalF v))]
-> EnumMap Word64 ([Mem], Term ANormalF v)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ v -> v -> v -> v -> v -> (Word64, ([Mem], Term ANormalF v))
forall v.
Var v =>
v -> v -> v -> v -> v -> (Word64, ([Mem], ANormal v))
failureCase v
stack1 v
stack2 v
stack3 v
extra v
fail,
( Word64
1,
([Mem
UN],)
(Term ANormalF v -> ([Mem], Term ANormalF v))
-> (Term ANormalF v -> Term ANormalF v)
-> Term ANormalF v
-> ([Mem], Term ANormalF v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Term ANormalF v -> Term ANormalF v
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs v
extra
(Term ANormalF v -> ([Mem], Term ANormalF v))
-> Term ANormalF v -> ([Mem], Term ANormalF v)
forall a b. (a -> b) -> a -> b
$ v -> Term ANormalF v
forall v. Var v => v -> ANormal v
right v
extra
)
]
failureCase ::
(Var v) => v -> v -> v -> v -> v -> (Word64, ([Mem], ANormal v))
failureCase :: forall v.
Var v =>
v -> v -> v -> v -> v -> (Word64, ([Mem], ANormal v))
failureCase v
stack1 v
stack2 v
stack3 v
any v
fail =
(Word64
0,)
(([Mem], ANormal v) -> (Word64, ([Mem], ANormal v)))
-> (ANormal v -> ([Mem], ANormal v))
-> ANormal v
-> (Word64, ([Mem], ANormal v))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Mem
BX, Mem
BX, Mem
BX],)
(ANormal v -> ([Mem], ANormal v))
-> (ANormal v -> ANormal v) -> ANormal v -> ([Mem], ANormal v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [v] -> ANormal v -> ANormal v
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [v
stack1, v
stack2, v
stack3]
(ANormal v -> ANormal v)
-> (ANormal v -> ANormal v) -> ANormal v -> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
any Mem
BX (Reference -> CTag -> [v] -> ANormal v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.anyRef CTag
0 [v
stack3])
(ANormal v -> ANormal v)
-> (ANormal v -> ANormal v) -> ANormal v -> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
fail Mem
BX (Reference -> CTag -> [v] -> ANormal v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.failureRef CTag
0 [v
stack1, v
stack2, v
any])
(ANormal v -> (Word64, ([Mem], ANormal v)))
-> ANormal v -> (Word64, ([Mem], ANormal v))
forall a b. (a -> b) -> a -> b
$ v -> ANormal v
forall v. Var v => v -> ANormal v
left v
fail
exnCase ::
(Var v) => v -> v -> v -> v -> v -> (Word64, ([Mem], ANormal v))
exnCase :: forall v.
Var v =>
v -> v -> v -> v -> v -> (Word64, ([Mem], ANormal v))
exnCase v
stack1 v
stack2 v
stack3 v
any v
fail =
(Word64
0,)
(([Mem], ANormal v) -> (Word64, ([Mem], ANormal v)))
-> (ANormal v -> ([Mem], ANormal v))
-> ANormal v
-> (Word64, ([Mem], ANormal v))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Mem
BX, Mem
BX, Mem
BX],)
(ANormal v -> ([Mem], ANormal v))
-> (ANormal v -> ANormal v) -> ANormal v -> ([Mem], ANormal v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [v] -> ANormal v -> ANormal v
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [v
stack1, v
stack2, v
stack3]
(ANormal v -> ANormal v)
-> (ANormal v -> ANormal v) -> ANormal v -> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
any Mem
BX (Reference -> CTag -> [v] -> ANormal v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.anyRef CTag
0 [v
stack3])
(ANormal v -> ANormal v)
-> (ANormal v -> ANormal v) -> ANormal v -> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
fail Mem
BX (Reference -> CTag -> [v] -> ANormal v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.failureRef CTag
0 [v
stack1, v
stack2, v
any])
(ANormal v -> (Word64, ([Mem], ANormal v)))
-> ANormal v -> (Word64, ([Mem], ANormal v))
forall a b. (a -> b) -> a -> b
$ Reference -> CTag -> [v] -> ANormal v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TReq Reference
Ty.exceptionRef CTag
0 [v
fail]
outIoExnUnit ::
forall v. (Var v) => v -> v -> v -> v -> v -> v -> ANormal v
outIoExnUnit :: forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outIoExnUnit v
stack1 v
stack2 v
stack3 v
any v
fail v
result =
v -> Branched (Term ANormalF v) -> Term ANormalF v
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch v
result (Branched (Term ANormalF v) -> Term ANormalF v)
-> (EnumMap Word64 ([Mem], Term ANormalF v)
-> Branched (Term ANormalF v))
-> EnumMap Word64 ([Mem], Term ANormalF v)
-> Term ANormalF v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], Term ANormalF v)
-> Branched (Term ANormalF v)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum (EnumMap Word64 ([Mem], Term ANormalF v) -> Term ANormalF v)
-> EnumMap Word64 ([Mem], Term ANormalF v) -> Term ANormalF v
forall a b. (a -> b) -> a -> b
$
[(Word64, ([Mem], Term ANormalF v))]
-> EnumMap Word64 ([Mem], Term ANormalF v)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ v -> v -> v -> v -> v -> (Word64, ([Mem], Term ANormalF v))
forall v.
Var v =>
v -> v -> v -> v -> v -> (Word64, ([Mem], ANormal v))
exnCase v
stack1 v
stack2 v
stack3 v
any v
fail,
(Word64
1, ([], Reference -> CTag -> [v] -> Term ANormalF v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.unitRef CTag
0 []))
]
outIoExn ::
(Var v) => v -> v -> v -> v -> v -> v -> ANormal v
outIoExn :: forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outIoExn v
stack1 v
stack2 v
stack3 v
any v
fail v
result =
v -> Branched (Term ANormalF v) -> Term ANormalF v
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch v
result (Branched (Term ANormalF v) -> Term ANormalF v)
-> (EnumMap Word64 ([Mem], Term ANormalF v)
-> Branched (Term ANormalF v))
-> EnumMap Word64 ([Mem], Term ANormalF v)
-> Term ANormalF v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], Term ANormalF v)
-> Branched (Term ANormalF v)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum (EnumMap Word64 ([Mem], Term ANormalF v) -> Term ANormalF v)
-> EnumMap Word64 ([Mem], Term ANormalF v) -> Term ANormalF v
forall a b. (a -> b) -> a -> b
$
[(Word64, ([Mem], Term ANormalF v))]
-> EnumMap Word64 ([Mem], Term ANormalF v)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ v -> v -> v -> v -> v -> (Word64, ([Mem], Term ANormalF v))
forall v.
Var v =>
v -> v -> v -> v -> v -> (Word64, ([Mem], ANormal v))
exnCase v
stack1 v
stack2 v
stack3 v
any v
fail,
(Word64
1, ([Mem
BX], v -> Term ANormalF v -> Term ANormalF v
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs v
stack1 (Term ANormalF v -> Term ANormalF v)
-> Term ANormalF v -> Term ANormalF v
forall a b. (a -> b) -> a -> b
$ v -> Term ANormalF v
forall v. Var v => v -> Term ANormalF v
TVar v
stack1))
]
outIoExnEither ::
(Var v) => v -> v -> v -> v -> v -> v -> v -> v -> ANormal v
outIoExnEither :: forall v.
Var v =>
v -> v -> v -> v -> v -> v -> v -> v -> ANormal v
outIoExnEither v
stack1 v
stack2 v
stack3 v
any v
fail v
t0 v
t1 v
res =
v -> Branched (Term ANormalF v) -> Term ANormalF v
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch v
t0 (Branched (Term ANormalF v) -> Term ANormalF v)
-> (EnumMap Word64 ([Mem], Term ANormalF v)
-> Branched (Term ANormalF v))
-> EnumMap Word64 ([Mem], Term ANormalF v)
-> Term ANormalF v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], Term ANormalF v)
-> Branched (Term ANormalF v)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum (EnumMap Word64 ([Mem], Term ANormalF v) -> Term ANormalF v)
-> EnumMap Word64 ([Mem], Term ANormalF v) -> Term ANormalF v
forall a b. (a -> b) -> a -> b
$
[(Word64, ([Mem], Term ANormalF v))]
-> EnumMap Word64 ([Mem], Term ANormalF v)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ v -> v -> v -> v -> v -> (Word64, ([Mem], Term ANormalF v))
forall v.
Var v =>
v -> v -> v -> v -> v -> (Word64, ([Mem], ANormal v))
exnCase v
stack1 v
stack2 v
stack3 v
any v
fail,
( Word64
1,
([Mem
UN],)
(Term ANormalF v -> ([Mem], Term ANormalF v))
-> (EnumMap Word64 ([Mem], Term ANormalF v) -> Term ANormalF v)
-> EnumMap Word64 ([Mem], Term ANormalF v)
-> ([Mem], Term ANormalF v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Term ANormalF v -> Term ANormalF v
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs v
t1
(Term ANormalF v -> Term ANormalF v)
-> (EnumMap Word64 ([Mem], Term ANormalF v) -> Term ANormalF v)
-> EnumMap Word64 ([Mem], Term ANormalF v)
-> Term ANormalF v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Branched (Term ANormalF v) -> Term ANormalF v
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch v
t1
(Branched (Term ANormalF v) -> Term ANormalF v)
-> (EnumMap Word64 ([Mem], Term ANormalF v)
-> Branched (Term ANormalF v))
-> EnumMap Word64 ([Mem], Term ANormalF v)
-> Term ANormalF v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], Term ANormalF v)
-> Branched (Term ANormalF v)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum
(EnumMap Word64 ([Mem], Term ANormalF v)
-> ([Mem], Term ANormalF v))
-> EnumMap Word64 ([Mem], Term ANormalF v)
-> ([Mem], Term ANormalF v)
forall a b. (a -> b) -> a -> b
$ [(Word64, ([Mem], Term ANormalF v))]
-> EnumMap Word64 ([Mem], Term ANormalF v)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ (Word64
0, ([Mem
BX], v -> Term ANormalF v -> Term ANormalF v
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs v
res (Term ANormalF v -> Term ANormalF v)
-> Term ANormalF v -> Term ANormalF v
forall a b. (a -> b) -> a -> b
$ v -> Term ANormalF v
forall v. Var v => v -> ANormal v
left v
res)),
(Word64
1, ([Mem
BX], v -> Term ANormalF v -> Term ANormalF v
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs v
res (Term ANormalF v -> Term ANormalF v)
-> Term ANormalF v -> Term ANormalF v
forall a b. (a -> b) -> a -> b
$ v -> Term ANormalF v
forall v. Var v => v -> ANormal v
right v
res))
]
)
]
outIoFailUnit :: forall v. (Var v) => v -> v -> v -> v -> v -> v -> ANormal v
outIoFailUnit :: forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outIoFailUnit v
stack1 v
stack2 v
stack3 v
extra v
fail v
result =
v -> Branched (Term ANormalF v) -> Term ANormalF v
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch v
result (Branched (Term ANormalF v) -> Term ANormalF v)
-> (EnumMap Word64 ([Mem], Term ANormalF v)
-> Branched (Term ANormalF v))
-> EnumMap Word64 ([Mem], Term ANormalF v)
-> Term ANormalF v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], Term ANormalF v)
-> Branched (Term ANormalF v)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum (EnumMap Word64 ([Mem], Term ANormalF v) -> Term ANormalF v)
-> EnumMap Word64 ([Mem], Term ANormalF v) -> Term ANormalF v
forall a b. (a -> b) -> a -> b
$
[(Word64, ([Mem], Term ANormalF v))]
-> EnumMap Word64 ([Mem], Term ANormalF v)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ v -> v -> v -> v -> v -> (Word64, ([Mem], Term ANormalF v))
forall v.
Var v =>
v -> v -> v -> v -> v -> (Word64, ([Mem], ANormal v))
failureCase v
stack1 v
stack2 v
stack3 v
extra v
fail,
( Word64
1,
([],)
(Term ANormalF v -> ([Mem], Term ANormalF v))
-> (Term ANormalF v -> Term ANormalF v)
-> Term ANormalF v
-> ([Mem], Term ANormalF v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
extra Mem
BX (Reference -> CTag -> [v] -> Term ANormalF v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.unitRef CTag
0 [])
(Term ANormalF v -> ([Mem], Term ANormalF v))
-> Term ANormalF v -> ([Mem], Term ANormalF v)
forall a b. (a -> b) -> a -> b
$ v -> Term ANormalF v
forall v. Var v => v -> ANormal v
right v
extra
)
]
outIoFailBool :: forall v. (Var v) => v -> v -> v -> v -> v -> v -> ANormal v
outIoFailBool :: forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outIoFailBool v
stack1 v
stack2 v
stack3 v
extra v
fail v
result =
v -> Branched (Term ANormalF v) -> Term ANormalF v
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch v
result (Branched (Term ANormalF v) -> Term ANormalF v)
-> (EnumMap Word64 ([Mem], Term ANormalF v)
-> Branched (Term ANormalF v))
-> EnumMap Word64 ([Mem], Term ANormalF v)
-> Term ANormalF v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], Term ANormalF v)
-> Branched (Term ANormalF v)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum (EnumMap Word64 ([Mem], Term ANormalF v) -> Term ANormalF v)
-> EnumMap Word64 ([Mem], Term ANormalF v) -> Term ANormalF v
forall a b. (a -> b) -> a -> b
$
[(Word64, ([Mem], Term ANormalF v))]
-> EnumMap Word64 ([Mem], Term ANormalF v)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ v -> v -> v -> v -> v -> (Word64, ([Mem], Term ANormalF v))
forall v.
Var v =>
v -> v -> v -> v -> v -> (Word64, ([Mem], ANormal v))
failureCase v
stack1 v
stack2 v
stack3 v
extra v
fail,
( Word64
1,
([Mem
UN],)
(Term ANormalF v -> ([Mem], Term ANormalF v))
-> (Term ANormalF v -> Term ANormalF v)
-> Term ANormalF v
-> ([Mem], Term ANormalF v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Term ANormalF v -> Term ANormalF v
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs v
stack3
(Term ANormalF v -> ([Mem], Term ANormalF v))
-> Term ANormalF v -> ([Mem], Term ANormalF v)
forall a b. (a -> b) -> a -> b
$ v -> Term ANormalF v
forall v. Var v => v -> ANormal v
right v
stack3
)
]
outIoFailTup :: forall v. (Var v) => v -> v -> v -> v -> v -> v -> v -> v -> ANormal v
outIoFailTup :: forall v.
Var v =>
v -> v -> v -> v -> v -> v -> v -> v -> ANormal v
outIoFailTup v
stack1 v
stack2 v
stack3 v
stack4 v
stack5 v
extra v
fail v
result =
v -> Branched (Term ANormalF v) -> Term ANormalF v
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch v
result (Branched (Term ANormalF v) -> Term ANormalF v)
-> (EnumMap Word64 ([Mem], Term ANormalF v)
-> Branched (Term ANormalF v))
-> EnumMap Word64 ([Mem], Term ANormalF v)
-> Term ANormalF v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], Term ANormalF v)
-> Branched (Term ANormalF v)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum (EnumMap Word64 ([Mem], Term ANormalF v) -> Term ANormalF v)
-> EnumMap Word64 ([Mem], Term ANormalF v) -> Term ANormalF v
forall a b. (a -> b) -> a -> b
$
[(Word64, ([Mem], Term ANormalF v))]
-> EnumMap Word64 ([Mem], Term ANormalF v)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ v -> v -> v -> v -> v -> (Word64, ([Mem], Term ANormalF v))
forall v.
Var v =>
v -> v -> v -> v -> v -> (Word64, ([Mem], ANormal v))
failureCase v
stack1 v
stack2 v
stack3 v
extra v
fail,
( Word64
1,
( [Mem
BX, Mem
BX],
[v] -> Term ANormalF v -> Term ANormalF v
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [v
stack1, v
stack2]
(Term ANormalF v -> Term ANormalF v)
-> (Term ANormalF v -> Term ANormalF v)
-> Term ANormalF v
-> Term ANormalF v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
stack3 Mem
BX (Reference -> CTag -> [v] -> Term ANormalF v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.unitRef CTag
0 [])
(Term ANormalF v -> Term ANormalF v)
-> (Term ANormalF v -> Term ANormalF v)
-> Term ANormalF v
-> Term ANormalF v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
stack4 Mem
BX (Reference -> CTag -> [v] -> Term ANormalF v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.pairRef CTag
0 [v
stack2, v
stack3])
(Term ANormalF v -> Term ANormalF v)
-> (Term ANormalF v -> Term ANormalF v)
-> Term ANormalF v
-> Term ANormalF v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
stack5 Mem
BX (Reference -> CTag -> [v] -> Term ANormalF v
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.pairRef CTag
0 [v
stack1, v
stack4])
(Term ANormalF v -> Term ANormalF v)
-> Term ANormalF v -> Term ANormalF v
forall a b. (a -> b) -> a -> b
$ v -> Term ANormalF v
forall v. Var v => v -> ANormal v
right v
stack5
)
)
]
outIoFailG ::
(Var v) =>
v ->
v ->
v ->
v ->
v ->
v ->
((ANormal v -> ANormal v) -> ([Mem], ANormal v)) ->
ANormal v
outIoFailG :: forall v.
Var v =>
v
-> v
-> v
-> v
-> v
-> v
-> ((ANormal v -> ANormal v) -> ([Mem], ANormal v))
-> ANormal v
outIoFailG v
stack1 v
stack2 v
stack3 v
fail v
result v
output (ANormal v -> ANormal v) -> ([Mem], ANormal v)
k =
v -> Branched (ANormal v) -> ANormal v
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch v
result (Branched (ANormal v) -> ANormal v)
-> (EnumMap Word64 ([Mem], ANormal v) -> Branched (ANormal v))
-> EnumMap Word64 ([Mem], ANormal v)
-> ANormal v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], ANormal v) -> Branched (ANormal v)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum (EnumMap Word64 ([Mem], ANormal v) -> ANormal v)
-> EnumMap Word64 ([Mem], ANormal v) -> ANormal v
forall a b. (a -> b) -> a -> b
$
[(Word64, ([Mem], ANormal v))] -> EnumMap Word64 ([Mem], ANormal v)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ v -> v -> v -> v -> v -> (Word64, ([Mem], ANormal v))
forall v.
Var v =>
v -> v -> v -> v -> v -> (Word64, ([Mem], ANormal v))
failureCase v
stack1 v
stack2 v
stack3 v
output v
fail,
( Word64
1,
(ANormal v -> ANormal v) -> ([Mem], ANormal v)
k ((ANormal v -> ANormal v) -> ([Mem], ANormal v))
-> (ANormal v -> ANormal v) -> ([Mem], ANormal v)
forall a b. (a -> b) -> a -> b
$ \ANormal v
t ->
v -> Mem -> ANormal v -> ANormal v -> ANormal v
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD v
output Mem
BX ANormal v
t (ANormal v -> ANormal v) -> ANormal v -> ANormal v
forall a b. (a -> b) -> a -> b
$
v -> ANormal v
forall v. Var v => v -> ANormal v
right v
output
)
]
direct :: ForeignOp
direct :: ForeignOp
direct ForeignFunc
instr = ([], ForeignFunc -> [Symbol] -> ANormal Symbol
forall v. Var v => ForeignFunc -> [v] -> Term ANormalF v
TFOp ForeignFunc
instr [])
unitToR :: ForeignOp
unitToR :: ForeignOp
unitToR =
Symbol -> Symbol -> ANormal Symbol -> ForeignOp
forall v.
Var v =>
v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
inUnit Symbol
unit Symbol
result (ANormal Symbol -> ForeignOp) -> ANormal Symbol -> ForeignOp
forall a b. (a -> b) -> a -> b
$ Symbol -> ANormal Symbol
forall v. Var v => v -> Term ANormalF v
TVar Symbol
result
where
(Symbol
unit, Symbol
result) = (Symbol, Symbol)
forall t. Fresh t => t
fresh
unitToEF :: ForeignOp
unitToEF :: ForeignOp
unitToEF =
Symbol -> Symbol -> ANormal Symbol -> ForeignOp
forall v.
Var v =>
v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
inUnit Symbol
unit Symbol
result (ANormal Symbol -> ForeignOp) -> ANormal Symbol -> ForeignOp
forall a b. (a -> b) -> a -> b
$
Symbol
-> Symbol -> Symbol -> Symbol -> Symbol -> Symbol -> ANormal Symbol
forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outIoFail Symbol
stack1 Symbol
stack2 Symbol
stack3 Symbol
any Symbol
fail Symbol
result
where
(Symbol
unit, Symbol
stack1, Symbol
stack2, Symbol
stack3, Symbol
fail, Symbol
any, Symbol
result) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol)
forall t. Fresh t => t
fresh
argIomrToEF :: ForeignOp
argIomrToEF :: ForeignOp
argIomrToEF =
Symbol -> Symbol -> Symbol -> Symbol -> ANormal Symbol -> ForeignOp
forall v.
Var v =>
v -> v -> v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
inIomr Symbol
arg1 Symbol
arg2 Symbol
enum Symbol
result (ANormal Symbol -> ForeignOp) -> ANormal Symbol -> ForeignOp
forall a b. (a -> b) -> a -> b
$
Symbol
-> Symbol -> Symbol -> Symbol -> Symbol -> Symbol -> ANormal Symbol
forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outIoFail Symbol
stack1 Symbol
stack2 Symbol
stack3 Symbol
any Symbol
fail Symbol
result
where
(Symbol
arg1, Symbol
arg2, Symbol
enum, Symbol
stack1, Symbol
stack2, Symbol
stack3, Symbol
any, Symbol
fail, Symbol
result) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol,
Symbol)
forall t. Fresh t => t
fresh
argToUnit :: ForeignOp
argToUnit :: ForeignOp
argToUnit = Symbol -> Symbol -> ANormal Symbol -> ForeignOp
forall v.
Var v =>
v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
in1 Symbol
arg Symbol
result (Reference -> CTag -> [Symbol] -> ANormal Symbol
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.unitRef CTag
0 [])
where
(Symbol
arg, Symbol
result) = (Symbol, Symbol)
forall t. Fresh t => t
fresh
arg2To0 :: ForeignOp
arg2To0 :: ForeignOp
arg2To0 ForeignFunc
instr =
([Mem
BX, Mem
BX],)
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ([Mem], ANormal Symbol)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Symbol] -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [Symbol
arg1, Symbol
arg2]
(ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Direction Word16
-> [Symbol]
-> [Mem]
-> ANormal Symbol
-> ANormal Symbol
-> ANormal Symbol
forall v.
Var v =>
Direction Word16
-> [v]
-> [Mem]
-> Term ANormalF v
-> Term ANormalF v
-> Term ANormalF v
TLets Direction Word16
forall a. Direction a
Direct [] [] (ForeignFunc -> [Symbol] -> ANormal Symbol
forall v. Var v => ForeignFunc -> [v] -> Term ANormalF v
TFOp ForeignFunc
instr [Symbol
arg1, Symbol
arg2])
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> ANormal Symbol -> ([Mem], ANormal Symbol)
forall a b. (a -> b) -> a -> b
$ Reference -> CTag -> [Symbol] -> ANormal Symbol
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.unitRef CTag
0 []
where
(Symbol
arg1, Symbol
arg2) = (Symbol, Symbol)
forall t. Fresh t => t
fresh
argNDirect :: Int -> ForeignOp
argNDirect :: Int -> ForeignOp
argNDirect Int
n ForeignFunc
instr =
(Int -> Mem -> [Mem]
forall a. Int -> a -> [a]
replicate Int
n Mem
BX,)
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ([Mem], ANormal Symbol)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Symbol] -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [Symbol]
args
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> ANormal Symbol -> ([Mem], ANormal Symbol)
forall a b. (a -> b) -> a -> b
$ ForeignFunc -> [Symbol] -> ANormal Symbol
forall v. Var v => ForeignFunc -> [v] -> Term ANormalF v
TFOp ForeignFunc
instr [Symbol]
args
where
args :: [Symbol]
args = Int -> [Symbol]
forall v. Var v => Int -> [v]
freshes Int
n
unitDirect :: ForeignOp
unitDirect :: ForeignOp
unitDirect ForeignFunc
instr = ([Mem
BX],) (ANormal Symbol -> ([Mem], ANormal Symbol))
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ([Mem], ANormal Symbol)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs Symbol
arg (ANormal Symbol -> ([Mem], ANormal Symbol))
-> ANormal Symbol -> ([Mem], ANormal Symbol)
forall a b. (a -> b) -> a -> b
$ ForeignFunc -> [Symbol] -> ANormal Symbol
forall v. Var v => ForeignFunc -> [v] -> Term ANormalF v
TFOp ForeignFunc
instr [] where arg :: Symbol
arg = Symbol
forall v. Var v => v
fresh1
argToEF :: ForeignOp
argToEF :: ForeignOp
argToEF =
Symbol -> Symbol -> ANormal Symbol -> ForeignOp
forall v.
Var v =>
v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
in1 Symbol
arg Symbol
result (ANormal Symbol -> ForeignOp) -> ANormal Symbol -> ForeignOp
forall a b. (a -> b) -> a -> b
$
Symbol
-> Symbol -> Symbol -> Symbol -> Symbol -> Symbol -> ANormal Symbol
forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outIoFail Symbol
stack1 Symbol
stack2 Symbol
stack3 Symbol
any Symbol
fail Symbol
result
where
(Symbol
arg, Symbol
result, Symbol
stack1, Symbol
stack2, Symbol
stack3, Symbol
any, Symbol
fail) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol)
forall t. Fresh t => t
fresh
argToEFTup :: ForeignOp
argToEFTup :: ForeignOp
argToEFTup =
Symbol -> Symbol -> ANormal Symbol -> ForeignOp
forall v.
Var v =>
v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
in1 Symbol
arg Symbol
result (ANormal Symbol -> ForeignOp) -> ANormal Symbol -> ForeignOp
forall a b. (a -> b) -> a -> b
$
Symbol
-> Symbol
-> Symbol
-> Symbol
-> Symbol
-> Symbol
-> Symbol
-> Symbol
-> ANormal Symbol
forall v.
Var v =>
v -> v -> v -> v -> v -> v -> v -> v -> ANormal v
outIoFailTup Symbol
stack1 Symbol
stack2 Symbol
stack3 Symbol
stack4 Symbol
stack5 Symbol
extra Symbol
fail Symbol
result
where
(Symbol
arg, Symbol
result, Symbol
stack1, Symbol
stack2, Symbol
stack3, Symbol
stack4, Symbol
stack5, Symbol
extra, Symbol
fail) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol,
Symbol)
forall t. Fresh t => t
fresh
argToEFM :: ForeignOp
argToEFM :: ForeignOp
argToEFM =
Symbol -> Symbol -> ANormal Symbol -> ForeignOp
forall v.
Var v =>
v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
in1 Symbol
arg Symbol
result
(ANormal Symbol -> ForeignOp)
-> (((ANormal Symbol -> ANormal Symbol) -> ([Mem], ANormal Symbol))
-> ANormal Symbol)
-> ((ANormal Symbol -> ANormal Symbol) -> ([Mem], ANormal Symbol))
-> ForeignOp
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol
-> Symbol
-> Symbol
-> Symbol
-> Symbol
-> Symbol
-> ((ANormal Symbol -> ANormal Symbol) -> ([Mem], ANormal Symbol))
-> ANormal Symbol
forall v.
Var v =>
v
-> v
-> v
-> v
-> v
-> v
-> ((ANormal v -> ANormal v) -> ([Mem], ANormal v))
-> ANormal v
outIoFailG Symbol
stack1 Symbol
stack2 Symbol
stack3 Symbol
fail Symbol
result Symbol
output
(((ANormal Symbol -> ANormal Symbol) -> ([Mem], ANormal Symbol))
-> ForeignOp)
-> ((ANormal Symbol -> ANormal Symbol) -> ([Mem], ANormal Symbol))
-> ForeignOp
forall a b. (a -> b) -> a -> b
$ \ANormal Symbol -> ANormal Symbol
k ->
( [Mem
UN],
Symbol -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs Symbol
stack3 (ANormal Symbol -> ANormal Symbol)
-> (EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Branched (ANormal Symbol) -> ANormal Symbol
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch Symbol
stack3 (Branched (ANormal Symbol) -> ANormal Symbol)
-> (EnumMap Word64 ([Mem], ANormal Symbol)
-> Branched (ANormal Symbol))
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], ANormal Symbol) -> Branched (ANormal Symbol)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum (EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$
[(Word64, ([Mem], ANormal Symbol))]
-> EnumMap Word64 ([Mem], ANormal Symbol)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ (Word64
0, ([], ANormal Symbol -> ANormal Symbol
k (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$ ANormal Symbol
forall v. Var v => ANormal v
none)),
(Word64
1, ([Mem
BX], Symbol -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs Symbol
stack4 (ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ANormal Symbol -> ANormal Symbol
k (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$ Symbol -> ANormal Symbol
forall v. Var v => v -> ANormal v
some Symbol
stack4))
]
)
where
(Symbol
arg, Symbol
result, Symbol
stack1, Symbol
stack2, Symbol
stack3, Symbol
stack4, Symbol
fail, Symbol
output) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol)
forall t. Fresh t => t
fresh
argToMaybe :: ForeignOp
argToMaybe :: ForeignOp
argToMaybe = Symbol -> Symbol -> ANormal Symbol -> ForeignOp
forall v.
Var v =>
v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
in1 Symbol
arg Symbol
tag (ANormal Symbol -> ForeignOp) -> ANormal Symbol -> ForeignOp
forall a b. (a -> b) -> a -> b
$ Symbol -> Symbol -> ANormal Symbol
forall v. Var v => v -> v -> ANormal v
outMaybe Symbol
tag Symbol
result
where
(Symbol
arg, Symbol
tag, Symbol
result) = (Symbol, Symbol, Symbol)
forall t. Fresh t => t
fresh
argToMaybeNTup :: ForeignOp
argToMaybeNTup :: ForeignOp
argToMaybeNTup =
Symbol -> Symbol -> ANormal Symbol -> ForeignOp
forall v.
Var v =>
v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
in1 Symbol
arg Symbol
result (ANormal Symbol -> ForeignOp) -> ANormal Symbol -> ForeignOp
forall a b. (a -> b) -> a -> b
$ Symbol
-> Symbol -> Symbol -> Symbol -> Symbol -> Symbol -> ANormal Symbol
forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outMaybeNTup Symbol
a Symbol
b Symbol
u Symbol
bp Symbol
p Symbol
result
where
(Symbol
arg, Symbol
a, Symbol
b, Symbol
u, Symbol
bp, Symbol
p, Symbol
result) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol)
forall t. Fresh t => t
fresh
arg2ToMaybeTup :: ForeignOp
arg2ToMaybeTup :: ForeignOp
arg2ToMaybeTup =
Symbol -> Symbol -> Symbol -> ANormal Symbol -> ForeignOp
forall v.
Var v =>
v -> v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
in2 Symbol
arg1 Symbol
arg2 Symbol
result (ANormal Symbol -> ForeignOp) -> ANormal Symbol -> ForeignOp
forall a b. (a -> b) -> a -> b
$ Symbol
-> Symbol -> Symbol -> Symbol -> Symbol -> Symbol -> ANormal Symbol
forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outMaybeTup Symbol
a Symbol
b Symbol
u Symbol
bp Symbol
ap Symbol
result
where
(Symbol
arg1, Symbol
arg2, Symbol
a, Symbol
b, Symbol
u, Symbol
bp, Symbol
ap, Symbol
result) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol)
forall t. Fresh t => t
fresh
argToEFBool :: ForeignOp
argToEFBool :: ForeignOp
argToEFBool =
Symbol -> Symbol -> ANormal Symbol -> ForeignOp
forall v.
Var v =>
v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
in1 Symbol
arg Symbol
result (ANormal Symbol -> ForeignOp) -> ANormal Symbol -> ForeignOp
forall a b. (a -> b) -> a -> b
$
Symbol
-> Symbol -> Symbol -> Symbol -> Symbol -> Symbol -> ANormal Symbol
forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outIoFailBool Symbol
stack1 Symbol
stack2 Symbol
stack3 Symbol
bool Symbol
fail Symbol
result
where
(Symbol
arg, Symbol
stack1, Symbol
stack2, Symbol
stack3, Symbol
bool, Symbol
fail, Symbol
result) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol)
forall t. Fresh t => t
fresh
argToEFChar :: ForeignOp
argToEFChar :: ForeignOp
argToEFChar =
Symbol -> Symbol -> ANormal Symbol -> ForeignOp
forall v.
Var v =>
v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
in1 Symbol
arg Symbol
result (ANormal Symbol -> ForeignOp) -> ANormal Symbol -> ForeignOp
forall a b. (a -> b) -> a -> b
$
Symbol
-> Symbol -> Symbol -> Symbol -> Symbol -> Symbol -> ANormal Symbol
forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outIoFailChar Symbol
stack1 Symbol
stack2 Symbol
stack3 Symbol
bool Symbol
fail Symbol
result
where
(Symbol
arg, Symbol
stack1, Symbol
stack2, Symbol
stack3, Symbol
bool, Symbol
fail, Symbol
result) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol)
forall t. Fresh t => t
fresh
arg2ToEFBool :: ForeignOp
arg2ToEFBool :: ForeignOp
arg2ToEFBool =
Symbol -> Symbol -> Symbol -> ANormal Symbol -> ForeignOp
forall v.
Var v =>
v -> v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
in2 Symbol
arg1 Symbol
arg2 Symbol
result (ANormal Symbol -> ForeignOp) -> ANormal Symbol -> ForeignOp
forall a b. (a -> b) -> a -> b
$
Symbol
-> Symbol -> Symbol -> Symbol -> Symbol -> Symbol -> ANormal Symbol
forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outIoFailBool Symbol
stack1 Symbol
stack2 Symbol
stack3 Symbol
bool Symbol
fail Symbol
result
where
(Symbol
arg1, Symbol
arg2, Symbol
stack1, Symbol
stack2, Symbol
stack3, Symbol
bool, Symbol
fail, Symbol
result) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol)
forall t. Fresh t => t
fresh
arg3ToEFBool :: ForeignOp
arg3ToEFBool :: ForeignOp
arg3ToEFBool =
Symbol -> Symbol -> Symbol -> Symbol -> ANormal Symbol -> ForeignOp
forall v.
Var v =>
v -> v -> v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
in3 Symbol
arg1 Symbol
arg2 Symbol
arg3 Symbol
result (ANormal Symbol -> ForeignOp) -> ANormal Symbol -> ForeignOp
forall a b. (a -> b) -> a -> b
$
Symbol
-> Symbol -> Symbol -> Symbol -> Symbol -> Symbol -> ANormal Symbol
forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outIoFailBool Symbol
stack1 Symbol
stack2 Symbol
stack3 Symbol
bool Symbol
fail Symbol
result
where
(Symbol
arg1, Symbol
arg2, Symbol
arg3, Symbol
stack1, Symbol
stack2, Symbol
stack3, Symbol
bool, Symbol
fail, Symbol
result) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol,
Symbol)
forall t. Fresh t => t
fresh
argToEF0 :: ForeignOp
argToEF0 :: ForeignOp
argToEF0 =
Symbol -> Symbol -> ANormal Symbol -> ForeignOp
forall v.
Var v =>
v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
in1 Symbol
arg Symbol
result (ANormal Symbol -> ForeignOp) -> ANormal Symbol -> ForeignOp
forall a b. (a -> b) -> a -> b
$
Symbol
-> Symbol -> Symbol -> Symbol -> Symbol -> Symbol -> ANormal Symbol
forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outIoFailUnit Symbol
stack1 Symbol
stack2 Symbol
stack3 Symbol
unit Symbol
fail Symbol
result
where
(Symbol
arg, Symbol
result, Symbol
stack1, Symbol
stack2, Symbol
stack3, Symbol
unit, Symbol
fail) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol)
forall t. Fresh t => t
fresh
arg2ToEF0 :: ForeignOp
arg2ToEF0 :: ForeignOp
arg2ToEF0 =
Symbol -> Symbol -> Symbol -> ANormal Symbol -> ForeignOp
forall v.
Var v =>
v -> v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
in2 Symbol
arg1 Symbol
arg2 Symbol
result (ANormal Symbol -> ForeignOp) -> ANormal Symbol -> ForeignOp
forall a b. (a -> b) -> a -> b
$
Symbol
-> Symbol -> Symbol -> Symbol -> Symbol -> Symbol -> ANormal Symbol
forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outIoFailUnit Symbol
stack1 Symbol
stack2 Symbol
stack3 Symbol
fail Symbol
unit Symbol
result
where
(Symbol
arg1, Symbol
arg2, Symbol
result, Symbol
stack1, Symbol
stack2, Symbol
stack3, Symbol
fail, Symbol
unit) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol)
forall t. Fresh t => t
fresh
arg3ToEF0 :: ForeignOp
arg3ToEF0 :: ForeignOp
arg3ToEF0 =
Symbol -> Symbol -> Symbol -> Symbol -> ANormal Symbol -> ForeignOp
forall v.
Var v =>
v -> v -> v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
in3 Symbol
arg1 Symbol
arg2 Symbol
arg3 Symbol
result (ANormal Symbol -> ForeignOp) -> ANormal Symbol -> ForeignOp
forall a b. (a -> b) -> a -> b
$
Symbol
-> Symbol -> Symbol -> Symbol -> Symbol -> Symbol -> ANormal Symbol
forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outIoFailUnit Symbol
stack1 Symbol
stack2 Symbol
stack3 Symbol
fail Symbol
unit Symbol
result
where
(Symbol
arg1, Symbol
arg2, Symbol
arg3, Symbol
result, Symbol
stack1, Symbol
stack2, Symbol
stack3, Symbol
fail, Symbol
unit) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol,
Symbol)
forall t. Fresh t => t
fresh
argToEFNat :: ForeignOp
argToEFNat :: ForeignOp
argToEFNat =
Symbol -> Symbol -> ANormal Symbol -> ForeignOp
forall v.
Var v =>
v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
in1 Symbol
arg Symbol
result (ANormal Symbol -> ForeignOp) -> ANormal Symbol -> ForeignOp
forall a b. (a -> b) -> a -> b
$
Symbol
-> Symbol -> Symbol -> Symbol -> Symbol -> Symbol -> ANormal Symbol
forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outIoFail Symbol
stack1 Symbol
stack2 Symbol
stack3 Symbol
nat Symbol
fail Symbol
result
where
(Symbol
arg, Symbol
result, Symbol
stack1, Symbol
stack2, Symbol
stack3, Symbol
nat, Symbol
fail) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol)
forall t. Fresh t => t
fresh
maybeToEF :: ForeignOp
maybeToEF :: ForeignOp
maybeToEF =
Symbol
-> Symbol
-> Symbol
-> Symbol
-> Symbol
-> ANormal Symbol
-> ForeignOp
forall v.
Var v =>
v
-> v
-> v
-> v
-> v
-> ANormal v
-> ForeignFunc
-> ([Mem], ANormal v)
inMaybeBx Symbol
arg1 Symbol
arg2 Symbol
arg3 Symbol
mb Symbol
result (ANormal Symbol -> ForeignOp) -> ANormal Symbol -> ForeignOp
forall a b. (a -> b) -> a -> b
$
Symbol
-> Symbol -> Symbol -> Symbol -> Symbol -> Symbol -> ANormal Symbol
forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outIoFail Symbol
stack1 Symbol
stack2 Symbol
stack3 Symbol
any Symbol
fail Symbol
result
where
(Symbol
arg1, Symbol
arg2, Symbol
arg3, Symbol
mb, Symbol
result, Symbol
stack1, Symbol
stack2, Symbol
stack3, Symbol
any, Symbol
fail) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol,
Symbol, Symbol)
forall t. Fresh t => t
fresh
arg2ToEF :: ForeignOp
arg2ToEF :: ForeignOp
arg2ToEF =
Symbol -> Symbol -> Symbol -> ANormal Symbol -> ForeignOp
forall v.
Var v =>
v -> v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
in2 Symbol
arg1 Symbol
arg2 Symbol
result (ANormal Symbol -> ForeignOp) -> ANormal Symbol -> ForeignOp
forall a b. (a -> b) -> a -> b
$
Symbol
-> Symbol -> Symbol -> Symbol -> Symbol -> Symbol -> ANormal Symbol
forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outIoFail Symbol
stack1 Symbol
stack2 Symbol
stack3 Symbol
any Symbol
fail Symbol
result
where
(Symbol
arg1, Symbol
arg2, Symbol
result, Symbol
stack1, Symbol
stack2, Symbol
stack3, Symbol
any, Symbol
fail) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol)
forall t. Fresh t => t
fresh
arg3ToEF :: ForeignOp
arg3ToEF :: ForeignOp
arg3ToEF =
Symbol -> Symbol -> Symbol -> Symbol -> ANormal Symbol -> ForeignOp
forall v.
Var v =>
v -> v -> v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
in3 Symbol
arg1 Symbol
arg2 Symbol
arg3 Symbol
result (ANormal Symbol -> ForeignOp) -> ANormal Symbol -> ForeignOp
forall a b. (a -> b) -> a -> b
$
Symbol
-> Symbol -> Symbol -> Symbol -> Symbol -> Symbol -> ANormal Symbol
forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outIoFail Symbol
stack1 Symbol
stack2 Symbol
stack3 Symbol
any Symbol
fail Symbol
result
where
(Symbol
arg1, Symbol
arg2, Symbol
arg3, Symbol
result, Symbol
stack1, Symbol
stack2, Symbol
stack3, Symbol
any, Symbol
fail) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol,
Symbol)
forall t. Fresh t => t
fresh
arg2ToExn :: ForeignOp
arg2ToExn :: ForeignOp
arg2ToExn =
Symbol -> Symbol -> Symbol -> ANormal Symbol -> ForeignOp
forall v.
Var v =>
v -> v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
in2 Symbol
arg1 Symbol
arg2 Symbol
result (ANormal Symbol -> ForeignOp) -> ANormal Symbol -> ForeignOp
forall a b. (a -> b) -> a -> b
$
Symbol
-> Symbol -> Symbol -> Symbol -> Symbol -> Symbol -> ANormal Symbol
forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outIoExn Symbol
stack1 Symbol
stack2 Symbol
stack3 Symbol
any Symbol
fail Symbol
result
where
(Symbol
arg1, Symbol
arg2, Symbol
stack1, Symbol
stack2, Symbol
stack3, Symbol
any, Symbol
fail, Symbol
result) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol)
forall t. Fresh t => t
fresh
arg3ToExnUnit :: ForeignOp
arg3ToExnUnit :: ForeignOp
arg3ToExnUnit =
Symbol -> Symbol -> Symbol -> Symbol -> ANormal Symbol -> ForeignOp
forall v.
Var v =>
v -> v -> v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
in3 Symbol
arg1 Symbol
arg2 Symbol
arg3 Symbol
result (ANormal Symbol -> ForeignOp) -> ANormal Symbol -> ForeignOp
forall a b. (a -> b) -> a -> b
$
Symbol
-> Symbol -> Symbol -> Symbol -> Symbol -> Symbol -> ANormal Symbol
forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outIoExnUnit Symbol
stack1 Symbol
stack2 Symbol
stack3 Symbol
any Symbol
fail Symbol
result
where
(Symbol
arg1, Symbol
arg2, Symbol
arg3, Symbol
stack1, Symbol
stack2, Symbol
stack3, Symbol
any, Symbol
fail, Symbol
result) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol,
Symbol)
forall t. Fresh t => t
fresh
arg3ToExn :: ForeignOp
arg3ToExn :: ForeignOp
arg3ToExn =
Symbol -> Symbol -> Symbol -> Symbol -> ANormal Symbol -> ForeignOp
forall v.
Var v =>
v -> v -> v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
in3 Symbol
arg1 Symbol
arg2 Symbol
arg3 Symbol
result (ANormal Symbol -> ForeignOp) -> ANormal Symbol -> ForeignOp
forall a b. (a -> b) -> a -> b
$
Symbol
-> Symbol -> Symbol -> Symbol -> Symbol -> Symbol -> ANormal Symbol
forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outIoExn Symbol
stack1 Symbol
stack2 Symbol
stack3 Symbol
any Symbol
fail Symbol
result
where
(Symbol
arg1, Symbol
arg2, Symbol
arg3, Symbol
result, Symbol
stack1, Symbol
stack2, Symbol
stack3, Symbol
any, Symbol
fail) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol,
Symbol)
forall t. Fresh t => t
fresh
arg5ToExnUnit :: ForeignOp
arg5ToExnUnit :: ForeignOp
arg5ToExnUnit ForeignFunc
instr =
([Mem
BX, Mem
BX, Mem
BX, Mem
BX, Mem
BX],)
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ([Mem], ANormal Symbol)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Symbol] -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [Symbol
a0, Symbol
ua1, Symbol
a2, Symbol
ua3, Symbol
ua4]
(ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
result Mem
UN (ForeignFunc -> [Symbol] -> ANormal Symbol
forall v. Var v => ForeignFunc -> [v] -> Term ANormalF v
TFOp ForeignFunc
instr [Symbol
a0, Symbol
ua1, Symbol
a2, Symbol
ua3, Symbol
ua4])
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> ANormal Symbol -> ([Mem], ANormal Symbol)
forall a b. (a -> b) -> a -> b
$ Symbol
-> Symbol -> Symbol -> Symbol -> Symbol -> Symbol -> ANormal Symbol
forall v. Var v => v -> v -> v -> v -> v -> v -> ANormal v
outIoExnUnit Symbol
stack1 Symbol
stack2 Symbol
stack3 Symbol
any Symbol
fail Symbol
result
where
(Symbol
a0, Symbol
a2, Symbol
ua1, Symbol
ua3, Symbol
ua4, Symbol
result, Symbol
stack1, Symbol
stack2, Symbol
stack3, Symbol
any, Symbol
fail) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol,
Symbol, Symbol, Symbol)
forall t. Fresh t => t
fresh
argToExnE :: ForeignOp
argToExnE :: ForeignOp
argToExnE ForeignFunc
instr =
([Mem
BX],)
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ([Mem], ANormal Symbol)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs Symbol
a
(ANormal Symbol -> ANormal Symbol)
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
t0 Mem
UN (ForeignFunc -> [Symbol] -> ANormal Symbol
forall v. Var v => ForeignFunc -> [v] -> Term ANormalF v
TFOp ForeignFunc
instr [Symbol
a])
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> ANormal Symbol -> ([Mem], ANormal Symbol)
forall a b. (a -> b) -> a -> b
$ Symbol
-> Symbol
-> Symbol
-> Symbol
-> Symbol
-> Symbol
-> Symbol
-> Symbol
-> ANormal Symbol
forall v.
Var v =>
v -> v -> v -> v -> v -> v -> v -> v -> ANormal v
outIoExnEither Symbol
stack1 Symbol
stack2 Symbol
stack3 Symbol
any Symbol
fail Symbol
t0 Symbol
t1 Symbol
result
where
(Symbol
a, Symbol
stack1, Symbol
stack2, Symbol
stack3, Symbol
any, Symbol
fail, Symbol
t0, Symbol
t1, Symbol
result) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol,
Symbol)
forall t. Fresh t => t
fresh
argToEFUnit :: ForeignOp
argToEFUnit :: ForeignOp
argToEFUnit =
Symbol -> Symbol -> ANormal Symbol -> ForeignOp
forall v.
Var v =>
v -> v -> ANormal v -> ForeignFunc -> ([Mem], ANormal v)
in1 Symbol
nat Symbol
result
(ANormal Symbol -> ForeignOp)
-> (EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ForeignOp
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Branched (ANormal Symbol) -> ANormal Symbol
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch Symbol
result
(Branched (ANormal Symbol) -> ANormal Symbol)
-> (EnumMap Word64 ([Mem], ANormal Symbol)
-> Branched (ANormal Symbol))
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], ANormal Symbol) -> Branched (ANormal Symbol)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum
(EnumMap Word64 ([Mem], ANormal Symbol) -> ForeignOp)
-> EnumMap Word64 ([Mem], ANormal Symbol) -> ForeignOp
forall a b. (a -> b) -> a -> b
$ [(Word64, ([Mem], ANormal Symbol))]
-> EnumMap Word64 ([Mem], ANormal Symbol)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ Symbol
-> Symbol
-> Symbol
-> Symbol
-> Symbol
-> (Word64, ([Mem], ANormal Symbol))
forall v.
Var v =>
v -> v -> v -> v -> v -> (Word64, ([Mem], ANormal v))
failureCase Symbol
stack1 Symbol
stack2 Symbol
stack3 Symbol
unit Symbol
fail,
( Word64
1,
([],)
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol
-> ([Mem], ANormal Symbol)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
unit Mem
BX (Reference -> CTag -> [Symbol] -> ANormal Symbol
forall v. Var v => Reference -> CTag -> [v] -> Term ANormalF v
TCon Reference
Ty.unitRef CTag
0 [])
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> ANormal Symbol -> ([Mem], ANormal Symbol)
forall a b. (a -> b) -> a -> b
$ Symbol -> ANormal Symbol
forall v. Var v => v -> ANormal v
right Symbol
unit
)
]
where
(Symbol
nat, Symbol
result, Symbol
fail, Symbol
stack1, Symbol
stack2, Symbol
stack3, Symbol
unit) = (Symbol, Symbol, Symbol, Symbol, Symbol, Symbol, Symbol)
forall t. Fresh t => t
fresh
argToEither :: ForeignOp
argToEither :: ForeignOp
argToEither ForeignFunc
instr =
([Mem
BX],)
(ANormal Symbol -> ([Mem], ANormal Symbol))
-> (EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ([Mem], ANormal Symbol)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Symbol] -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => [v] -> Term f v -> Term f v
TAbss [Symbol
b]
(ANormal Symbol -> ANormal Symbol)
-> (EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Mem -> ANormal Symbol -> ANormal Symbol -> ANormal Symbol
forall v.
Var v =>
v -> Mem -> Term ANormalF v -> Term ANormalF v -> Term ANormalF v
TLetD Symbol
e Mem
UN (ForeignFunc -> [Symbol] -> ANormal Symbol
forall v. Var v => ForeignFunc -> [v] -> Term ANormalF v
TFOp ForeignFunc
instr [Symbol
b])
(ANormal Symbol -> ANormal Symbol)
-> (EnumMap Word64 ([Mem], ANormal Symbol) -> ANormal Symbol)
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Symbol -> Branched (ANormal Symbol) -> ANormal Symbol
forall v.
Var v =>
v -> Branched (Term ANormalF v) -> Term ANormalF v
TMatch Symbol
e
(Branched (ANormal Symbol) -> ANormal Symbol)
-> (EnumMap Word64 ([Mem], ANormal Symbol)
-> Branched (ANormal Symbol))
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ANormal Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EnumMap Word64 ([Mem], ANormal Symbol) -> Branched (ANormal Symbol)
forall e. EnumMap Word64 ([Mem], e) -> Branched e
MatchSum
(EnumMap Word64 ([Mem], ANormal Symbol) -> ([Mem], ANormal Symbol))
-> EnumMap Word64 ([Mem], ANormal Symbol)
-> ([Mem], ANormal Symbol)
forall a b. (a -> b) -> a -> b
$ [(Word64, ([Mem], ANormal Symbol))]
-> EnumMap Word64 ([Mem], ANormal Symbol)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList
[ (Word64
0, ([Mem
BX], Symbol -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs Symbol
ev (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$ Symbol -> ANormal Symbol
forall v. Var v => v -> ANormal v
left Symbol
ev)),
(Word64
1, ([Mem
BX], Symbol -> ANormal Symbol -> ANormal Symbol
forall v (f :: * -> * -> *). Var v => v -> Term f v -> Term f v
TAbs Symbol
ev (ANormal Symbol -> ANormal Symbol)
-> ANormal Symbol -> ANormal Symbol
forall a b. (a -> b) -> a -> b
$ Symbol -> ANormal Symbol
forall v. Var v => v -> ANormal v
right Symbol
ev))
]
where
(Symbol
e, Symbol
b, Symbol
ev) = (Symbol, Symbol, Symbol)
forall t. Fresh t => t
fresh
builtinLookup :: Map.Map Reference (Sandbox, SuperNormal Symbol)
builtinLookup :: Map Reference (Sandbox, SuperNormal Symbol)
builtinLookup =
[(Reference, (Sandbox, SuperNormal Symbol))]
-> Map Reference (Sandbox, SuperNormal Symbol)
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList
([(Reference, (Sandbox, SuperNormal Symbol))]
-> Map Reference (Sandbox, SuperNormal Symbol))
-> ([(Text, (Sandbox, SuperNormal Symbol))]
-> [(Reference, (Sandbox, SuperNormal Symbol))])
-> [(Text, (Sandbox, SuperNormal Symbol))]
-> Map Reference (Sandbox, SuperNormal Symbol)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Text, (Sandbox, SuperNormal Symbol))
-> (Reference, (Sandbox, SuperNormal Symbol)))
-> [(Text, (Sandbox, SuperNormal Symbol))]
-> [(Reference, (Sandbox, SuperNormal Symbol))]
forall a b. (a -> b) -> [a] -> [b]
map (\(Text
t, (Sandbox, SuperNormal Symbol)
f) -> (Text -> Reference
forall t h. t -> Reference' t h
Builtin Text
t, (Sandbox, SuperNormal Symbol)
f))
([(Text, (Sandbox, SuperNormal Symbol))]
-> Map Reference (Sandbox, SuperNormal Symbol))
-> [(Text, (Sandbox, SuperNormal Symbol))]
-> Map Reference (Sandbox, SuperNormal Symbol)
forall a b. (a -> b) -> a -> b
$ [ (Text
"Int.+", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
addi)),
(Text
"Int.-", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
subi)),
(Text
"Int.*", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
muli)),
(Text
"Int./", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
divi)),
(Text
"Int.mod", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
modi)),
(Text
"Int.==", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
eqi)),
(Text
"Int.<", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
lti)),
(Text
"Int.<=", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
lei)),
(Text
"Int.>", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
gti)),
(Text
"Int.>=", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
gei)),
(Text
"Int.fromRepresentation", (Sandbox
Untracked, UnboxedTypeTag -> SuperNormal Symbol
coerceType UnboxedTypeTag
IntTag)),
(Text
"Int.toRepresentation", (Sandbox
Untracked, UnboxedTypeTag -> SuperNormal Symbol
coerceType UnboxedTypeTag
NatTag)),
(Text
"Int.increment", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
inci)),
(Text
"Int.signum", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
sgni)),
(Text
"Int.negate", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
negi)),
(Text
"Int.truncate0", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
trni)),
(Text
"Int.isEven", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
evni)),
(Text
"Int.isOdd", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
oddi)),
(Text
"Int.shiftLeft", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
shli)),
(Text
"Int.shiftRight", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
shri)),
(Text
"Int.trailingZeros", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
tzeroi)),
(Text
"Int.leadingZeros", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
lzeroi)),
(Text
"Int.and", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
andi)),
(Text
"Int.or", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
ori)),
(Text
"Int.xor", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
xori)),
(Text
"Int.complement", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
compli)),
(Text
"Int.pow", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
powi)),
(Text
"Int.toText", (Sandbox
Untracked, SuperNormal Symbol
i2t)),
(Text
"Int.fromText", (Sandbox
Untracked, SuperNormal Symbol
t2i)),
(Text
"Int.toFloat", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
i2f)),
(Text
"Int.popCount", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
popi)),
(Text
"Nat.+", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
addn)),
(Text
"Nat.-", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
subn)),
(Text
"Nat.sub", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
subn)),
(Text
"Nat.*", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
muln)),
(Text
"Nat./", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
divn)),
(Text
"Nat.mod", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
modn)),
(Text
"Nat.==", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
eqn)),
(Text
"Nat.<", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
ltn)),
(Text
"Nat.<=", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
len)),
(Text
"Nat.>", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
gtn)),
(Text
"Nat.>=", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
gen)),
(Text
"Nat.increment", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
incn)),
(Text
"Nat.isEven", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
evnn)),
(Text
"Nat.isOdd", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
oddn)),
(Text
"Nat.shiftLeft", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
shln)),
(Text
"Nat.shiftRight", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
shrn)),
(Text
"Nat.trailingZeros", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
tzeron)),
(Text
"Nat.leadingZeros", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
lzeron)),
(Text
"Nat.and", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
andn)),
(Text
"Nat.or", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
orn)),
(Text
"Nat.xor", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
xorn)),
(Text
"Nat.complement", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
compln)),
(Text
"Nat.pow", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
pown)),
(Text
"Nat.drop", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
dropn)),
(Text
"Nat.toInt", (Sandbox
Untracked, UnboxedTypeTag -> SuperNormal Symbol
coerceType UnboxedTypeTag
IntTag)),
(Text
"Nat.toFloat", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
n2f)),
(Text
"Nat.toText", (Sandbox
Untracked, SuperNormal Symbol
n2t)),
(Text
"Nat.fromText", (Sandbox
Untracked, SuperNormal Symbol
t2n)),
(Text
"Nat.popCount", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
popn)),
(Text
"Float.+", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
addf)),
(Text
"Float.-", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
subf)),
(Text
"Float.*", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
mulf)),
(Text
"Float./", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
divf)),
(Text
"Float.pow", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
powf)),
(Text
"Float.log", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
logf)),
(Text
"Float.logBase", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
logbf)),
(Text
"Float.sqrt", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
sqrtf)),
(Text
"Float.fromRepresentation", (Sandbox
Untracked, UnboxedTypeTag -> SuperNormal Symbol
coerceType UnboxedTypeTag
FloatTag)),
(Text
"Float.toRepresentation", (Sandbox
Untracked, UnboxedTypeTag -> SuperNormal Symbol
coerceType UnboxedTypeTag
NatTag)),
(Text
"Float.min", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
minf)),
(Text
"Float.max", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
maxf)),
(Text
"Float.<", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
ltf)),
(Text
"Float.>", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
gtf)),
(Text
"Float.<=", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
lef)),
(Text
"Float.>=", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
gef)),
(Text
"Float.==", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
eqf)),
(Text
"Float.!=", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
neqf)),
(Text
"Float.acos", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
acosf)),
(Text
"Float.asin", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
asinf)),
(Text
"Float.atan", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
atanf)),
(Text
"Float.cos", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
cosf)),
(Text
"Float.sin", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
sinf)),
(Text
"Float.tan", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
tanf)),
(Text
"Float.acosh", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
acoshf)),
(Text
"Float.asinh", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
asinhf)),
(Text
"Float.atanh", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
atanhf)),
(Text
"Float.cosh", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
coshf)),
(Text
"Float.sinh", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
sinhf)),
(Text
"Float.tanh", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
tanhf)),
(Text
"Float.exp", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
expf)),
(Text
"Float.abs", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
absf)),
(Text
"Float.ceiling", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
ceilf)),
(Text
"Float.floor", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
floorf)),
(Text
"Float.round", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
roundf)),
(Text
"Float.truncate", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
truncf)),
(Text
"Float.atan2", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
atan2f)),
(Text
"Float.toText", (Sandbox
Untracked, SuperNormal Symbol
f2t)),
(Text
"Float.fromText", (Sandbox
Untracked, SuperNormal Symbol
t2f)),
(Text
"Text.empty", (Sandbox
Untracked, [Mem] -> ANormal Symbol -> SuperNormal Symbol
forall v. [Mem] -> ANormal v -> SuperNormal v
Lambda [] (ANormal Symbol -> SuperNormal Symbol)
-> ANormal Symbol -> SuperNormal Symbol
forall a b. (a -> b) -> a -> b
$ Lit -> ANormal Symbol
forall v. Var v => Lit -> Term ANormalF v
TLit (Text -> Lit
T Text
""))),
(Text
"Text.++", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
appendt)),
(Text
"Text.take", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
taket)),
(Text
"Text.drop", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
dropt)),
(Text
"Text.indexOf", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
indext)),
(Text
"Text.size", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
sizet)),
(Text
"Text.==", (Sandbox
Untracked, SuperNormal Symbol
eqt)),
(Text
"Text.!=", (Sandbox
Untracked, SuperNormal Symbol
neqt)),
(Text
"Text.<=", (Sandbox
Untracked, SuperNormal Symbol
leqt)),
(Text
"Text.>=", (Sandbox
Untracked, SuperNormal Symbol
geqt)),
(Text
"Text.<", (Sandbox
Untracked, SuperNormal Symbol
lesst)),
(Text
"Text.>", (Sandbox
Untracked, SuperNormal Symbol
great)),
(Text
"Text.uncons", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
unconst)),
(Text
"Text.unsnoc", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
unsnoct)),
(Text
"Text.toCharList", (Sandbox
Untracked, SuperNormal Symbol
unpackt)),
(Text
"Text.fromCharList", (Sandbox
Untracked, SuperNormal Symbol
packt)),
(Text
"Boolean.not", (Sandbox
Untracked, SuperNormal Symbol
notb)),
(Text
"Boolean.or", (Sandbox
Untracked, SuperNormal Symbol
orb)),
(Text
"Boolean.and", (Sandbox
Untracked, SuperNormal Symbol
andb)),
(Text
"bug", (Sandbox
Untracked, Text -> SuperNormal Symbol
bug Text
"builtin.bug")),
(Text
"todo", (Sandbox
Untracked, Text -> SuperNormal Symbol
bug Text
"builtin.todo")),
(Text
"Debug.watch", (Sandbox
Tracked, SuperNormal Symbol
watch)),
(Text
"Debug.trace", (Sandbox
Tracked, SuperNormal Symbol
gen'trace)),
(Text
"Debug.toText", (Sandbox
Tracked, SuperNormal Symbol
debug'text)),
(Text
"unsafe.coerceAbilities", (Sandbox
Untracked, SuperNormal Symbol
poly'coerce)),
(Text
"Char.toNat", (Sandbox
Untracked, UnboxedTypeTag -> SuperNormal Symbol
coerceType UnboxedTypeTag
NatTag)),
(Text
"Char.fromNat", (Sandbox
Untracked, UnboxedTypeTag -> SuperNormal Symbol
coerceType UnboxedTypeTag
CharTag)),
(Text
"Bytes.empty", (Sandbox
Untracked, SuperNormal Symbol
emptyb)),
(Text
"Bytes.fromList", (Sandbox
Untracked, SuperNormal Symbol
packb)),
(Text
"Bytes.toList", (Sandbox
Untracked, SuperNormal Symbol
unpackb)),
(Text
"Bytes.++", (Sandbox
Untracked, SuperNormal Symbol
appendb)),
(Text
"Bytes.take", (Sandbox
Untracked, SuperNormal Symbol
takeb)),
(Text
"Bytes.drop", (Sandbox
Untracked, SuperNormal Symbol
dropb)),
(Text
"Bytes.at", (Sandbox
Untracked, SuperNormal Symbol
atb)),
(Text
"Bytes.indexOf", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
indexb)),
(Text
"Bytes.size", (Sandbox
Untracked, SuperNormal Symbol
sizeb)),
(Text
"Bytes.flatten", (Sandbox
Untracked, SuperNormal Symbol
flattenb)),
(Text
"List.take", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
takes)),
(Text
"List.drop", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
drops)),
(Text
"List.size", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
sizes)),
(Text
"List.++", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
appends)),
(Text
"List.at", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
ats)),
(Text
"List.cons", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
conss)),
(Text
"List.snoc", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
snocs)),
(Text
"List.empty", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
emptys)),
(Text
"List.viewl", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
viewls)),
(Text
"List.viewr", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
viewrs)),
(Text
"List.splitLeft", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
splitls)),
(Text
"List.splitRight", (Sandbox
Untracked, SuperNormal Symbol
forall v. Var v => SuperNormal v
splitrs)),
(Text
"Universal.==", (Sandbox
Untracked, SuperNormal Symbol
equ)),
(Text
"Universal.compare", (Sandbox
Untracked, SuperNormal Symbol
cmpu)),
(Text
"Universal.>", (Sandbox
Untracked, SuperNormal Symbol
gtu)),
(Text
"Universal.<", (Sandbox
Untracked, SuperNormal Symbol
ltu)),
(Text
"Universal.>=", (Sandbox
Untracked, SuperNormal Symbol
geu)),
(Text
"Universal.<=", (Sandbox
Untracked, SuperNormal Symbol
leu)),
(Text
"jumpCont", (Sandbox
Untracked, SuperNormal Symbol
jumpk)),
(Text
"raise", (Sandbox
Untracked, SuperNormal Symbol
raise)),
(Text
"IO.forkComp.v2", (Sandbox
Tracked, SuperNormal Symbol
fork'comp)),
(Text
"Scope.run", (Sandbox
Untracked, SuperNormal Symbol
scope'run)),
(Text
"Code.isMissing", (Sandbox
Tracked, SuperNormal Symbol
code'missing)),
(Text
"Code.cache_", (Sandbox
Tracked, SuperNormal Symbol
code'cache)),
(Text
"Code.lookup", (Sandbox
Tracked, SuperNormal Symbol
code'lookup)),
(Text
"Code.validate", (Sandbox
Tracked, SuperNormal Symbol
code'validate)),
(Text
"Value.load", (Sandbox
Tracked, SuperNormal Symbol
value'load)),
(Text
"Value.value", (Sandbox
Tracked, SuperNormal Symbol
value'create)),
(Text
"Any.Any", (Sandbox
Untracked, SuperNormal Symbol
any'construct)),
(Text
"Any.unsafeExtract", (Sandbox
Untracked, SuperNormal Symbol
any'extract)),
(Text
"Link.Term.toText", (Sandbox
Untracked, SuperNormal Symbol
term'link'to'text)),
(Text
"STM.atomically", (Sandbox
Tracked, SuperNormal Symbol
stm'atomic)),
(Text
"validateSandboxed", (Sandbox
Untracked, SuperNormal Symbol
check'sandbox)),
(Text
"Value.validateSandboxed", (Sandbox
Tracked, SuperNormal Symbol
value'sandbox)),
(Text
"sandboxLinks", (Sandbox
Tracked, SuperNormal Symbol
sandbox'links)),
(Text
"IO.tryEval", (Sandbox
Tracked, SuperNormal Symbol
try'eval)),
(Text
"Ref.read", (Sandbox
Untracked, SuperNormal Symbol
ref'read)),
(Text
"Ref.write", (Sandbox
Untracked, SuperNormal Symbol
ref'write)),
(Text
"Ref.cas", (Sandbox
Tracked, SuperNormal Symbol
ref'cas)),
(Text
"Ref.Ticket.read", (Sandbox
Tracked, SuperNormal Symbol
ref'ticket'read)),
(Text
"Ref.readForCas", (Sandbox
Tracked, SuperNormal Symbol
ref'readForCas)),
(Text
"Scope.ref", (Sandbox
Untracked, SuperNormal Symbol
ref'new)),
(Text
"IO.ref", (Sandbox
Tracked, SuperNormal Symbol
ref'new))
]
[(Text, (Sandbox, SuperNormal Symbol))]
-> [(Text, (Sandbox, SuperNormal Symbol))]
-> [(Text, (Sandbox, SuperNormal Symbol))]
forall a. [a] -> [a] -> [a]
++ [(Text, (Sandbox, SuperNormal Symbol))]
foreignWrappers
type FDecl v = State (Map ForeignFunc (Sandbox, SuperNormal v))
data Sandbox = Tracked | Untracked
deriving (Sandbox -> Sandbox -> Bool
(Sandbox -> Sandbox -> Bool)
-> (Sandbox -> Sandbox -> Bool) -> Eq Sandbox
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Sandbox -> Sandbox -> Bool
== :: Sandbox -> Sandbox -> Bool
$c/= :: Sandbox -> Sandbox -> Bool
/= :: Sandbox -> Sandbox -> Bool
Eq, Eq Sandbox
Eq Sandbox =>
(Sandbox -> Sandbox -> Ordering)
-> (Sandbox -> Sandbox -> Bool)
-> (Sandbox -> Sandbox -> Bool)
-> (Sandbox -> Sandbox -> Bool)
-> (Sandbox -> Sandbox -> Bool)
-> (Sandbox -> Sandbox -> Sandbox)
-> (Sandbox -> Sandbox -> Sandbox)
-> Ord Sandbox
Sandbox -> Sandbox -> Bool
Sandbox -> Sandbox -> Ordering
Sandbox -> Sandbox -> Sandbox
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Sandbox -> Sandbox -> Ordering
compare :: Sandbox -> Sandbox -> Ordering
$c< :: Sandbox -> Sandbox -> Bool
< :: Sandbox -> Sandbox -> Bool
$c<= :: Sandbox -> Sandbox -> Bool
<= :: Sandbox -> Sandbox -> Bool
$c> :: Sandbox -> Sandbox -> Bool
> :: Sandbox -> Sandbox -> Bool
$c>= :: Sandbox -> Sandbox -> Bool
>= :: Sandbox -> Sandbox -> Bool
$cmax :: Sandbox -> Sandbox -> Sandbox
max :: Sandbox -> Sandbox -> Sandbox
$cmin :: Sandbox -> Sandbox -> Sandbox
min :: Sandbox -> Sandbox -> Sandbox
Ord, Int -> Sandbox -> ShowS
[Sandbox] -> ShowS
Sandbox -> String
(Int -> Sandbox -> ShowS)
-> (Sandbox -> String) -> ([Sandbox] -> ShowS) -> Show Sandbox
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Sandbox -> ShowS
showsPrec :: Int -> Sandbox -> ShowS
$cshow :: Sandbox -> String
show :: Sandbox -> String
$cshowList :: [Sandbox] -> ShowS
showList :: [Sandbox] -> ShowS
Show, ReadPrec [Sandbox]
ReadPrec Sandbox
Int -> ReadS Sandbox
ReadS [Sandbox]
(Int -> ReadS Sandbox)
-> ReadS [Sandbox]
-> ReadPrec Sandbox
-> ReadPrec [Sandbox]
-> Read Sandbox
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS Sandbox
readsPrec :: Int -> ReadS Sandbox
$creadList :: ReadS [Sandbox]
readList :: ReadS [Sandbox]
$creadPrec :: ReadPrec Sandbox
readPrec :: ReadPrec Sandbox
$creadListPrec :: ReadPrec [Sandbox]
readListPrec :: ReadPrec [Sandbox]
Read, Int -> Sandbox
Sandbox -> Int
Sandbox -> [Sandbox]
Sandbox -> Sandbox
Sandbox -> Sandbox -> [Sandbox]
Sandbox -> Sandbox -> Sandbox -> [Sandbox]
(Sandbox -> Sandbox)
-> (Sandbox -> Sandbox)
-> (Int -> Sandbox)
-> (Sandbox -> Int)
-> (Sandbox -> [Sandbox])
-> (Sandbox -> Sandbox -> [Sandbox])
-> (Sandbox -> Sandbox -> [Sandbox])
-> (Sandbox -> Sandbox -> Sandbox -> [Sandbox])
-> Enum Sandbox
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: Sandbox -> Sandbox
succ :: Sandbox -> Sandbox
$cpred :: Sandbox -> Sandbox
pred :: Sandbox -> Sandbox
$ctoEnum :: Int -> Sandbox
toEnum :: Int -> Sandbox
$cfromEnum :: Sandbox -> Int
fromEnum :: Sandbox -> Int
$cenumFrom :: Sandbox -> [Sandbox]
enumFrom :: Sandbox -> [Sandbox]
$cenumFromThen :: Sandbox -> Sandbox -> [Sandbox]
enumFromThen :: Sandbox -> Sandbox -> [Sandbox]
$cenumFromTo :: Sandbox -> Sandbox -> [Sandbox]
enumFromTo :: Sandbox -> Sandbox -> [Sandbox]
$cenumFromThenTo :: Sandbox -> Sandbox -> Sandbox -> [Sandbox]
enumFromThenTo :: Sandbox -> Sandbox -> Sandbox -> [Sandbox]
Enum, Sandbox
Sandbox -> Sandbox -> Bounded Sandbox
forall a. a -> a -> Bounded a
$cminBound :: Sandbox
minBound :: Sandbox
$cmaxBound :: Sandbox
maxBound :: Sandbox
Bounded)
declareForeign ::
Sandbox ->
ForeignOp ->
ForeignFunc ->
FDecl Symbol ()
declareForeign :: Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
sand ForeignOp
op ForeignFunc
func = do
(Map ForeignFunc (Sandbox, SuperNormal Symbol)
-> Map ForeignFunc (Sandbox, SuperNormal Symbol))
-> FDecl Symbol ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify ((Map ForeignFunc (Sandbox, SuperNormal Symbol)
-> Map ForeignFunc (Sandbox, SuperNormal Symbol))
-> FDecl Symbol ())
-> (Map ForeignFunc (Sandbox, SuperNormal Symbol)
-> Map ForeignFunc (Sandbox, SuperNormal Symbol))
-> FDecl Symbol ()
forall a b. (a -> b) -> a -> b
$ \Map ForeignFunc (Sandbox, SuperNormal Symbol)
funcs ->
let code :: SuperNormal Symbol
code = ([Mem] -> ANormal Symbol -> SuperNormal Symbol)
-> ([Mem], ANormal Symbol) -> SuperNormal Symbol
forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry [Mem] -> ANormal Symbol -> SuperNormal Symbol
forall v. [Mem] -> ANormal v -> SuperNormal v
Lambda (ForeignOp
op ForeignFunc
func)
in (ForeignFunc
-> (Sandbox, SuperNormal Symbol)
-> Map ForeignFunc (Sandbox, SuperNormal Symbol)
-> Map ForeignFunc (Sandbox, SuperNormal Symbol)
forall k a. Ord k => k -> a -> Map k a -> Map k a
Map.insert ForeignFunc
func (Sandbox
sand, SuperNormal Symbol
code) Map ForeignFunc (Sandbox, SuperNormal Symbol)
funcs)
unitValue :: Val
unitValue :: Val
unitValue = Closure -> Val
BoxedVal (Closure -> Val) -> Closure -> Val
forall a b. (a -> b) -> a -> b
$ Reference -> PackedTag -> Closure
Closure.Enum Reference
Ty.unitRef (Word64 -> PackedTag
PackedTag Word64
0)
natValue :: Word64 -> Val
natValue :: Word64 -> Val
natValue Word64
w = Word64 -> Val
NatVal Word64
w
declareUdpForeigns :: FDecl Symbol ()
declareUdpForeigns :: FDecl Symbol ()
declareUdpForeigns = do
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
arg2ToEF ForeignFunc
IO_UDP_clientSocket_impl_v1
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEF ForeignFunc
IO_UDP_UDPSocket_recv_impl_v1
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
arg2ToEF0 ForeignFunc
IO_UDP_UDPSocket_send_impl_v1
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEF0 ForeignFunc
IO_UDP_UDPSocket_close_impl_v1
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEF0 ForeignFunc
IO_UDP_ListenSocket_close_impl_v1
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
IO_UDP_UDPSocket_toText_impl_v1
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
arg2ToEF ForeignFunc
IO_UDP_serverSocket_impl_v1
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
IO_UDP_ListenSocket_toText_impl_v1
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEFTup ForeignFunc
IO_UDP_ListenSocket_recvFrom_impl_v1
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
IO_UDP_ClientSockAddr_toText_v1
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
arg3ToEF0 ForeignFunc
IO_UDP_ListenSocket_sendTo_impl_v1
declareForeigns :: FDecl Symbol ()
declareForeigns :: FDecl Symbol ()
declareForeigns = do
FDecl Symbol ()
declareUdpForeigns
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argIomrToEF ForeignFunc
IO_openFile_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEF0 ForeignFunc
IO_closeFile_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEFBool ForeignFunc
IO_isFileEOF_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEFBool ForeignFunc
IO_isFileOpen_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEFBool ForeignFunc
IO_getEcho_impl_v1
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEFBool ForeignFunc
IO_ready_impl_v1
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEFChar ForeignFunc
IO_getChar_impl_v1
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEFBool ForeignFunc
IO_isSeekable_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
seek'handle ForeignFunc
IO_seekHandle_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEFNat ForeignFunc
IO_handlePosition_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
get'buffering ForeignFunc
IO_getBuffering_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
set'buffering ForeignFunc
IO_setBuffering_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
set'echo ForeignFunc
IO_setEcho_impl_v1
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEF ForeignFunc
IO_getLine_impl_v1
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
arg2ToEF ForeignFunc
IO_getBytes_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
arg2ToEF ForeignFunc
IO_getSomeBytes_impl_v1
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
arg2ToEF0 ForeignFunc
IO_putBytes_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
unitToEF ForeignFunc
IO_systemTime_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
unitToR ForeignFunc
IO_systemTimeMicroseconds_v1
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
unitToEF ForeignFunc
Clock_internals_monotonic_v1
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
unitToEF ForeignFunc
Clock_internals_realtime_v1
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
unitToEF ForeignFunc
Clock_internals_processCPUTime_v1
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
unitToEF ForeignFunc
Clock_internals_threadCPUTime_v1
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Clock_internals_sec_v1
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Clock_internals_nsec_v1
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
time'zone ForeignFunc
Clock_internals_systemTimeZone_v1
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
unitToEF ForeignFunc
IO_getTempDirectory_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEF ForeignFunc
IO_createTempDirectory_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
unitToEF ForeignFunc
IO_getCurrentDirectory_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEF0 ForeignFunc
IO_setCurrentDirectory_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEFBool ForeignFunc
IO_fileExists_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEF ForeignFunc
IO_getEnv_impl_v1
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
unitToEF ForeignFunc
IO_getArgs_impl_v1
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEFBool ForeignFunc
IO_isDirectory_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEF0 ForeignFunc
IO_createDirectory_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEF0 ForeignFunc
IO_removeDirectory_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
arg2ToEF0 ForeignFunc
IO_renameDirectory_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEF ForeignFunc
IO_directoryContents_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEF0 ForeignFunc
IO_removeFile_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
arg2ToEF0 ForeignFunc
IO_renameFile_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEFNat ForeignFunc
IO_getFileTimestamp_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEFNat ForeignFunc
IO_getFileSize_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
maybeToEF ForeignFunc
IO_serverSocket_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Socket_toText
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Handle_toText
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
ThreadId_toText
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEFNat ForeignFunc
IO_socketPort_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEF0 ForeignFunc
IO_listen_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
arg2ToEF ForeignFunc
IO_clientSocket_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEF0 ForeignFunc
IO_closeSocket_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEF ForeignFunc
IO_socketAccept_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
arg2ToEF0 ForeignFunc
IO_socketSend_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
arg2ToEF ForeignFunc
IO_socketReceive_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEF0 ForeignFunc
IO_kill_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEFUnit ForeignFunc
IO_delay_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
standard'handle ForeignFunc
IO_stdHandle
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
2) ForeignFunc
IO_process_call
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
start'process ForeignFunc
IO_process_start
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToUnit ForeignFunc
IO_process_kill
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
IO_process_wait
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToMaybe ForeignFunc
IO_process_exitCode
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
MVar_new
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
unitDirect ForeignFunc
MVar_newEmpty_v2
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEF ForeignFunc
MVar_take_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToMaybe ForeignFunc
MVar_tryTake
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
arg2ToEF0 ForeignFunc
MVar_put_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
arg2ToEFBool ForeignFunc
MVar_tryPut_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
arg2ToEF ForeignFunc
MVar_swap_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
MVar_isEmpty
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEF ForeignFunc
MVar_read_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEFM ForeignFunc
MVar_tryRead_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Char_toText
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
2) ForeignFunc
Text_repeat
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Text_reverse
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Text_toUppercase
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Text_toLowercase
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Text_toUtf8
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
argToEF ForeignFunc
Text_fromUtf8_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
2) ForeignFunc
Tls_ClientConfig_default
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
2) ForeignFunc
Tls_ServerConfig_default
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
2) ForeignFunc
Tls_ClientConfig_certificates_set
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
2) ForeignFunc
Tls_ServerConfig_certificates_set
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
TVar_new
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
TVar_read
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
arg2To0 ForeignFunc
TVar_write
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
TVar_newIO
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
TVar_readIO
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
2) ForeignFunc
TVar_swap
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
unitDirect ForeignFunc
STM_retry
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
unitDirect ForeignFunc
Promise_new
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Promise_read
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToMaybe ForeignFunc
Promise_tryRead
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
2) ForeignFunc
Promise_write
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
arg2ToEF ForeignFunc
Tls_newClient_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
arg2ToEF ForeignFunc
Tls_newServer_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEF0 ForeignFunc
Tls_handshake_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
arg2ToEF0 ForeignFunc
Tls_send_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEF ForeignFunc
Tls_decodeCert_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Tls_encodeCert
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Tls_decodePrivateKey
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Tls_encodePrivateKey
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEF ForeignFunc
Tls_receive_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked ForeignOp
argToEF0 ForeignFunc
Tls_terminate_impl_v3
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
argToExnE ForeignFunc
Code_validateLinks
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Code_dependencies
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Code_serialize
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
argToEither ForeignFunc
Code_deserialize
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
2) ForeignFunc
Code_display
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Value_dependencies
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Value_serialize
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
argToEither ForeignFunc
Value_deserialize
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
direct ForeignFunc
Crypto_HashAlgorithm_Sha3_512
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
direct ForeignFunc
Crypto_HashAlgorithm_Sha3_256
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
direct ForeignFunc
Crypto_HashAlgorithm_Sha2_512
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
direct ForeignFunc
Crypto_HashAlgorithm_Sha2_256
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
direct ForeignFunc
Crypto_HashAlgorithm_Sha1
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
direct ForeignFunc
Crypto_HashAlgorithm_Blake2b_512
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
direct ForeignFunc
Crypto_HashAlgorithm_Blake2b_256
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
direct ForeignFunc
Crypto_HashAlgorithm_Blake2s_256
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
direct ForeignFunc
Crypto_HashAlgorithm_Md5
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
2) ForeignFunc
Crypto_hashBytes
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
3) ForeignFunc
Crypto_hmacBytes
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
crypto'hash ForeignFunc
Crypto_hash
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
crypto'hmac ForeignFunc
Crypto_hmac
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg3ToEF ForeignFunc
Crypto_Ed25519_sign_impl
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg3ToEFBool ForeignFunc
Crypto_Ed25519_verify_impl
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg2ToEF ForeignFunc
Crypto_Rsa_sign_impl
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg3ToEFBool ForeignFunc
Crypto_Rsa_verify_impl
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
murmur'hash ForeignFunc
Universal_murmurHash
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
IO_randomBytes
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Bytes_zlib_compress
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Bytes_gzip_compress
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
argToEither ForeignFunc
Bytes_zlib_decompress
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
argToEither ForeignFunc
Bytes_gzip_decompress
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Bytes_toBase16
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Bytes_toBase32
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Bytes_toBase64
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Bytes_toBase64UrlUnpadded
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
argToEither ForeignFunc
Bytes_fromBase16
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
argToEither ForeignFunc
Bytes_fromBase32
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
argToEither ForeignFunc
Bytes_fromBase64
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
argToEither ForeignFunc
Bytes_fromBase64UrlUnpadded
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
argToMaybeNTup ForeignFunc
Bytes_decodeNat64be
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
argToMaybeNTup ForeignFunc
Bytes_decodeNat64le
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
argToMaybeNTup ForeignFunc
Bytes_decodeNat32be
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
argToMaybeNTup ForeignFunc
Bytes_decodeNat32le
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
argToMaybeNTup ForeignFunc
Bytes_decodeNat16be
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
argToMaybeNTup ForeignFunc
Bytes_decodeNat16le
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Bytes_encodeNat64be
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Bytes_encodeNat64le
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Bytes_encodeNat32be
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Bytes_encodeNat32le
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Bytes_encodeNat16be
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Bytes_encodeNat16le
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg5ToExnUnit ForeignFunc
MutableArray_copyTo_force
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg5ToExnUnit ForeignFunc
MutableByteArray_copyTo_force
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg5ToExnUnit ForeignFunc
ImmutableArray_copyTo_force
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
ImmutableArray_size
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
MutableArray_size
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
ImmutableByteArray_size
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
MutableByteArray_size
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg5ToExnUnit ForeignFunc
ImmutableByteArray_copyTo_force
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg2ToExn ForeignFunc
MutableArray_read
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg2ToExn ForeignFunc
MutableByteArray_read8
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg2ToExn ForeignFunc
MutableByteArray_read16be
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg2ToExn ForeignFunc
MutableByteArray_read24be
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg2ToExn ForeignFunc
MutableByteArray_read32be
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg2ToExn ForeignFunc
MutableByteArray_read40be
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg2ToExn ForeignFunc
MutableByteArray_read64be
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg3ToExnUnit ForeignFunc
MutableArray_write
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg3ToExnUnit ForeignFunc
MutableByteArray_write8
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg3ToExnUnit ForeignFunc
MutableByteArray_write16be
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg3ToExnUnit ForeignFunc
MutableByteArray_write32be
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg3ToExnUnit ForeignFunc
MutableByteArray_write64be
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg2ToExn ForeignFunc
ImmutableArray_read
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg2ToExn ForeignFunc
ImmutableByteArray_read8
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg2ToExn ForeignFunc
ImmutableByteArray_read16be
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg2ToExn ForeignFunc
ImmutableByteArray_read24be
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg2ToExn ForeignFunc
ImmutableByteArray_read32be
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg2ToExn ForeignFunc
ImmutableByteArray_read40be
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg2ToExn ForeignFunc
ImmutableByteArray_read64be
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
MutableByteArray_freeze_force
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
MutableArray_freeze_force
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg3ToExn ForeignFunc
MutableByteArray_freeze
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg3ToExn ForeignFunc
MutableArray_freeze
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
MutableByteArray_length
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
ImmutableByteArray_length
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
IO_array
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
2) ForeignFunc
IO_arrayOf
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
IO_bytearray
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Tracked (Int -> ForeignOp
argNDirect Int
2) ForeignFunc
IO_bytearrayOf
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Scope_array
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
2) ForeignFunc
Scope_arrayOf
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Scope_bytearray
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
2) ForeignFunc
Scope_bytearrayOf
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Text_patterns_literal
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
direct ForeignFunc
Text_patterns_digit
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
direct ForeignFunc
Text_patterns_letter
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
direct ForeignFunc
Text_patterns_space
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
direct ForeignFunc
Text_patterns_punctuation
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
direct ForeignFunc
Text_patterns_anyChar
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
direct ForeignFunc
Text_patterns_eof
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
2) ForeignFunc
Text_patterns_charRange
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
2) ForeignFunc
Text_patterns_notCharRange
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Text_patterns_charIn
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Text_patterns_notCharIn
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Pattern_many
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Pattern_many_corrected
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Pattern_capture
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
2) ForeignFunc
Pattern_captureAs
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Pattern_join
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
2) ForeignFunc
Pattern_or
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
3) ForeignFunc
Pattern_replicate
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
arg2ToMaybeTup ForeignFunc
Pattern_run
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
2) ForeignFunc
Pattern_isMatch
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
direct ForeignFunc
Char_Class_any
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Char_Class_not
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
2) ForeignFunc
Char_Class_and
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
2) ForeignFunc
Char_Class_or
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
2) ForeignFunc
Char_Class_range
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Char_Class_anyOf
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
direct ForeignFunc
Char_Class_alphanumeric
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
direct ForeignFunc
Char_Class_upper
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
direct ForeignFunc
Char_Class_lower
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
direct ForeignFunc
Char_Class_whitespace
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
direct ForeignFunc
Char_Class_control
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
direct ForeignFunc
Char_Class_printable
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
direct ForeignFunc
Char_Class_mark
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
direct ForeignFunc
Char_Class_number
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
direct ForeignFunc
Char_Class_punctuation
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
direct ForeignFunc
Char_Class_symbol
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
direct ForeignFunc
Char_Class_separator
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked ForeignOp
direct ForeignFunc
Char_Class_letter
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
2) ForeignFunc
Char_Class_is
Sandbox -> ForeignOp -> ForeignFunc -> FDecl Symbol ()
declareForeign Sandbox
Untracked (Int -> ForeignOp
argNDirect Int
1) ForeignFunc
Text_patterns_char
foreignDeclResults :: (Map ForeignFunc (Sandbox, SuperNormal Symbol))
foreignDeclResults :: Map ForeignFunc (Sandbox, SuperNormal Symbol)
foreignDeclResults =
FDecl Symbol ()
-> Map ForeignFunc (Sandbox, SuperNormal Symbol)
-> Map ForeignFunc (Sandbox, SuperNormal Symbol)
forall s a. State s a -> s -> s
execState FDecl Symbol ()
declareForeigns Map ForeignFunc (Sandbox, SuperNormal Symbol)
forall a. Monoid a => a
mempty
foreignWrappers :: [(Data.Text.Text, (Sandbox, SuperNormal Symbol))]
foreignWrappers :: [(Text, (Sandbox, SuperNormal Symbol))]
foreignWrappers =
Map ForeignFunc (Sandbox, SuperNormal Symbol)
-> [(ForeignFunc, (Sandbox, SuperNormal Symbol))]
forall k a. Map k a -> [(k, a)]
Map.toList Map ForeignFunc (Sandbox, SuperNormal Symbol)
foreignDeclResults
[(ForeignFunc, (Sandbox, SuperNormal Symbol))]
-> ((ForeignFunc, (Sandbox, SuperNormal Symbol))
-> (Text, (Sandbox, SuperNormal Symbol)))
-> [(Text, (Sandbox, SuperNormal Symbol))]
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \(ForeignFunc
ff, (Sandbox
sand, SuperNormal Symbol
code)) -> (ForeignFunc -> Text
foreignFuncBuiltinName ForeignFunc
ff, (Sandbox
sand, SuperNormal Symbol
code))
numberedTermLookup :: EnumMap Word64 (SuperNormal Symbol)
numberedTermLookup :: EnumMap Word64 (SuperNormal Symbol)
numberedTermLookup =
[(Word64, SuperNormal Symbol)]
-> EnumMap Word64 (SuperNormal Symbol)
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList ([(Word64, SuperNormal Symbol)]
-> EnumMap Word64 (SuperNormal Symbol))
-> (Map Reference (Sandbox, SuperNormal Symbol)
-> [(Word64, SuperNormal Symbol)])
-> Map Reference (Sandbox, SuperNormal Symbol)
-> EnumMap Word64 (SuperNormal Symbol)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Word64] -> [SuperNormal Symbol] -> [(Word64, SuperNormal Symbol)]
forall a b. [a] -> [b] -> [(a, b)]
zip [Word64
1 ..] ([SuperNormal Symbol] -> [(Word64, SuperNormal Symbol)])
-> (Map Reference (Sandbox, SuperNormal Symbol)
-> [SuperNormal Symbol])
-> Map Reference (Sandbox, SuperNormal Symbol)
-> [(Word64, SuperNormal Symbol)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Map Reference (SuperNormal Symbol) -> [SuperNormal Symbol]
forall k a. Map k a -> [a]
Map.elems (Map Reference (SuperNormal Symbol) -> [SuperNormal Symbol])
-> (Map Reference (Sandbox, SuperNormal Symbol)
-> Map Reference (SuperNormal Symbol))
-> Map Reference (Sandbox, SuperNormal Symbol)
-> [SuperNormal Symbol]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Sandbox, SuperNormal Symbol) -> SuperNormal Symbol)
-> Map Reference (Sandbox, SuperNormal Symbol)
-> Map Reference (SuperNormal Symbol)
forall a b. (a -> b) -> Map Reference a -> Map Reference b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (Sandbox, SuperNormal Symbol) -> SuperNormal Symbol
forall a b. (a, b) -> b
snd (Map Reference (Sandbox, SuperNormal Symbol)
-> EnumMap Word64 (SuperNormal Symbol))
-> Map Reference (Sandbox, SuperNormal Symbol)
-> EnumMap Word64 (SuperNormal Symbol)
forall a b. (a -> b) -> a -> b
$ Map Reference (Sandbox, SuperNormal Symbol)
builtinLookup
builtinTermNumbering :: Map Reference Word64
builtinTermNumbering :: Map Reference Word64
builtinTermNumbering =
[(Reference, Word64)] -> Map Reference Word64
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList ([Reference] -> [Word64] -> [(Reference, Word64)]
forall a b. [a] -> [b] -> [(a, b)]
zip (Map Reference (Sandbox, SuperNormal Symbol) -> [Reference]
forall k a. Map k a -> [k]
Map.keys (Map Reference (Sandbox, SuperNormal Symbol) -> [Reference])
-> Map Reference (Sandbox, SuperNormal Symbol) -> [Reference]
forall a b. (a -> b) -> a -> b
$ Map Reference (Sandbox, SuperNormal Symbol)
builtinLookup) [Word64
1 ..])
builtinTermBackref :: EnumMap Word64 Reference
builtinTermBackref :: EnumMap Word64 Reference
builtinTermBackref =
[(Word64, Reference)] -> EnumMap Word64 Reference
forall k a. EnumKey k => [(k, a)] -> EnumMap k a
mapFromList ([(Word64, Reference)] -> EnumMap Word64 Reference)
-> (Map Reference (Sandbox, SuperNormal Symbol)
-> [(Word64, Reference)])
-> Map Reference (Sandbox, SuperNormal Symbol)
-> EnumMap Word64 Reference
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Word64] -> [Reference] -> [(Word64, Reference)]
forall a b. [a] -> [b] -> [(a, b)]
zip [Word64
1 ..] ([Reference] -> [(Word64, Reference)])
-> (Map Reference (Sandbox, SuperNormal Symbol) -> [Reference])
-> Map Reference (Sandbox, SuperNormal Symbol)
-> [(Word64, Reference)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Map Reference (Sandbox, SuperNormal Symbol) -> [Reference]
forall k a. Map k a -> [k]
Map.keys (Map Reference (Sandbox, SuperNormal Symbol)
-> EnumMap Word64 Reference)
-> Map Reference (Sandbox, SuperNormal Symbol)
-> EnumMap Word64 Reference
forall a b. (a -> b) -> a -> b
$ Map Reference (Sandbox, SuperNormal Symbol)
builtinLookup
builtinForeignNames :: Map ForeignFunc Data.Text.Text
builtinForeignNames :: Map ForeignFunc Text
builtinForeignNames =
Map ForeignFunc (Sandbox, SuperNormal Symbol)
foreignDeclResults
Map ForeignFunc (Sandbox, SuperNormal Symbol)
-> (Map ForeignFunc (Sandbox, SuperNormal Symbol) -> [ForeignFunc])
-> [ForeignFunc]
forall a b. a -> (a -> b) -> b
& Map ForeignFunc (Sandbox, SuperNormal Symbol) -> [ForeignFunc]
forall k a. Map k a -> [k]
Map.keys
[ForeignFunc]
-> ([ForeignFunc] -> [(ForeignFunc, Text)])
-> [(ForeignFunc, Text)]
forall a b. a -> (a -> b) -> b
& (ForeignFunc -> (ForeignFunc, Text))
-> [ForeignFunc] -> [(ForeignFunc, Text)]
forall a b. (a -> b) -> [a] -> [b]
map (\ForeignFunc
f -> (ForeignFunc
f, ForeignFunc -> Text
foreignFuncBuiltinName ForeignFunc
f))
[(ForeignFunc, Text)]
-> ([(ForeignFunc, Text)] -> Map ForeignFunc Text)
-> Map ForeignFunc Text
forall a b. a -> (a -> b) -> b
& [(ForeignFunc, Text)] -> Map ForeignFunc Text
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList
baseSandboxInfo :: Map Reference (Set Reference)
baseSandboxInfo :: Map Reference (Set Reference)
baseSandboxInfo =
[(Reference, Set Reference)] -> Map Reference (Set Reference)
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList ([(Reference, Set Reference)] -> Map Reference (Set Reference))
-> [(Reference, Set Reference)] -> Map Reference (Set Reference)
forall a b. (a -> b) -> a -> b
$
[ (Reference
r, Reference -> Set Reference
forall a. a -> Set a
Set.singleton Reference
r)
| (Reference
r, (Sandbox
sb, SuperNormal Symbol
_)) <- Map Reference (Sandbox, SuperNormal Symbol)
-> [(Reference, (Sandbox, SuperNormal Symbol))]
forall k a. Map k a -> [(k, a)]
Map.toList Map Reference (Sandbox, SuperNormal Symbol)
builtinLookup,
Sandbox
sb Sandbox -> Sandbox -> Bool
forall a. Eq a => a -> a -> Bool
== Sandbox
Tracked
]
builtinArities :: Map Reference Int
builtinArities :: Map Reference Int
builtinArities =
[(Reference, Int)] -> Map Reference Int
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList ([(Reference, Int)] -> Map Reference Int)
-> [(Reference, Int)] -> Map Reference Int
forall a b. (a -> b) -> a -> b
$
[(Reference
r, SuperNormal Symbol -> Int
forall v. SuperNormal v -> Int
arity SuperNormal Symbol
s) | (Reference
r, (Sandbox
_, SuperNormal Symbol
s)) <- Map Reference (Sandbox, SuperNormal Symbol)
-> [(Reference, (Sandbox, SuperNormal Symbol))]
forall k a. Map k a -> [(k, a)]
Map.toList Map Reference (Sandbox, SuperNormal Symbol)
builtinLookup]
builtinInlineInfo :: Map Reference (Int, ANormal Symbol)
builtinInlineInfo :: Map Reference (Int, ANormal Symbol)
builtinInlineInfo =
Map Reference (SuperGroup Symbol)
-> Map Reference (Int, ANormal Symbol)
forall v.
Var v =>
Map Reference (SuperGroup v) -> Map Reference (Int, ANormal v)
ANF.buildInlineMap (Map Reference (SuperGroup Symbol)
-> Map Reference (Int, ANormal Symbol))
-> Map Reference (SuperGroup Symbol)
-> Map Reference (Int, ANormal Symbol)
forall a b. (a -> b) -> a -> b
$ ((Sandbox, SuperNormal Symbol) -> SuperGroup Symbol)
-> Map Reference (Sandbox, SuperNormal Symbol)
-> Map Reference (SuperGroup Symbol)
forall a b. (a -> b) -> Map Reference a -> Map Reference b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ([(Symbol, SuperNormal Symbol)]
-> SuperNormal Symbol -> SuperGroup Symbol
forall v. [(v, SuperNormal v)] -> SuperNormal v -> SuperGroup v
Rec [] (SuperNormal Symbol -> SuperGroup Symbol)
-> ((Sandbox, SuperNormal Symbol) -> SuperNormal Symbol)
-> (Sandbox, SuperNormal Symbol)
-> SuperGroup Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Sandbox, SuperNormal Symbol) -> SuperNormal Symbol
forall a b. (a, b) -> b
snd) Map Reference (Sandbox, SuperNormal Symbol)
builtinLookup
sandboxedForeignFuncs :: Set ForeignFunc
sandboxedForeignFuncs :: Set ForeignFunc
sandboxedForeignFuncs =
Map ForeignFunc (Sandbox, SuperNormal Symbol) -> Set ForeignFunc
forall k a. Map k a -> Set k
Map.keysSet (Map ForeignFunc (Sandbox, SuperNormal Symbol) -> Set ForeignFunc)
-> Map ForeignFunc (Sandbox, SuperNormal Symbol) -> Set ForeignFunc
forall a b. (a -> b) -> a -> b
$
((Sandbox, SuperNormal Symbol) -> Bool)
-> Map ForeignFunc (Sandbox, SuperNormal Symbol)
-> Map ForeignFunc (Sandbox, SuperNormal Symbol)
forall a k. (a -> Bool) -> Map k a -> Map k a
Map.filter (\(Sandbox
sb, SuperNormal Symbol
_) -> Sandbox
sb Sandbox -> Sandbox -> Bool
forall a. Eq a => a -> a -> Bool
== Sandbox
Tracked) Map ForeignFunc (Sandbox, SuperNormal Symbol)
foreignDeclResults