-
Notifications
You must be signed in to change notification settings - Fork 32
Explanation of calculation of offset calculation.
Matthew Pickering edited this page Mar 10, 2015
·
2 revisions
10:33 < mpickering> what's the difference between offsetValUnchanged and offsetValSame?
10:34 < mpickering> it seems that the two names are synonyms but they have different values
10:36 < alanz> The Same variant can introduce a new indentation, the Unchanged can't. So Same is only used when layout needs to be
captured, ie. vertical alignement on following lines is required.
10:37 < alanz> Otherwise you end up with the following
10:37 < alanz> foo x y =
10:37 < alanz> do c <- getChar
10:37 < alanz> return c
10:37 < alanz> becoming
10:37 < alanz> bar2 x y =
10:37 < alanz> do c <- getChar
10:37 < alanz> return c
10:37 < alanz> ie the HsDo is indented by one because the function name is one longer
10:38 < alanz> But because no layout is triggered on the entry to do, it is not needed.
10:38 < alanz> But, if the do clause was directly after the - it would have been needed.
10:38 < alanz> for the "return c"
10:39 < alanz> I think I finally have my head around this, and feel confident of it. I need to update the writeup to explain exactly
what is going on
10:44 < alanz> Obv I ment after the =