[Haskell-cafe] more functions to evaluate

PR Stanley prstanley at ntlworld.com
Fri Oct 12 15:10:04 EDT 2007


Hi folks
Any comments and/or criticisms no matter how trivial on the following please:

	wordSize :: [Int] -> Int
	wordSize xs = head (dropWhile (<(length xs)) $ iterate (*2) 8)

	intToBinWord :: Int -> [Int]
	intToBinWord n = reverse (take elements (xs ++ repeat 0))
	  where
	  xs = reverse (intToBin n)
	  elements = wordSize xs

Thanks, Paul



More information about the Haskell-Cafe mailing list