In article <[EMAIL PROTECTED]>,
 Andrew J Bromage <[EMAIL PROTECTED]> wrote:

> Another example is floating point format information, like the
> information in C's <float.h>.  One might implement this as:
> 
>       class (Bounded a) => FloatTraits a where
>           epsilon :: a                -- OK
>           mantissaDigits :: Int       -- Not OK!

Oh I do this all the time in HBase. I simply do this:

 data Type a = MkType

 getType :: a -> Type a
 getType _ = MkType

 class (Bounded a) => FloatTraits a where
   epsilon :: a
   mantissaDigits :: Type a -> Int

The only annoyance is that you frequently have to write (MkType :: Type 
MyFloat). Syntactic sugar for _that_ would be useful.

-- 
Ashley Yakeley, Seattle WA

_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to