I\'m new to Haskell and after starting ghci I tried:
ghci
f x = 2 * x
and I obtained:
:1:4: pars
When you type into a Haskell source file,
is correct.
When you type directly into ghci, you need to type let at the start of the line:
let
let f x = 2 * x