digit groups

Bulat Ziganshin bulat.ziganshin at gmail.com
Thu Oct 26 01:41:16 EDT 2006


Hello Iavor,

Thursday, October 26, 2006, 4:51:00 AM, you wrote:

> kb,mg,gb :: Num a => a
> kb = 1024
> mb = 1024 * kb
> gb = 1024 * mb

b :kb :mb :gb :_       = iterate (1024*) 1 :: [Int]
b_:kb_:mb_:gb_:tb_:_   = iterate (1024*) 1 :: [Integer]

> and now we can write (4 * kb) instead for 4096.

btw, your variant requires re-calculating values on each their use

-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell-prime mailing list