fn: breaking - fix type variables for better inference

This commit is contained in:
Keagan McClelland
2024-08-12 12:11:32 -07:00
parent 9bbd327a10
commit a026d64c1b
4 changed files with 8 additions and 10 deletions

View File

@@ -23,7 +23,7 @@ func Iden[A any](a A) A {
// Const is a function that accepts an argument and returns a function that
// always returns that value irrespective of the returned function's argument.
// This is also quite useful in conjunction with higher order functions.
func Const[A, B any](a A) func(B) A {
func Const[B, A any](a A) func(B) A {
return func(_ B) A {
return a
}