Fix newtype indent in associated type family (#207)

pull/286/head
Lennart Spitzner 2020-03-13 01:23:17 +01:00
parent 4b673d1d9d
commit 9236673d66
2 changed files with 19 additions and 0 deletions

View File

@ -1514,6 +1514,24 @@ instance MyClass Int where
, intData2 :: Int
}
#test instance-with-newtype-family-and-deriving
{-# LANGUAGE TypeFamilies #-}
module Lib where
instance Foo () where
newtype Bar () = Baz ()
deriving (Eq, Ord, Show)
bar = Baz
#test instance-with-newtype-family-and-record
instance Foo Int where
newtype Bar Int = BarInt
{ unBarInt :: Int
}
###############################################################################
###############################################################################

View File

@ -1037,6 +1037,7 @@ layoutClsInst lcid@(L _ cid) = docLines
| otherwise -> st : go lineR
isTypeOrData t' =
(Text.pack "type" `Text.isPrefixOf` t')
|| (Text.pack "newtype" `Text.isPrefixOf` t')
|| (Text.pack "data" `Text.isPrefixOf` t')