darcs patch: Implementation of aton and ntoa outside ... (and 1 more)

Bulat Ziganshin bulat.ziganshin at gmail.com
Mon Oct 2 02:24:22 EDT 2006

Hello Robert,

Monday, October 2, 2006, 5:06:57 AM, you wrote:
> The file also includes purely functional versions of aton and ntoa,
> though a module named Data.Byte is the wrong place for them.

i think that the whole module is better to name ByteOrder or like and
put it somewhere in Codec.* hierarchy

also, i propose to not use regexs for such simple task, (split '.') does
what you need:

split :: (Eq a) => a -> [a] -> [[a]]
split c s =
  let (chunk, rest) = break (==c) s
  in case rest of  []     -> [chunk]
                   _:rest -> chunk : split c rest

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

More information about the Libraries mailing list