
On Thu, 1 Jan 2015 17:15:31 -0500
Brandon Allbery
On Thu, Jan 1, 2015 at 4:29 PM, Bryan Gardiner
wrote: Doesn't "HostBinaryNum a => HostBinary a" create a HostBinary instance for all instances of HostBinaryNum only? So why would it cause
No, it creates an instance for all types, then checks for HostBinaryNum at the point where it tries to use the instance.
Brandon, Tom, thanks for the reponses. I can only claim rudimentary typeclass knowledge but I find it odd for the instance statement to create instances for all types if it's going to only be usable for types with HostBinaryNum instances. From my reading of the GHC manual, it's generally only an error when a conflict actually occurs, not if a conflict might occur. Is there a benefit to having it this way? Many thanks, Bryan