File tree 1 file changed +36
-0
lines changed 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -1754,6 +1754,42 @@ To evaluate expressions, simply type one out and hit `RET`.
1754
1754
123
1755
1755
@end example
1756
1756
1757
+ @subsection Evaluating multiline expressions
1758
+
1759
+ GHCi features two ways to evaluate multiline expressions. You can use
1760
+ @code {:set +m } to
1761
+ enable @uref {https://www.haskell.org/ghc/docs/latest/html/users_guide/ghci.html#multiline-input ,
1762
+ multiline input } for all expressions, or you can wrap your expression in
1763
+ @code {: @{ } and @code {: @} } (they have to be on their own lines).
1764
+
1765
+ The prompt will change to indicate that you're inputting a multiline
1766
+ expression:
1767
+
1768
+ @example
1769
+ λ> :@{
1770
+ λ| let a = 10
1771
+ λ| b = 20
1772
+ λ| c = 30
1773
+ λ| :@}
1774
+ @end example
1775
+
1776
+ You can also simulate multiline mode by having your input contain
1777
+ newline characters. You can input a literal newline character with
1778
+ @kbd {C-q C-j }, or you can use:
1779
+
1780
+ @example
1781
+ M-x haskell-interactive-mode-newline-indent
1782
+ @end example
1783
+
1784
+ which is bound to @kbd {C-j }. This command indents after the newline. You
1785
+ can simulate the above example like so:
1786
+
1787
+ @example
1788
+ λ> let a = 10
1789
+ b = 20
1790
+ c = 30
1791
+ @end example
1792
+
1757
1793
@subsection Type of expressions
1758
1794
1759
1795
You can use normal @code {:type } which is part of GHCi to get the type of
You can’t perform that action at this time.
0 commit comments