Created
December 14, 2022 16:30
-
-
Save cdiggins/ef7dfa0559ee98ee41fdcb463fecf7f7 to your computer and use it in GitHub Desktop.
Example of concepts in action
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
class ConceptExamples | |
{ | |
Number Lerp(Number a, Number b, double t) | |
=> a * t + b * (1.0 - t); | |
Number Dot(Vector v) | |
=> (v * v).Sum().Sqrt(); | |
Number Sum(Array xs) | |
=> xs.Aggregate((x, y) => x + y); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compare with: https://devblogs.microsoft.com/dotnet/preview-features-in-net-6-generic-math/