Question: Getting the error "error: parse error on input `,'" 

When reading in text from a file

With the below code:

`data TextEditor = TextEditor ([Char], [Char], [Char], [Char]) deriving (Show)`

Any help would be appreciated,

Thanks in advance

Answer: 
As the error message suggests, in Haskell, function arguments are not separated with commas (curried form).

Specifically, the declaration should read

```
load :: TextEditor -> String -> IO TextEditor
-- The below won't compile.
load (TextEditor (_,s,r,b)) path = do  -- What is (l, s, r, b) here?
    content <- readFile path
    return $TextEditor (content,s,r,b)

```
You forgot the parens `( ... )` to surround a tuple in the type of `load :: ...`.

```
load :: (TextEditor (t), [Char]) -> IO TextEditor (t)

```

Also, you have to indent the second line properly (to have same indentation as first line), or else Haskell will give you another confusing error message.

```
load :: (TextEditor (t), [Char]) -> IO TextEditor (t)
load(TextEditor(l,s,r,b),path) = do
        content <- readFile path
        return(TextEditor(content,s,r,b))

```

Also, there are other type errors (like what is `TextEditor (t)`?) you need to resolve. See another answer for more details.

Also, consider using [Code Review.SE](https://codereview.stackexchange.com) if you want more feedbacks on your entire Haskell code, after you got your code compiling.