From 8791efda0cf7392144117cf780bfb6d687d2da5e Mon Sep 17 00:00:00 2001 From: Chloe Brown Date: Tue, 4 Jul 2023 12:29:30 +0100 Subject: Add more built-in functions. --- src/Encoded/Container.idr | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'src/Encoded/Container.idr') diff --git a/src/Encoded/Container.idr b/src/Encoded/Container.idr index 1334bc2..800623a 100644 --- a/src/Encoded/Container.idr +++ b/src/Encoded/Container.idr @@ -83,31 +83,28 @@ getFuel : {cont : Container} -> {c : Case} -> Term (semCase c (W cont) ~> N) ctx -getFuel {c = (tag, k)} = App foldr [ Term (Fin k ~> (N ~> N * N) ~> (N ~> N * N)) ctx -stepOffset = Abs $ Abs $ Abs $ - let i = Var (There $ There Here) in - let f = Var (There Here) in - let x = Var Here in +stepOffset = AbsAll [<_,_,_] (\[ App bimap -- Suc is for the initial tag - [ Suc $ App forget [ Op (Lit k) * n) , App f [ {c : Case} -> Term (semCase c (W cont) ~> N ~> N * N) ctx -getOffset {c = (tag, 0)} = Const $ Const $ App pair [ - App cons - [ let dm = App (divmod' k) [ N ~> N) ctx -calcIndex = Abs' (\bs => App (plus . fst) [ App fst [ -- cgit v1.2.3