Hacker News new | ask | show | jobs
by dullgiulio 2460 days ago
But again, it's easier to solve your problem if you state it differently. Why do you want to know who implements an interface?

In a statically compiled binary, the compiler will complain at every conversion if the interface is not satisfied.

1 comments

The compiler will only complain if the intended semantics are fully expressed in the type system, which would be difficult to do in Haskell or Idris, and is completely impossible in Go. If I maintain both the consumer and the producer of the interface, it is my job to find all implementations of that interface and ensure that they respect the intended semantics.