Skip to content

Commit 4552947

Browse files
committed
Record declarations should follow tibell style
1 parent 2ba5d29 commit 4552947

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

haskell-indentation.el

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -646,18 +646,16 @@ For example
646646

647647
(defun haskell-indentation-data ()
648648
"Parse data or type declaration."
649-
(haskell-indentation-with-starter
650-
(lambda ()
651-
(when (string= current-token "instance")
652-
(haskell-indentation-read-next-token))
653-
(haskell-indentation-type)
654-
(cond ((string= current-token "=")
655-
(haskell-indentation-with-starter
656-
(apply-partially #'haskell-indentation-separated
657-
#'haskell-indentation-type "|" "deriving")))
658-
((string= current-token "where")
659-
(haskell-indentation-with-starter
660-
#'haskell-indentation-expression-layout nil))))))
649+
(haskell-indentation-read-next-token)
650+
(when (string= current-token "instance")
651+
(haskell-indentation-read-next-token))
652+
(haskell-indentation-type)
653+
(cond ((string= current-token "=")
654+
(haskell-indentation-separated
655+
#'haskell-indentation-expression "|" "deriving"))
656+
((string= current-token "where")
657+
(haskell-indentation-with-starter
658+
#'haskell-indentation-expression-layout nil))))
661659

662660
(defun haskell-indentation-import ()
663661
"Parse import declaration."
@@ -927,7 +925,9 @@ layout starts."
927925
(cond ((member current-token '(layout-item ";"))
928926
(haskell-indentation-read-next-token))
929927
((eq current-token 'end-tokens)
930-
(when (or (haskell-indentation-expression-token-p following-token)
928+
(when (or (and
929+
(not (string= following-token "{"))
930+
(haskell-indentation-expression-token-p following-token))
931931
(string= following-token ";")
932932
(and (equal layout-indent 0)
933933
(member following-token (mapcar #'car haskell-indentation-toplevel-list))))

0 commit comments

Comments
 (0)