Created
November 9, 2015 03:53
-
-
Save eldesperado/4c961bba0082ac2f3e24 to your computer and use it in GitHub Desktop.
Conforming types may be used in for-in statements.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension <# extendedType #> : SequenceType { | |
func generate() -> <# generatorType #><<# elementType #>> { | |
<# generator state #> | |
return anyGenerator { | |
if <# terminal condition #> { | |
return nil | |
} | |
<# iteration logic #> | |
return nil | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment