Remove property token adjustment

This commit is contained in:
InversionSpaces 2023-10-31 11:44:32 +00:00
parent 78ee753c7b
commit 27d72f2bff

View File

@ -96,7 +96,6 @@ class ValuesAlgebra[S[_], Alg[_]: Monad](using
}
case prop @ PropertyToken(value, properties) =>
prop.adjust.fold(
for {
valueRaw <- valueToRaw(value)
result <- valueRaw.flatTraverse(raw =>
@ -109,7 +108,6 @@ class ValuesAlgebra[S[_], Alg[_]: Monad](using
.value
)
} yield result
)(valueToRaw)
case dvt @ NamedValueToken(typeName, fields) =>
(for {
@ -311,15 +309,14 @@ class ValuesAlgebra[S[_], Alg[_]: Monad](using
}
def valueToCall(v: ValueToken[S]): Alg[Option[(ValueRaw, ArrowType)]] =
valueToRaw(v).flatMap(
_.flatTraverse {
case ca: CallArrowRaw => (ca, ca.baseType).some.pure[Alg]
valueToRaw(v).flatMap(_.flatTraverse {
case ca: CallArrowRaw =>
(ca, ca.baseType).some.pure[Alg]
case apr @ ApplyPropertyRaw(_, IntoArrowRaw(_, arrowType, _)) =>
(apr, arrowType).some.pure[Alg]
// TODO: better error message (`raw` formatting)
case raw => report.error(v, s"Expected arrow call, got $raw").as(none)
}
)
})
def valueToTypedRaw(v: ValueToken[S], expectedType: Type): Alg[Option[ValueRaw]] =
OptionT(valueToRaw(v))