Here's a Prelude inconsistency that's been irking me once 
in a while for a loong time - today it came up again, so here goes:

  unlines   ["a","b"]   ==> "a\nb\n"
  unwords ["a","b"]   ==> "a b"

I like that 

  unwords (ls1 ++ [unwords ls2]) == unwords (ls1 ++ ls2)

but not that 'unlines' doesnt' obey the same rule, i.e.,

   unlines [line1, unlines [line2,line3]]  /= unlines [line1,line2,line3]

Is this by design? I notice that 'unlines' mirrors Miranda's 'lay', but
I'd find it a little more useful without the trailing \n (esp. considering
now that putStrLn is std.)

The current defn of 'unlines' doesn't keep me up at night, but still.

--sigbjorn


Reply via email to