Applying mixins in ln for generator #1103
Answered
by
HT154
sergeyshevch
asked this question in
Q&A
-
Hi! We're experimenting with pkl for our setup and want to apply mixins in for loop.
In this case we want to apply both mixins in order that defined in groups. Is it possible somehow? Current main code doesn't work correctly |
Beta Was this translation helpful? Give feedback.
Answered by
HT154
Jun 20, 2025
Replies: 1 comment 1 reply
-
If I'm interpreting your question correctly, it seems like you're trying to iteratively apply multiple mixins to the same base value in a specific order. If that is the case, I think what you want to use here is services = import*("configs/*.pkl").toMap().map((name, service) -> Pair(
name,
service.groups.fold(service.service, (acc, groupName) ->
acc |> groupConfigs["groups/" + groupName + ".pkl"].service
)
)) If this isn't what you're going for, can you clarify a little more what your desired output is here? |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
sergeyshevch
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If I'm interpreting your question correctly, it seems like you're trying to iteratively apply multiple mixins to the same base value in a specific order. If that is the case, I think what you want to use here is
fold
:If this isn't what you're going for, can you clarify a little more what your desired output is here?