brittany
brittany copied to clipboard
DataKinds: ticks inside type-level lists are not correctly spaced
For the following input, brittany produces invalid output:
{-# LANGUAGE DataKinds #-}
-- this fails
type A x y = '[ '(x, y)]
type B x = '[ '[x]]
-- formatted as:
-- type A x y = '['(x, y)]
-- type B x = '['[x]]
-- this works
type C x y = '( '[x], '[y])
type D x y = '( '(x, y), '(x, y))
The output removes the space between the bracket and the second tick, which leads to '['
being parsed as a Char literal. This problem does not occur inside type-level tuples.