Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If I understood you correctly easiest way to avoid this problem is by writing single <code>do</code> and <code>let</code> like this:</p> <pre><code>fName = do expression1 = ... exp2 ... fName param = let exp1 = ... exp2 = ... exp3 = ... in ... -- can be indented more if you want </code></pre> <p>Main point here is that first indent at <code>exp1</code> is easy to spot and maintain in every new line. </p> <p><br> <br> </p> <hr> <p>And here's copy/paste from my learning sheets. It's not much but might help someone. If anyone notice anything wrong/false please correct me.</p> <blockquote> <p>tabs or spaces indicate BLOCK, like {com1; com2} in C++</p> <p>Offside rule: At beginning of a source file, first top level declaration or definition can start in any column. Every subsequent top level declaration must have same indentation!</p> <p>LET IN, WHERE remembers indentation of next token it sees. If empty line, or indentation is further to right, it continue previous line. If same indentation, this is beginning of new item in same block.</p> <p>win tab 4 spc, unix tab 8 spaces Use spaces instead tab!!!</p> </blockquote> <pre><code>line1... continue line 1 -- as long it doesn't start at same indent as line1 3spaces would indicate block with line 1! line4 same block same indent is same line1 block all indents for BLOCK must be same. line8... -- is new block and end of line1 block positon of first column in block is start line 1 cont line1 cont line 1 cont line 1 block1 -- would be cont line 1 block1 -- if not for this block1 at same indent Bad way: do action0 if condition then action1 else action2 action3 Good way: do action0 if condition then action1 else action2 action3 </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload