In Prelude, unlines work as expected. Below is the example
GHCi>unlines ["aa","bb","bb"] "aa\nbb\nbb\n" But why does lines not work. Even the type signature says that it can only take numbers.
GHCi>:t lines lines :: Num t => [t] So, if I try
GHCi>lines "aa\nbb\nbb\n" why do I get an error? Is there a lines that I need to import?
Regards,
GHCi>:i linesgive you? That should show where thelinesyou're seeing is defined.lines :: String -> [String]. So you have imported a different `lines.lineswas re-defined in GHCi (input line 14). Hence, you are not using the standardlines.