swh:1:snp:aeaf3dbb58f5be84b565e73b5ade1503ee8cb6d6
Tip revision: b6407e0f026cf5491ca5ed0a35ea5cf316ebe8ca authored by Anish Tondwalkar on 21 May 2021, 03:15:25 UTC
formatted for submission
formatted for submission
Tip revision: b6407e0
flar.fst
module Flar
noeq
type flar (out:int) =
| Flar : (int -> v:int{v = out}) -> flar out
val appFlar (#out:int) (f:flar out) (x:int) : v:int{v = out}
let appFlar #out f x = match f with
| Flar f -> f x
val incr : #n:int -> f:(flar n) -> v:int{v = n + 1}
let incr #n f = (appFlar f 0) + 1
val test1 : v:int{v = 11}
let test1 = incr (Flar (fun x -> 10))