Fix newtype indent in associated type family (#207)
parent
4b673d1d9d
commit
9236673d66
|
@ -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
|
||||
}
|
||||
|
||||
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
|
|
|
@ -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')
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue