Y
Hacker News
new
|
ask
|
show
|
jobs
by
burntsushi
3594 days ago
See also:
http://blog.burntsushi.net/type-parametric-functions-golang/
1 comments
interactiv
3594 days ago
Yes, if you look at the source code I use unification to tell whether types match or not.
link
burntsushi
3585 days ago
You're doing a lot of repeated work though. I was trying to point out this function, which does unification in a generic context, given some function type:
https://godoc.org/github.com/BurntSushi/ty#Check
... For example, it reduces a lot of the reflection boiler plate:
https://github.com/BurntSushi/ty/blob/master/fun/list.go#L80
link