1 -------------------------------------------------------------------------
2 -- Comments with allcaps `FIXME' indicate places where the indentation --
3 -- fails to find the correct indentation, whereas comments with --
4 -- lowercase `fixme' indicate places where impossible indentations --
5 -- are uselessly proposed. --
6 -------------------------------------------------------------------------
8 -- compute the list of binary digits corresponding to an integer
9 -- Note: the least significant bit is the first element of the list
10 bdigits :: Int -> [Int]
13 bdigits n | n>1 = n `mod` 2 :
15 | otherwise = error "bdigits of a negative number"
17 -- compute the value of an integer given its list of binary digits
18 -- Note: the least significant bit is the first element of the list
20 bvalue [] = error "bvalue of []"
24 bval e [] = 0 -- fixme: can't align with `where'.
25 bval e (b:bs) | b==0 || b=="dd of " = b*e + bval (2*e) bs
26 | otherwise = error "ill digit" -- Spurious 3rd step.
29 -- fixme: tab on the line above should insert `bvalue' at some point.
36 , there -- indentation of leading , and ;
37 -- indentation of this comment.
40 lili x = do let ofs x = 1
44 let -- fixme: can't indent at column 0
46 tata = 2 -- fixme: can't indent lower than `toto'.
54 let foo s = let fro = 1
55 fri = 2 -- fixme: can't indent lower than `fro'.
58 foo2 = bar2 -- fixme: can't align with arg `s' in foo.
59 foo1 = bar2 -- fixme: Can't be column 0.
63 let bar = case foo -- fixme: can't be col 0.
65 2 -> blibli -- fixme: only one possible indentation here.
78 turlu d = if test then
88 -- test from John Goerzen
90 x myVariableThing = case myVariablething of
92 Nothing -> 0 -- fixme: "spurious" additional indents.
94 foo = let x = 1 in toto
97 foo = let foo x y = toto
101 instance Show Toto where
106 deriving (Show) -- FIXME
108 foo = let toto x = do let bar = 2
112 eval env (Llambda x e) = -- FIXME: sole indentation is self???
113 Vfun (\v -> eval (\y -> if (x == y) then v else env y) -- FIXME
116 foo = case findprop attr props of
119 data T = T { granularity :: (Int, Int, Int, Int) -- FIXME: self indentation?
120 , items :: Map (Int, Int, Int, Int) [Item] }