Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Haskell: GHCi: multi line expressions


By default, GHCi don't allow multi line expressions. For example, you should type the expression `1+2*3` in same line.
Prelude> 1+

<interactive>:9:3:
parse error (possibly incorrect indentation or mismatched brackets)


To span an expression across multiple lines, you need to use multiline block. You should type :{ to start a multi line block, and type :} to end multi line block.
Prelude> :{
Prelude| 1+
Prelude| 2
Prelude| *
Prelude| 3
Prelude| :}
7



Previous                                                 Next                                                 Home


This post first appeared on Java Tutorial : Blog To Learn Java Programming, please read the originial post: here

Share the post

Haskell: GHCi: multi line expressions

×

Subscribe to Java Tutorial : Blog To Learn Java Programming

Get updates delivered right to your inbox!

Thank you for your subscription

×