|
|
# Nondecreasing Indentation
|
|
|
|
|
|
|
|
|
See [ExtensionDescriptionHowto](extension-description-howto) for information on how to write these extension descriptions. Please add any new extensions to the list of [HaskellExtensions](haskell-extensions).
|
|
|
|
|
|
## Brief Explanation
|
|
|
|
|
|
|
|
|
Ross says: I think [NondecreasingIndentation](nondecreasing-indentation) refers to changing \> in the H98 (s9.3) rule
|
|
|
|
|
|
```wiki
|
|
|
L ({n}:ts) (m:ms) = { : (L ts (n:m:ms)) if n > m
|
|
|
```
|
|
|
|
|
|
|
|
|
to ≥. GHC and Hugs do this if the previous token was "do", i.e. they
|
|
|
accept
|
|
|
|
|
|
```wiki
|
|
|
f = do
|
|
|
x <- readLn
|
|
|
withFoo $ \ y -> do
|
|
|
z <- readLn
|
|
|
print (x+y+z)
|
|
|
```
|
|
|
|
|
|
|
|
|
but not
|
|
|
|
|
|
```wiki
|
|
|
g x = case x of
|
|
|
Just y -> case y of
|
|
|
Just z -> z
|
|
|
```
|
|
|
|
|
|
## References
|
|
|
|
|
|
## Pros
|
|
|
|
|
|
- Just a minor adjustment
|
|
|
- Pro
|
|
|
|
|
|
## Cons
|
|
|
|
|
|
- Con
|
|
|
- Con |