val project_one_frag: #i:id -> f:C.fragment i -> Tot (Seq.seq (DS.delta i))
val project_one_frag: #i:id -> f:C.fragment i -> Tot (Seq.seq (DS.delta i))
let project_one_frag #i = function
    | C.CT_Data rg d -> 
      let d : DS.pre_fragment i = d in //A widening coercion as a proof hint, unpacking (d:fragment i (frange i)) to a pre_fr
      singleton (DataStream.Data d)
    | C.CT_Alert _ ad -> singleton (DataStream.Alert ad)
    | _ -> Seq.empty
module MiTLS.StreamDeltas
open MiTLS

open FStar.Bytes
open FStar.Error

open MiTLS.Mem
open FStar.HyperStack
open MiTLS.TLSConstants
open MiTLS.TLSInfo

module HS   = FStar.HyperStack
module HST = FStar.HyperStack.ST //Added automatically; avoid.
module MS   = FStar.Monotonic.Seq
module S    = MiTLS.StAE
module C    = MiTLS.Content
module DS   = MiTLS.DataStream

let deltas i = Seq.seq (DS.delta i) //not yet handling the well-formedness condition of final deltas

let singleton (x:'a) : Tot (Seq.seq 'a) = Seq.create 1 x

#reset-options "--initial_fuel 1 --max_fuel 1 --initial_ifuel 1 --max_ifuel 1"

private type id = i:id{~(PlaintextID? i)}
/
prims.fst.checked MiTLS.TLSInfo.fst.checked MiTLS.TLSConstants.fsti.checked MiTLS.StAE.fst.checked MiTLS.Mem.fst.checked MiTLS.DataStream.fst.checked MiTLS.Content.fst.checked FStar.Seq.fst.checked FStar.Pervasives.fsti.checked FStar.Monotonic.Seq.fst.checked FStar.HyperStack.ST.fsti.checked FStar.HyperStack.fst.checked FStar.Error.fst.checked FStar.Classical.fsti.checked FStar.Bytes.fsti.checked
MiTLS.StreamDeltas.fst
f: MiTLS.Content.fragment i -> FStar.Seq.Base.seq (MiTLS.DataStream.delta i)
MiTLS.StreamDeltas.id MiTLS.Content.fragment MiTLS.Range.frange MiTLS.DataStream.fragment MiTLS.StreamDeltas.singleton MiTLS.DataStream.delta MiTLS.DataStream.Data MiTLS.DataStream.pre_fragment Prims.b2t MiTLS.Range.wider MiTLS.Range.point MiTLS.Parsers.Alert.alert MiTLS.DataStream.Alert FStar.Seq.Base.empty FStar.Seq.Base.seq
let project_one_frag #i =
  
function
| C.CT_Data rg d ->
  let d:DS.pre_fragment i = d in
  singleton (DataStream.Data d)
| C.CT_Alert _ ad -> singleton (DataStream.Alert ad)
| _ -> Seq.empty