RFC: Replace ft1/ft2 with Into<FunctionType> from tuple of TypeRow(s) #1269
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In answer to this comment that "the
ft1
/ft2
helpers are quite confusing....they rather look like local variables"...This probably doesn't make them any less confusing, indeed, it may make them more confusing, but they don't look like local variables anymore - indeed, this makes them almost disappear, so they barely look like anything anymore....
See what you think; there are a number of other variations, such as
impl<T: Into<TypeRow>> IntoFunctionType for T
i.e. dropping the unary-tuple. (We have to add apub trait IntoFunctionType
or similar to get around the foreign trait restriction but that is no big deal)pub enum FTSpec { Endo(TypeRow), InOut(TypeRow,TypeRow) }
with a straightforwardimpl From<FTSpec> for FunctionType
. The sad bit here is thatFTSpec::Endo
is a lot longer thanft1
and I'd really like to keep these minimal....impl Into<FTSpec>
for some type FTSpec but I haven't really got anything that makes particular sense here and/or that's really different from theimpl Into<FunctionType>
in the PR. (Also it'd seem odd, if passing an actual FunctionType with explicit delta, to be converting FunctionType to new-spec-type and then back to FunctionType again)