fn: breaking - fix type variables for better inference

This commit is contained in:
Keagan McClelland committed 2024-11-06 16:50:06 -07:00
1 parent 9bbd327a10
commit a026d64c1b
4 files changed
+8 -10

No files matched your search

+1 -1
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
}