#.

7 messages · Page 1 of 1 (latest)

fallow oar
#

do you know about union types?

#

if you can describe both interfaces, you can "or" them together with |

#
type Foo = Bar[] | WhateverYourGeneratorThingyLooksLike
#

oops, i meant so send another message here but somehow that didn't happen

#

but you might want to take a look at Iterable as well. the thing that a generator function returns is an Iterable, and so are arrays. that common subset might be what you want (depending on what your 2nd implementation actually looks like)