mirror of
https://github.com/fluencelabs/aqua.git
synced 2024-12-04 22:50:18 +00:00
Remove property token adjustment
This commit is contained in:
parent
78ee753c7b
commit
27d72f2bff
@ -96,20 +96,18 @@ class ValuesAlgebra[S[_], Alg[_]: Monad](using
|
|||||||
}
|
}
|
||||||
|
|
||||||
case prop @ PropertyToken(value, properties) =>
|
case prop @ PropertyToken(value, properties) =>
|
||||||
prop.adjust.fold(
|
for {
|
||||||
for {
|
valueRaw <- valueToRaw(value)
|
||||||
valueRaw <- valueToRaw(value)
|
result <- valueRaw.flatTraverse(raw =>
|
||||||
result <- valueRaw.flatTraverse(raw =>
|
properties
|
||||||
properties
|
.foldLeftM(raw) { case (prev, op) =>
|
||||||
.foldLeftM(raw) { case (prev, op) =>
|
OptionT(
|
||||||
OptionT(
|
resolveSingleProperty(prev.`type`, op)
|
||||||
resolveSingleProperty(prev.`type`, op)
|
).map(prop => ApplyPropertyRaw(prev, prop))
|
||||||
).map(prop => ApplyPropertyRaw(prev, prop))
|
}
|
||||||
}
|
.value
|
||||||
.value
|
)
|
||||||
)
|
} yield result
|
||||||
} yield result
|
|
||||||
)(valueToRaw)
|
|
||||||
|
|
||||||
case dvt @ NamedValueToken(typeName, fields) =>
|
case dvt @ NamedValueToken(typeName, fields) =>
|
||||||
(for {
|
(for {
|
||||||
@ -311,15 +309,14 @@ class ValuesAlgebra[S[_], Alg[_]: Monad](using
|
|||||||
}
|
}
|
||||||
|
|
||||||
def valueToCall(v: ValueToken[S]): Alg[Option[(ValueRaw, ArrowType)]] =
|
def valueToCall(v: ValueToken[S]): Alg[Option[(ValueRaw, ArrowType)]] =
|
||||||
valueToRaw(v).flatMap(
|
valueToRaw(v).flatMap(_.flatTraverse {
|
||||||
_.flatTraverse {
|
case ca: CallArrowRaw =>
|
||||||
case ca: CallArrowRaw => (ca, ca.baseType).some.pure[Alg]
|
(ca, ca.baseType).some.pure[Alg]
|
||||||
case apr @ ApplyPropertyRaw(_, IntoArrowRaw(_, arrowType, _)) =>
|
case apr @ ApplyPropertyRaw(_, IntoArrowRaw(_, arrowType, _)) =>
|
||||||
(apr, arrowType).some.pure[Alg]
|
(apr, arrowType).some.pure[Alg]
|
||||||
// TODO: better error message (`raw` formatting)
|
// TODO: better error message (`raw` formatting)
|
||||||
case raw => report.error(v, s"Expected arrow call, got $raw").as(none)
|
case raw => report.error(v, s"Expected arrow call, got $raw").as(none)
|
||||||
}
|
})
|
||||||
)
|
|
||||||
|
|
||||||
def valueToTypedRaw(v: ValueToken[S], expectedType: Type): Alg[Option[ValueRaw]] =
|
def valueToTypedRaw(v: ValueToken[S], expectedType: Type): Alg[Option[ValueRaw]] =
|
||||||
OptionT(valueToRaw(v))
|
OptionT(valueToRaw(v))
|
||||||
|
Loading…
Reference in New Issue
Block a user