From 3f82691629db1e4e59782558716d2a09be07cf57 Mon Sep 17 00:00:00 2001 From: Smaug123 <3138005+Smaug123@users.noreply.github.com> Date: Wed, 29 May 2024 23:21:47 +0100 Subject: [PATCH 1/3] Add Choice teq --- ShapeSifter.Test/TestPatterns.fs | 260 +++++++++++++++++-------------- ShapeSifter/Patterns.fs | 2 + ShapeSifter/Patterns.fsi | 3 + ShapeSifter/TeqCrates.fs | 21 +++ ShapeSifter/TeqCrates.fsi | 26 ++++ 5 files changed, 193 insertions(+), 119 deletions(-) diff --git a/ShapeSifter.Test/TestPatterns.fs b/ShapeSifter.Test/TestPatterns.fs index e83d2aa..5509ac8 100644 --- a/ShapeSifter.Test/TestPatterns.fs +++ b/ShapeSifter.Test/TestPatterns.fs @@ -12,21 +12,52 @@ module TestPatterns = [] let ``Teq active pattern distinguishes int from string`` () = - let t1 = tType let t2 = tType match t1 with - | Teq t2 teq -> failwith "Expected int != string" + | Teq t2 _teq -> failwith "Expected int != string" | _ -> () + [] + let ``Option active pattern recognises an option`` () : unit = + let print (x : 'a) : string option = + match tType<'a> with + | Option crate -> + { new OptionTeqEvaluator<_, _> with + member _.Eval<'b> (teq : Teq<'a, 'b option>) = + Teq.castTo teq x |> Option.map (sprintf "%O") + } + |> crate.Apply + | _ -> failwith "should have received an option" + + print (Some 3) |> shouldEqual (Some "3") + print None |> shouldEqual None + + [] + let ``Choice2 active pattern recognises a choice`` () : unit = + let print (x : 'a) : Choice = + match tType<'a> with + | Choice2 crate -> + { new Choice2TeqEvaluator<_, _> with + member _.Eval teq = + match Teq.castTo teq x with + | Choice1Of2 c1 -> c1.ToString () |> Choice1Of2 + | Choice2Of2 c2 -> c2.ToString () |> Choice2Of2 + } + |> crate.Apply + | _ -> failwith "should have received a choice2" + + print (Choice1Of2 3) |> shouldEqual (Choice1Of2 "3") + print (Choice2Of2 "hi") |> shouldEqual (Choice2Of2 "hi") + let tryGetArrayLength (arr : 'a) : int option = match tType<'a> with | Array c -> - c.Apply - { new ArrayTeqEvaluator<_, _> with - member __.Eval teq = (Teq.castTo teq arr).Length |> Some - } + { new ArrayTeqEvaluator<_, _> with + member _.Eval teq = (Teq.castTo teq arr).Length |> Some + } + |> c.Apply | _ -> None [] @@ -39,7 +70,7 @@ module TestPatterns = | List c -> c.Apply { new ListTeqEvaluator<_, _> with - member __.Eval teq = + member _.Eval teq = xs |> Teq.castTo teq |> List.length |> Some } | _ -> None @@ -52,11 +83,11 @@ module TestPatterns = let tryGetMapCount (map : 'a) : int option = match tType<'a> with | Map c -> - c.Apply - { new MapTeqEvaluator<_, _> with - member __.Eval teq = - map |> Teq.castTo teq |> Map.count |> Some - } + { new MapTeqEvaluator<_, _> with + member _.Eval teq = + map |> Teq.castTo teq |> Map.count |> Some + } + |> c.Apply | _ -> None [] @@ -66,21 +97,19 @@ module TestPatterns = [] let ``Tuple active pattern recognises a tuple`` () = - let tuple = 5, "hello", false, 8, 2 let sumOfInts = Tuple.tryFoldTuple (HListFolder.makeElementFolder (+)) 0 tuple sumOfInts |> shouldEqual (Some 15) [] let ``Fun active pattern recognises a function`` () = - match tType string> with | Fun c -> let dom, ran = - c.Apply - { new FunTeqEvaluator<_, _> with - member __.Eval (teq : Teq string, 'a -> 'b>) = typeof<'a>, typeof<'b> - } + { new FunTeqEvaluator<_, _> with + member _.Eval (teq : Teq string, 'a -> 'b>) = typeof<'a>, typeof<'b> + } + |> c.Apply dom |> shouldEqual typeof ran |> shouldEqual typeof @@ -89,14 +118,13 @@ module TestPatterns = [] let ``Pair active pattern recognises a pair`` () = - match tType with | Pair c -> let t1, t2 = - c.Apply - { new PairTeqEvaluator<_, _> with - member __.Eval (teq : Teq) = typeof<'a>, typeof<'b> - } + { new PairTeqEvaluator<_, _> with + member _.Eval (teq : Teq) = typeof<'a>, typeof<'b> + } + |> c.Apply t1 |> shouldEqual typeof t2 |> shouldEqual typeof @@ -119,11 +147,10 @@ module TestPatterns = match tType with | Triple c -> let t1, t2, t3 = - c.Apply - { new TripleTeqEvaluator<_, _> with - member __.Eval (teq : Teq) = - typeof<'a>, typeof<'b>, typeof<'c> - } + { new TripleTeqEvaluator<_, _> with + member _.Eval (teq : Teq) = typeof<'a>, typeof<'b>, typeof<'c> + } + |> c.Apply t1 |> shouldEqual typeof t2 |> shouldEqual typeof @@ -141,31 +168,29 @@ module TestPatterns = let tryGetStringKeyValues (record : 'a) : Map option = match tType<'a> with | Record c -> - c.Apply - { new RecordConvEvaluator<_, _> with - member __.Eval names _ conv = + { new RecordConvEvaluator<_, _> with + member _.Eval names _ conv = + let folder = + let f (names : string list, map) (value : string option) = + let map = + match value with + | Some v -> Map.add (names |> List.head) v map + | None -> map - let folder = - let f (names : string list, map) (value : string option) = - let map = - match value with - | Some v -> Map.add (names |> List.head) v map - | None -> map + names |> List.tail, map - names |> List.tail, map + HListFolder.makeGappedElementFolder f - HListFolder.makeGappedElementFolder f + let names = names |> List.map TypeField.name - let names = names |> List.map TypeField.name - - record |> conv.To |> HList.fold folder (names, Map.empty) |> snd - } + record |> conv.To |> HList.fold folder (names, Map.empty) |> snd + } + |> c.Apply |> Some | _ -> None [] let ``Record active pattern recognises a record`` () = - let r = { Foo = "hello" @@ -188,79 +213,77 @@ module TestPatterns = [] let ``Union active pattern recognises a union`` () = - let testValue = Bar (1234, "test", true) let result = match tType with | Union c -> - c.Apply - { new UnionConvEvaluator<_, _> with - member __.Eval names ts (conv : Conv) = - - let expectedNames = [ "Foo" ; "Bar" ; "Baz" ; "Quux" ] - let actualNames = names |> List.map TypeField.name - actualNames |> shouldEqual expectedNames - - let expectedUnionType = - tType<(unit -> (int * string * bool) -> (string * float) -> string -> unit) HUnion> - - match tType<'a HUnion> with - | Teq expectedUnionType teq -> - let converted = testValue |> conv.To |> Teq.castTo teq - - match HUnion.split converted with - | Choice1Of2 v -> failwith "expected Choice2Of2" - | Choice2Of2 union -> - match HUnion.split union with - | Choice1Of2 (i : int, s : string, b : bool) -> - let convertedBack = converted |> Teq.castFrom teq |> conv.From - true - | Choice2Of2 _ -> failwith "expected Choice1Of2" - | _ -> failwith "expected Teq" - } + { new UnionConvEvaluator<_, _> with + member _.Eval names ts (conv : Conv) = + + let expectedNames = [ "Foo" ; "Bar" ; "Baz" ; "Quux" ] + let actualNames = names |> List.map TypeField.name + actualNames |> shouldEqual expectedNames + + let expectedUnionType = + tType<(unit -> int * string * bool -> string * float -> string -> unit) HUnion> + + match tType<'a HUnion> with + | Teq expectedUnionType teq -> + let converted = testValue |> conv.To |> Teq.castTo teq + + match HUnion.split converted with + | Choice1Of2 _ -> failwith "expected Choice2Of2" + | Choice2Of2 union -> + match HUnion.split union with + | Choice1Of2 (_ : int, _ : string, _ : bool) -> + let _convertedBack = converted |> Teq.castFrom teq |> conv.From + true + | Choice2Of2 _ -> failwith "expected Choice1Of2" + | _ -> failwith "expected Teq" + } + |> c.Apply | _ -> failwith "expected Union" result |> shouldEqual true [] let ``SumOfProducts active pattern recognises a union`` () = - let testValue = Bar (1234, "test", true) let result = match tType with | SumOfProducts c -> - c.Apply - { new SumOfProductsConvEvaluator<_, _> with - member __.Eval names ts (conv : Conv) = - - let expectedNames = [ "Foo" ; "Bar" ; "Baz" ; "Quux" ] - names |> shouldEqual expectedNames - - let expectedUnionType = - tType< - (unit - -> (int -> string -> bool -> unit) - -> (string -> float -> unit) - -> (string -> unit) - -> unit) SumOfProducts - > - - match tType<'a SumOfProducts> with - | Teq expectedUnionType teq -> - let converted = testValue |> conv.To |> Teq.castTo teq - - match SumOfProducts.split converted with - | Choice1Of2 v -> failwith "expected Choice2Of2" - | Choice2Of2 sop -> - match SumOfProducts.split sop with - | Choice1Of2 (xs : (int -> string -> bool -> unit) HList) -> - let convertedBack = converted |> Teq.castFrom teq |> conv.From - true - | Choice2Of2 _ -> failwith "expected Choice1Of2" - | _ -> failwith "expected a Teq" - } + { new SumOfProductsConvEvaluator<_, _> with + member _.Eval names ts (conv : Conv) = + + let expectedNames = [ "Foo" ; "Bar" ; "Baz" ; "Quux" ] + names |> shouldEqual expectedNames + + let expectedUnionType = + tType< + (unit + -> (int -> string -> bool -> unit) + -> (string -> float -> unit) + -> (string -> unit) + -> unit) SumOfProducts + > + + match tType<'a SumOfProducts> with + | Teq expectedUnionType teq -> + let converted = testValue |> conv.To |> Teq.castTo teq + + match SumOfProducts.split converted with + | Choice1Of2 _ -> failwith "expected Choice2Of2" + | Choice2Of2 sop -> + match SumOfProducts.split sop with + | Choice1Of2 (_ : (int -> string -> bool -> unit) HList) -> + let _convertedBack = converted |> Teq.castFrom teq |> conv.From + true + | Choice2Of2 _ -> failwith "expected Choice1Of2" + | _ -> failwith "expected a Teq" + } + |> c.Apply | _ -> failwith "expected a SumOfProducts" result |> shouldEqual true @@ -292,18 +315,18 @@ module TestPatterns = let result = match tType with | Record c -> - c.Apply - { new RecordConvEvaluator<_, _> with - member __.Eval<'a> names ts (conv : Conv) = + { new RecordConvEvaluator<_, _> with + member _.Eval<'a> names ts (conv : Conv) = - let expectedNames = [ "PrivateFoo" ; "PrivateBar" ; "PrivateBaz" ] + let expectedNames = [ "PrivateFoo" ; "PrivateBar" ; "PrivateBaz" ] - let actualNames = names |> List.map TypeField.name + let actualNames = names |> List.map TypeField.name - actualNames |> shouldEqual expectedNames + actualNames |> shouldEqual expectedNames - TypeList.toTypes ts = [ typeof ; typeof ; typeof ] - } + TypeList.toTypes ts = [ typeof ; typeof ; typeof ] + } + |> c.Apply | _ -> failwith "expected a record" result |> shouldEqual true @@ -318,7 +341,6 @@ module TestPatterns = [] let ``Record active pattern recognises a public record whose fields are private`` () = - let r = { InternallyPrivateFoo = "hello" @@ -337,19 +359,19 @@ module TestPatterns = let result = match tType with | Record c -> - c.Apply - { new RecordConvEvaluator<_, _> with - member __.Eval<'a> names ts (conv : Conv) = + { new RecordConvEvaluator<_, _> with + member _.Eval<'a> names ts (conv : Conv) = - let expectedNames = - [ "InternallyPrivateFoo" ; "InternallyPrivateBar" ; "InternallyPrivateBaz" ] + let expectedNames = + [ "InternallyPrivateFoo" ; "InternallyPrivateBar" ; "InternallyPrivateBaz" ] - let actualNames = names |> List.map TypeField.name + let actualNames = names |> List.map TypeField.name - actualNames |> shouldEqual expectedNames + actualNames |> shouldEqual expectedNames - TypeList.toTypes ts = [ typeof ; typeof ; typeof ] - } + TypeList.toTypes ts = [ typeof ; typeof ; typeof ] + } + |> c.Apply | _ -> failwith "expected a record" result |> shouldEqual true diff --git a/ShapeSifter/Patterns.fs b/ShapeSifter/Patterns.fs index f1fbafd..110d5de 100644 --- a/ShapeSifter/Patterns.fs +++ b/ShapeSifter/Patterns.fs @@ -36,6 +36,8 @@ module Patterns = let (|Option|_|) (_ : 'a TType) : 'a OptionTeqCrate option = OptionTeqCrate.tryMake () + let (|Choice2|_|) (_ : 'a TType) : 'a Choice2TeqCrate option = Choice2TeqCrate.tryMake () + let (|Set|_|) (_ : 'a TType) : 'a SetTeqCrate option = SetTeqCrate.tryMake () let (|Map|_|) (_ : 'a TType) : 'a MapTeqCrate option = MapTeqCrate.tryMake () diff --git a/ShapeSifter/Patterns.fsi b/ShapeSifter/Patterns.fsi index a655b11..1e5b04d 100644 --- a/ShapeSifter/Patterns.fsi +++ b/ShapeSifter/Patterns.fsi @@ -59,6 +59,9 @@ module Patterns = /// Recognises tTypes that represent an option type. val (|Option|_|) : 'a TType -> 'a OptionTeqCrate option + /// Recognises tTypes that represent a Choice type. + val (|Choice2|_|) : 'a TType -> 'a Choice2TeqCrate option + /// Recognises tTypes that represent a Set type. val (|Set|_|) : 'a TType -> 'a SetTeqCrate option diff --git a/ShapeSifter/TeqCrates.fs b/ShapeSifter/TeqCrates.fs index efe85ff..1f7bcc8 100644 --- a/ShapeSifter/TeqCrates.fs +++ b/ShapeSifter/TeqCrates.fs @@ -92,6 +92,27 @@ module OptionTeqCrate = | Generic (t, ts) when t = typedefof<_ option> -> make'.Force () ts [||] |> unbox<'a OptionTeqCrate> |> Some | _ -> None +type Choice2TeqEvaluator<'a, 'ret> = + abstract Eval<'b1, 'b2> : Teq<'a, Choice<'b1, 'b2>> -> 'ret + +type 'a Choice2TeqCrate = + abstract Apply : Choice2TeqEvaluator<'a, 'ret> -> 'ret + +[] +module Choice2TeqCrate = + + let make () = + { new Choice2TeqCrate<_> with + member _.Apply e = e.Eval Teq.refl + } + + let private make' = lazy (Reflection.invokeStaticMethod <@ make @>) + + let tryMake () = + match typeof<'a> with + | Generic (t, ts) when t = typedefof> -> + make'.Force () ts [||] |> unbox<'a Choice2TeqCrate> |> Some + | _ -> None type SetTeqEvaluator<'a, 'ret> = abstract member Eval : Teq<'a, 'b Set> -> 'ret diff --git a/ShapeSifter/TeqCrates.fsi b/ShapeSifter/TeqCrates.fsi index 49ad6c1..ceae1ff 100644 --- a/ShapeSifter/TeqCrates.fsi +++ b/ShapeSifter/TeqCrates.fsi @@ -114,6 +114,32 @@ module OptionTeqCrate = /// Otherwise, returns None. val tryMake : unit -> 'a OptionTeqCrate option +/// The type of values that act on a ChoiceTeqEvaluator. +/// An encoding of a universally quantified function that takes a type equality between its +/// first type parameter and a Choice<'b1, 'b2> for any 'b_i and returns a value of type 'ret +type Choice2TeqEvaluator<'a, 'ret> = + /// This is the function that you wish to evaluate when you visit an `OptionTeqCrate` using this evaluator. + abstract Eval<'b1, 'b2> : Teq<'a, Choice<'b1, 'b2>> -> 'ret + +/// An encoding of an existentially quantified type equality between 'a and a Choice<'b1, 'b2> for some 'b_i. +/// Given a Choice2TeqEvaluator, it will invoke it with the type equality that it holds and will return the result. +type 'a Choice2TeqCrate = + /// Visit this crate with the given evaluator to reveal the type parameters within the crate. + abstract Apply : Choice2TeqEvaluator<'a, 'ret> -> 'ret + +/// An encoding of an existentially quantified type equality between 'a and a Choice<'b1, 'b2> some 'b_i. +/// Given a Choice2TeqEvaluator, it will invoke it with the type equality that it holds and will return the result. +[] +module Choice2TeqCrate = + + /// For any type 'a, we can create a type equality between Choice<'b1, 'b2> and Choice<'b1, 'b2>, by reflexivity. + /// make creates this type equality and then wraps it in a Choice2TeqCrate. + val make<'b1, 'b2> : unit -> Choice<'b1, 'b2> Choice2TeqCrate + + /// For any type 'a, checks to see if 'a is actually a Choice<'b1, 'b2> for some 'b_i. + /// If it is, creates the type equality eq<'a, Choice<'b1, 'b2>> and then wraps it in a crate. + /// Otherwise, returns None. + val tryMake : unit -> 'a Choice2TeqCrate option /// The type of values that act on an SetTeqCrate. /// An encoding of a universally quantified function that takes a type equality between its From 34b5a18e676583ffceccd9965cfc19b853487d3d Mon Sep 17 00:00:00 2001 From: Smaug123 <3138005+Smaug123@users.noreply.github.com> Date: Wed, 29 May 2024 23:22:15 +0100 Subject: [PATCH 2/3] Update baseline --- ShapeSifter/SurfaceBaseline.txt | 8 ++++++++ ShapeSifter/version.json | 7 ++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ShapeSifter/SurfaceBaseline.txt b/ShapeSifter/SurfaceBaseline.txt index 33fb193..d3e22ea 100644 --- a/ShapeSifter/SurfaceBaseline.txt +++ b/ShapeSifter/SurfaceBaseline.txt @@ -5,6 +5,13 @@ ShapeSifter.ArrayTeqCrate`1 - interface with 1 member(s) ShapeSifter.ArrayTeqCrate`1.Apply [method]: ShapeSifter.ArrayTeqEvaluator<'a, 'ret> -> 'ret ShapeSifter.ArrayTeqEvaluator`2 - interface with 1 member(s) ShapeSifter.ArrayTeqEvaluator`2.Eval [method]: TypeEquality.Teq<'a, 'b []> -> 'ret +ShapeSifter.Choice2TeqCrate inherit obj +ShapeSifter.Choice2TeqCrate.make [static method]: unit -> Microsoft.FSharp.Core.FSharpChoice<'b1, 'b2> ShapeSifter.Choice2TeqCrate +ShapeSifter.Choice2TeqCrate.tryMake [static method]: unit -> 'a ShapeSifter.Choice2TeqCrate option +ShapeSifter.Choice2TeqCrate`1 - interface with 1 member(s) +ShapeSifter.Choice2TeqCrate`1.Apply [method]: ShapeSifter.Choice2TeqEvaluator<'a, 'ret> -> 'ret +ShapeSifter.Choice2TeqEvaluator`2 - interface with 1 member(s) +ShapeSifter.Choice2TeqEvaluator`2.Eval [method]: TypeEquality.Teq<'a, Microsoft.FSharp.Core.FSharpChoice<'b1, 'b2>> -> 'ret ShapeSifter.Conv inherit obj ShapeSifter.Conv.compose [static method]: ShapeSifter.Conv<'a, 'b> -> ShapeSifter.Conv<'b, 'c> -> ShapeSifter.Conv<'a, 'c> ShapeSifter.Conv.make [static method]: ('a -> 'b) -> ('b -> 'a) -> ShapeSifter.Conv<'a, 'b> @@ -66,6 +73,7 @@ ShapeSifter.Patterns+TType`1.Tag [property]: [read-only] int ShapeSifter.Patterns.tType [static method]: unit -> 'a ShapeSifter.Patterns+TType ShapeSifter.Patterns.|Array|_| [static method]: 'a ShapeSifter.Patterns+TType -> 'a ShapeSifter.ArrayTeqCrate option ShapeSifter.Patterns.|Bool|_| [static method]: 'a ShapeSifter.Patterns+TType -> TypeEquality.Teq<'a, bool> option +ShapeSifter.Patterns.|Choice2|_| [static method]: 'a ShapeSifter.Patterns+TType -> 'a ShapeSifter.Choice2TeqCrate option ShapeSifter.Patterns.|DateTime|_| [static method]: 'a ShapeSifter.Patterns+TType -> TypeEquality.Teq<'a, System.DateTime> option ShapeSifter.Patterns.|Dictionary|_| [static method]: 'a ShapeSifter.Patterns+TType -> 'a ShapeSifter.DictionaryTeqCrate option ShapeSifter.Patterns.|Float|_| [static method]: 'a ShapeSifter.Patterns+TType -> TypeEquality.Teq<'a, float> option diff --git a/ShapeSifter/version.json b/ShapeSifter/version.json index 073223b..52ae28c 100644 --- a/ShapeSifter/version.json +++ b/ShapeSifter/version.json @@ -1,6 +1,7 @@ { - "version": "0.3", + "version": "0.4", "publicReleaseRefSpec": [ "^refs/heads/main$" - ] -} + ], + "pathFilters": null +} \ No newline at end of file From d1bba43560a74646a8784e3684f1ba70049eb027 Mon Sep 17 00:00:00 2001 From: Smaug123 <3138005+Smaug123@users.noreply.github.com> Date: Thu, 30 May 2024 22:25:52 +0100 Subject: [PATCH 3/3] Fix wording --- ShapeSifter/TeqCrates.fsi | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/ShapeSifter/TeqCrates.fsi b/ShapeSifter/TeqCrates.fsi index ceae1ff..3c64de8 100644 --- a/ShapeSifter/TeqCrates.fsi +++ b/ShapeSifter/TeqCrates.fsi @@ -1,4 +1,4 @@ -namespace ShapeSifter +namespace ShapeSifter open System.Collections.Generic open TypeEquality @@ -31,7 +31,7 @@ module ArrayTeqCrate = val tryMake : unit -> 'a ArrayTeqCrate option -/// The type of values that act on an ListTeqCrate. +/// The type of values that act on a ListTeqCrate. /// An encoding of a universally quantified function that takes a type equality between its /// first type parameter and a 'b list for any 'b and returns a value of type 'ret type ListTeqEvaluator<'a, 'ret> = @@ -59,7 +59,7 @@ module ListTeqCrate = val tryMake : unit -> 'a ListTeqCrate option -/// The type of values that act on an SeqTeqEvaluator. +/// The type of values that act on a SeqTeqCrate. /// An encoding of a universally quantified function that takes a type equality between its /// first type parameter and a 'b seq for any 'b and returns a value of type 'ret type SeqTeqEvaluator<'a, 'ret> = @@ -87,7 +87,7 @@ module SeqTeqCrate = val tryMake : unit -> 'a SeqTeqCrate option -/// The type of values that act on an OptionTeqEvaluator. +/// The type of values that act on an OptionTeqCrate. /// An encoding of a universally quantified function that takes a type equality between its /// first type parameter and a 'b option for any 'b and returns a value of type 'ret type OptionTeqEvaluator<'a, 'ret> = @@ -114,11 +114,11 @@ module OptionTeqCrate = /// Otherwise, returns None. val tryMake : unit -> 'a OptionTeqCrate option -/// The type of values that act on a ChoiceTeqEvaluator. +/// The type of values that act on a Choice2TeqCrate. /// An encoding of a universally quantified function that takes a type equality between its -/// first type parameter and a Choice<'b1, 'b2> for any 'b_i and returns a value of type 'ret +/// first type parameter and a Choice<'b1, 'b2> for any 'b_i and returns a value of type 'ret. type Choice2TeqEvaluator<'a, 'ret> = - /// This is the function that you wish to evaluate when you visit an `OptionTeqCrate` using this evaluator. + /// This is the function that you wish to evaluate when you visit a `Choice2TeqCrate` using this evaluator. abstract Eval<'b1, 'b2> : Teq<'a, Choice<'b1, 'b2>> -> 'ret /// An encoding of an existentially quantified type equality between 'a and a Choice<'b1, 'b2> for some 'b_i. @@ -127,7 +127,7 @@ type 'a Choice2TeqCrate = /// Visit this crate with the given evaluator to reveal the type parameters within the crate. abstract Apply : Choice2TeqEvaluator<'a, 'ret> -> 'ret -/// An encoding of an existentially quantified type equality between 'a and a Choice<'b1, 'b2> some 'b_i. +/// An encoding of an existentially quantified type equality between 'a and a Choice<'b1, 'b2> for some 'b_i. /// Given a Choice2TeqEvaluator, it will invoke it with the type equality that it holds and will return the result. [] module Choice2TeqCrate = @@ -137,11 +137,11 @@ module Choice2TeqCrate = val make<'b1, 'b2> : unit -> Choice<'b1, 'b2> Choice2TeqCrate /// For any type 'a, checks to see if 'a is actually a Choice<'b1, 'b2> for some 'b_i. - /// If it is, creates the type equality eq<'a, Choice<'b1, 'b2>> and then wraps it in a crate. + /// If it is, creates the type equality Teq<'a, Choice<'b1, 'b2>> and then wraps it in a crate. /// Otherwise, returns None. val tryMake : unit -> 'a Choice2TeqCrate option -/// The type of values that act on an SetTeqCrate. +/// The type of values that act on a SetTeqCrate. /// An encoding of a universally quantified function that takes a type equality between its /// first type parameter and a 'b Set for any 'b and returns a value of type 'ret type SetTeqEvaluator<'a, 'ret> = @@ -169,7 +169,7 @@ module SetTeqCrate = val tryMake : unit -> 'a SetTeqCrate option -/// The type of values that act on an MapTeqCrate. +/// The type of values that act on a MapTeqCrate. /// An encoding of a universally quantified function that takes a type equality between its /// first type parameter and a Map<'k, 'v> for any 'k, 'v and returns a value of type 'ret type MapTeqEvaluator<'a, 'ret> = @@ -197,7 +197,7 @@ module MapTeqCrate = val tryMake : unit -> 'a MapTeqCrate option -/// The type of values that act on an DictionaryTeqCrate. +/// The type of values that act on a DictionaryTeqCrate. /// An encoding of a universally quantified function that takes a type equality between its /// first type parameter and a Dictionary<'k, 'v> for any 'k, 'v and returns a value of type 'ret type DictionaryTeqEvaluator<'a, 'ret> = @@ -225,7 +225,7 @@ module DictionaryTeqCrate = val tryMake : unit -> 'a DictionaryTeqCrate option -/// The type of values that act on an ResizeArrayTeqCrate. +/// The type of values that act on a ResizeArrayTeqCrate. /// An encoding of a universally quantified function that takes a type equality between its /// first type parameter and a 'b ResizeArray for any 'b and returns a value of type 'ret type ResizeArrayTeqEvaluator<'a, 'ret> = @@ -253,7 +253,7 @@ module ResizeArrayTeqCrate = val tryMake : unit -> 'a ResizeArrayTeqCrate option -/// The type of values that act on an FunTeqCrate. +/// The type of values that act on a FunTeqCrate. /// An encoding of a universally quantified function that takes a type equality between its /// first type parameter and the funtion type ('b -> 'c) for any 'b, 'c and returns a value of type 'ret type FunTeqEvaluator<'a, 'ret> = @@ -281,7 +281,7 @@ module FunTeqCrate = val tryMake : unit -> 'a FunTeqCrate option -/// The type of values that act on an PairTeqCrate. +/// The type of values that act on a PairTeqCrate. /// An encoding of a universally quantified function that takes a type equality between its /// first type parameter and the pair type 'b * 'c for any 'b, 'c and returns a value of type 'ret type PairTeqEvaluator<'a, 'ret> = @@ -309,7 +309,7 @@ module PairTeqCrate = val tryMake : unit -> 'a PairTeqCrate option -/// The type of values that act on an TripleTeqCrate. +/// The type of values that act on a TripleTeqCrate. /// An encoding of a universally quantified function that takes a type equality between its /// first type parameter and the triple type 'b * 'c * 'd for any 'b, 'c, 'd and returns a value of type 'ret type TripleTeqEvaluator<'a, 'ret> =