Can a CombinatorSystem be used as IntoSystem? #8689
Unanswered
focustense
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I normally don't have trouble with complex generics, but these system and system parameter types are proving too much for me.
I'm trying to consume an API that wants a particular system function. The signature looks like::
Writing systems to pass into this involves a lot of repetitive boilerplate. So I thought I could abstract the boilerplate into its own function, and only have to keep rewriting the part that changes:
It's not really all that important what
A
andB
actually do here (I think). To make things tangible, let's say that it's aParent
query, although in reality it's more involved.I thought that the result of this combinator would have the correct type. It takes
(Entity, Entity)
as input, and emitsbool
as output. However, it's apparently not a compatible type, and as per #1519, the compiler error messages are of little help.I elided some things in the error, so it might not be 100% true to form, but it's easily repro so I hope it's clear enough.
Interestingly, if I try to explicitly implement
IntoSystem<...>
onFooMarker
, I get an error about a conflicting implementation. So it obviously implements some variant ofIntoSystem
... just not the one I'm expecting.What am I getting wrong here, and is it even possible to do what I'm trying to do, or are systems just not designed to do this?
(P.S. Essentially what I want is just a pipe, except the
pipe
function requires that the origin be an open (no input) system, and in this case the origin system does have inputs. I'm guessing I'd be having the same problem even ifpipe
did accept an input-dependent system. Seems likely the disconnect has to do with the precise relationships betweenSystem
,IntoSystem
and theFn
types, which are not so easy to map out.)Beta Was this translation helpful? Give feedback.
All reactions