From 73de6a10e32ba961410f515bb8d20a01e16cdf1f Mon Sep 17 00:00:00 2001 From: Arseniy Zhizhelev Date: Sun, 3 Mar 2024 14:39:58 +0300 Subject: [PATCH] Add Projector type class --- .../typed/ontology/simple/meta/Projector.scala | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 typed-ontology-simple-meta/src/main/scala/ru/primetalk/typed/ontology/simple/meta/Projector.scala diff --git a/typed-ontology-simple-meta/src/main/scala/ru/primetalk/typed/ontology/simple/meta/Projector.scala b/typed-ontology-simple-meta/src/main/scala/ru/primetalk/typed/ontology/simple/meta/Projector.scala new file mode 100644 index 0000000..e386074 --- /dev/null +++ b/typed-ontology-simple-meta/src/main/scala/ru/primetalk/typed/ontology/simple/meta/Projector.scala @@ -0,0 +1,12 @@ +package ru.primetalk.typed.ontology.simple.meta + +trait Projector[From <: SchemaLike, To <: SchemaLike]: + val from: SchemaValueType.Aux1[From] + val to: SchemaValueType.Aux1[To] + def apply(v: from.Value): to.Value + +trait Concatenator[A <: RecordSchema, B <: RecordSchema]: + val aSvt: RecordSchemaValueType[A] + val bSvt: RecordSchemaValueType[B] + val abSvt: RecordSchemaValueType[RecordSchema.Concat[A, B]] + def apply(a: aSvt.Value, b: bSvt.Value): abSvt.Value