module State
noeq
type table_name (r: Type0) =
{ te: Type0; get: r -> Seq.seq te; }
let return_table (#t: Type0) (tabs: t) (tn: table_name t) : Seq.seq tn.te =
tn.get tabs
After extraction by running fstar.exe State.fst --codegen OCaml, F* returns the following OCaml code (omitting projectors for brevity):
open Prims
type 'r table_name = {
te: unit ;
get: 'r -> Obj.t FStar_Seq_Base.seq }
let return_table : 't . 't -> 't table_name -> unit FStar_Seq_Base.seq =
fun tabs -> fun tn -> tn.get tabs
Attempting to compile this yields the following type error:
12 | fun tabs -> fun tn -> tn.get tabs
^^^^^^^^^^^
Error: This expression has type Obj.t FStar_Seq_Base.seq
but an expression was expected of type Prims.unit FStar_Seq_Base.seq
Type Obj.t is not compatible with type Prims.unit = unit
Consider the following (minimized) F* code:
After extraction by running
fstar.exe State.fst --codegen OCaml
, F* returns the following OCaml code (omitting projectors for brevity):Attempting to compile this yields the following type error:
This occurs with the following F* version: