On Thu, Feb 25, 2010 at 10:40:48AM -0500, Nick Bowler wrote:
> *** Idea #1 ***
> 
> Add two methods to the RealFloat class:
> 
>   toDouble   :: RealFloat a => a -> Double
>   fromDouble :: RealFloat a => Double -> a
> 
> and a function:
> 
>   toFloating :: (RealFloat a, RealFloat b) => a -> b
>   toFloating = fromDouble . toDouble

That is exactly how I solved it in the jhc libraries. 

Though, I may switch to using a 'FloatMax' type that is always aliased
to the largest floating point type available, now that Float128 and
Float80 are potentially available. (but it would just be an alias for
Double for now)

        John

-- 
John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/
_______________________________________________
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime

Reply via email to