-
-
Notifications
You must be signed in to change notification settings - Fork 21
feat: std mod #1513
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
feat: std mod #1513
Conversation
pkg.pr.new packages
benchmark commit |
Where do we put the line on which operations have an infix variant? Right now it is only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const createMixedComponentWise2 = <T extends { x: number; y: number }>( | ||
vecConstructor: (x: number, y: number) => T, | ||
) => { | ||
return (op: BinaryOp) => (a: T | number, b: T | number) => | ||
vecConstructor( | ||
op(typeof a === 'number' ? a : a.x, typeof b === 'number' ? b : b.x), | ||
op(typeof a === 'number' ? a : a.y, typeof b === 'number' ? b : b.y), | ||
); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way this is written makes it usable for two vector operations as well. We could replace binaryComponentWise with this and simplify the ifs in std operators a little. Probably a job for #1336
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All gucci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jak się człowiek śpieszy to się diabeł cieszy
eng: Wait a little
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work 👷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹🧹🧹 it is so much cleaner now!
No description provided.