peoplenarthax / chromosome-js

Democratizing Genetic Algorithms
https://peoplenarthax.github.io/chromosome-js/#/
MIT License
1 stars 0 forks source link

[Utils] Improve types #10

Open peoplenarthax opened 5 years ago

peoplenarthax commented 5 years ago

We switched to TypeScript in the fastest way possible, but this implied some "dirty" type hacks (mainly because of ramda) aka any.

It would be nice to improve the types for Individual, Genome so that they can be use in the current library.

This can be done before https://github.com/peoplenarthax/chromosome-js/issues/9 , eventhough if both are done simultaneously (fixing types by moving from ramda) it could be the best .

For those new to the project, one of the easiest changes is in https://github.com/peoplenarthax/chromosome-js/blob/master/src/lib/crossover/crossover.ts#L14

Instead of using head and tail, just destructure it or create a utility function called head and tail that do not use ramda.

peoplenarthax commented 3 years ago

Some problems have been addressed with #9 . But there is a room for improvement ^^