Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite entered around Generator as Protocol #38

Merged
merged 85 commits into from
Apr 18, 2022
Merged

Conversation

nicorichard
Copy link
Contributor

  • Simplified Context down to just a barebones RandomSource
  • Removed the error handling completely in favour of more simplistic functions and protection against dangerous actions
  • Removed safe extensions
  • Internalized the most dangerous functions (filter, unique -> distinct) while a decision is made about the best way to handle these
  • Added new ways to manipulate data which are safer (recompose, regenerate)
  • Generator is now a Protocol and all extensions have been moved to the Protocol
  • operators and generators mostly moved to classes or structs which inherit the protocol rather than anonymous closure compositions
  • added some educational playgrounds
  • added a Sourcery template to auto conform to Arbitrary
  • Moved static generator creators to a Generators enum namespace, mimicking the Combine pattern
  • Organized and improved the codebase
  • Added swift format definitions and formatted the complete codebase
  • Added a wrapper for Generator to simplify value production (RandomizedGenerator)
  • Added a wrapper for Generator to simplify sharing a stateful generator without incurring side-effects (LazyGenerator)
  • Made both test functions have the same APIs and extend XCTestCase (testAll, testAllSatisfy)
  • Included stateful generators (Loop, Iterate, ShuffleLoop) to more easily consume the entire problem space

# Conflicts:
#	Sources/Genything/gen/generatable/sequences/FiniteSequence.swift
#	Sources/Genything/gen/generatable/sequences/Gen+infiniteSequence.swift
#	Sources/Genything/gen/generatable/sequences/Gen+sequence.swift
#	Sources/Genything/gen/generatable/sequences/InfiniteSequence.swift
…es, remove need for `ArbitraryGeneratable` on `CaseIterable` types
# Conflicts:
#	Sources/Genything/Generators/Arbitrary/Gen+reduce.swift
#	Sources/Genything/Generators/Combinations/Gen+reduce.swift
#	Sources/Genything/Operators/Gen+replace.swift
#	Sources/Genything/Operators/Gen+scan.swift
#	Sources/Genything/gen/mutate/Gen+map.swift
#	Sources/Genything/gen/mutate/Gen+reduce.swift
@nicorichard nicorichard merged commit e75d6e0 into main Apr 18, 2022
@nicorichard nicorichard deleted the generator-type branch April 21, 2022 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant