Hello, haskellers. I am trying to write some generic subtyping issue. Here
upcast is always safe operation because of subtype is always behaves like the
parrent type. downcast is not the safe becase of not every parrent type value
can be converted to children type. Rangeable here is the
On Fri, Jan 25, 2013 at 3:18 PM, s9gf4...@gmail.com wrote:
Duplicate instance declarations:
instance [incoherent] (Num a, Ord a, Rangable range a,
Packable range a) =
SubtypeOf range a
-- Defined at ...:22:10
instance [incoherent] (Integral a, Packable range a,
MultipleTo range a) =
This has the code smell of trying to use typeclasses for OOP. That won't
work. (Yes, really.)
I am not trying to use OOP, I am just writing some typecasting at all.
This would be correct. Constraints on an instance are applied *after* the
instance is selected, so when Haskell is looking
http://ideone.com/v2CrAm
I has posted to ideone to show what is wrong.___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
On Fri, Jan 25, 2013 at 12:39 PM, s9gf4...@gmail.com wrote:
**
This has the code smell of trying to use typeclasses for OOP. That
won't work. (Yes, really.)
I am not trying to use OOP, I am just writing some typecasting at all.
This would be correct. Constraints on an instance