Alex documentation (Chapter 5) says:
You might want Alex to keep track of the line and column number in the input text, or you might wish to do it yourself (perhaps you use a different tab width from the standard 8-columns, for example)
But changing tab width from 8 to 4 in Alex position tracker is rather hard than easy. The code for this is hidden deep inside Alex generated routines:
-- this function is used by `alexGetByte`, which is used by `alex_scan_tkn`, which is
-- used by `alexScanUser` and `alexRightContext`,
-- which is used by `alex_accept` etc etc...
alexMove :: AlexPosn -> Char -> AlexPosn
alexMove (AlexPn a l c) '\t' = AlexPn (a+1) l (((c+7) `div` 8)*8+1)
alexMove (AlexPn a l c) '\n' = AlexPn (a+1) (l+1) 1
alexMove (AlexPn a l c) _ = AlexPn (a+1) l (c+1)