We are hiring ! See our job offers.
swh:1:snp:aeaf3dbb58f5be84b565e73b5ade1503ee8cb6d6
Raw File
Tip revision: f94b06de7edcb61d3c49f19417e53dc7dc21d552 authored by Anish Tondwalkar on 22 June 2021, 08:13:54 UTC
updated README
Tip revision: f94b06d
tick.fst
module Tick

type tick (n:Ghost.erased nat) (a:Type) : Type =
| Tick : a -> tick n a


let pure (#a:Type) (x:a) : tick 0 a = Tick x

let app (#n #m:Ghost.erased nat) (#a #b:Type) (Tick f:tick n (a -> b)) (Tick x:tick m a)
: tick (n + m + 1) b
= Tick (f x)

module L = FStar.List.Tot

let rec append (#a:Type) (xs ys:list a)
: tick (L.length xs) (list a)
= match xs with
  | []    -> pure ys
  | x::xs -> pure (Cons x) `app` append xs ys
back to top