[Haskell-beginners] beginner's type error

Jason Dusek jason.dusek at gmail.com
Mon Mar 30 21:09:39 EDT 2009


2009/03/27 Ivan Moore <ivan.r.moore at gmail.com>:
> > The reason (which is a bit confusing) is that it typechecks
> > just fine---if there *were* a type which is an instance of
> > both Integral and Floating (and I guess round needs RealFrac
> > as well), n could have that type.  There isn't such a type
> > in the standard libraries, but in theory you could make up
> > your own type which is an instance of both.
>
> If there were such a type, could "10" have that type and then
> would my problem have not existed?

  Yes, that is correct.

> in which case, why doesn't it!?

  Does it actually make any logical sense for a type to be both
  integral (governed by rules of modular division) and floating
  point (governed by rules of IEEE 754 division)?

--
Jason Dusek


More information about the Beginners mailing list