
2 Oct
2011
2 Oct
'11
5:07 p.m.
02.10.2011 19:55, David Barbour пишет:
Use TypeFamilies.
{-# LANGUAGE TypeFamilies #} ... type family FType a :: * type instance FType Char = Float type instance FType Double = Int
class ExampleClass a where f :: a -> FType a
Better to include type in class. class ExampleClass a where type FType a f :: a -> FType a instance ExampleClass Char where type FType Char = Float f char = ...