brittany icon indicating copy to clipboard operation
brittany copied to clipboard

Newlines between array items are not preserved

Open calebmer opened this issue 6 years ago • 0 comments

I have a program that looks like this:

queryType :: ObjectType Database ()
queryType = query
  Nothing
  [ fieldWithArgs
    "account"
    Nothing
    accountType
    (args1 (arg "id" Nothing intInputType))
    (\context () id ->
      return (databaseTableLookup id (databaseAccounts context))
    )

  , fieldWithArgs
    "post"
    Nothing
    postType
    (args1 (arg "id" Nothing intInputType))
    (\context () id -> return (databaseTableLookup id (databasePosts context)))

  , fieldWithArgs
    "comment"
    Nothing
    commentType
    (args1 (arg "id" Nothing intInputType))
    (\context () id ->
      return (databaseTableLookup id (databaseComments context))
    )
  ]

…but when Brittany runs the newlines are removed and the end result is this:

queryType :: ObjectType Database ()
queryType = query
  Nothing
  [ fieldWithArgs
    "account"
    Nothing
    accountType
    (args1 (arg "id" Nothing intInputType))
    (\context () id ->
      return (databaseTableLookup id (databaseAccounts context))
    )
  , fieldWithArgs
    "post"
    Nothing
    postType
    (args1 (arg "id" Nothing intInputType))
    (\context () id -> return (databaseTableLookup id (databasePosts context)))
  , fieldWithArgs
    "comment"
    Nothing
    commentType
    (args1 (arg "id" Nothing intInputType))
    (\context () id ->
      return (databaseTableLookup id (databaseComments context))
    )
  ]

calebmer avatar Sep 29 '19 22:09 calebmer