diff --git a/FicroKanSharp.Test/TestTypedMatch.fs b/FicroKanSharp.Test/TestTypedMatch.fs index e2cb7c0..cebcdd4 100644 --- a/FicroKanSharp.Test/TestTypedMatch.fs +++ b/FicroKanSharp.Test/TestTypedMatch.fs @@ -1,2 +1 @@ module FicroKanSharp.Test.TestTypedMatch - diff --git a/FicroKanSharp/Typed.fs b/FicroKanSharp/Typed.fs index 76d2994..425bda0 100644 --- a/FicroKanSharp/Typed.fs +++ b/FicroKanSharp/Typed.fs @@ -7,6 +7,15 @@ type TypedTerm<'a> = | Term of Term | Literal of 'a +type internal TypeName<'a> = + { + UserType : Type + FieldValue : 'a + } + + override this.ToString () = + sprintf "%O<%s>" this.FieldValue this.UserType.Name + [] module TypedTerm = @@ -40,9 +49,15 @@ module TypedTerm = let valuesU = toTermList valuesU let td = typedefof<'a> - Term.Symbol ((td, fieldU.Name), valuesU) + Term.Symbol ( + { + UserType = td + FieldValue = fieldU.Name + }, + valuesU + ) else - Term.Symbol ((ty, t), []) + Term.Symbol ({ UserType = ty ; FieldValue = t }, []) and private ofLiteral : Type -> obj -> Term = let m =