multiline mode on ghci 8.2.2

I thought I could use the directive ":set +m" to define a function with its signature. Prelude> :set +m Prelude> square :: Num a=>a->a <interactive>:3:1: error: Variable not in scope: square :: a1 -> a1 Instead, I have to type: Prelude> :unset +m Prelude> :{ Prelude| square :: Num a=>a->a Prelude| square = (^2) Prelude| :} Prelude> Any hint ? -- Fabien

You can separate lines with semicolons to avoid multiline definitions.
On mobile; please excuse any tpyos.
On Thu, 16 Aug. 2018, 5:23 pm Fabien R,
I thought I could use the directive ":set +m" to define a function with its signature.
Prelude> :set +m Prelude> square :: Num a=>a->a
<interactive>:3:1: error: Variable not in scope: square :: a1 -> a1
Instead, I have to type:
Prelude> :unset +m Prelude> :{ Prelude| square :: Num a=>a->a Prelude| square = (^2) Prelude| :} Prelude>
Any hint ?
-- Fabien _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.

You need some keyword that triggers Haskell's layout syntax. You end the multiline mode with an empty line. In your example you would need the "let" keyword. Prelude> :set +m Prelude> let square :: Num a => a -> a Prelude| square x = x * x Prelude| Prelude> square 3 9 On 16.08.2018 11:22, Fabien R wrote:
I thought I could use the directive ":set +m" to define a function with its signature.
Prelude> :set +m Prelude> square :: Num a=>a->a
<interactive>:3:1: error: Variable not in scope: square :: a1 -> a1
Instead, I have to type:
Prelude> :unset +m Prelude> :{ Prelude| square :: Num a=>a->a Prelude| square = (^2) Prelude| :} Prelude>
Any hint ?
-- Fabien _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
-- Dipl.-Inf. Jos Kusiek Technische Universität Dortmund Fakultät 4 - Informatik / Lehrstuhl 1 - Logik in der Informatik Otto-Hahn-Straße 12, Raum 3.020 44227 Dortmund Tel.: +49 231-755 7523
participants (3)
-
Fabien R
-
Ivan Lazar Miljenovic
-
Jos Kusiek