Skip to content

Conversation

tfausak
Copy link
Owner

@tfausak tfausak commented Feb 29, 2024

As discovered in #40.

-- before
if p
  t

else
  f
-- after
if p
  t
else
  f

I generally want to avoid special-casing things, but conditionals feel like a reasonable exception. The else conceptually belongs to the if above it. Separating them by an extra space makes things more confusing.

@tfausak tfausak added the enhancement New feature or request label Feb 29, 2024
@tfausak tfausak mentioned this pull request Feb 29, 2024
@tfausak
Copy link
Owner Author

tfausak commented Feb 29, 2024

https://cabal.readthedocs.io/en/3.10/cabal-package.html#conditional-blocks

As far as I know this is the only special syntax. I already have special cases in place for conditional arguments here:

bs /= ByteString.singleton 0x21 -- !
&& bs /= ByteString.singleton 0x28 -- (
&& bs /= ByteString.singleton 0x29 -- )

@tfausak tfausak changed the title Improve formatting of conditionals Fix formatting of conditionals Feb 29, 2024
@tfausak tfausak added bug Something isn't working and removed enhancement New feature or request labels Feb 29, 2024
@tfausak tfausak merged commit 6bf8408 into main Feb 29, 2024
@tfausak tfausak deleted the 2024-02-29-conditionals branch February 29, 2024 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant