Newlines between array items are not preserved #260

Open
opened 2019-09-30 00:45:14 +02:00 by calebmer · 0 comments
calebmer commented 2019-09-30 00:45:14 +02:00 (Migrated from github.com)

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))
    )
  ]
I have a program that looks like this: ```hs 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: ```hs 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)) ) ] ```
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: hexagoxel/brittany#260
There is no content yet.