Undesired(?) extra spacing around a '.' in a type signature #19
Labels
No Label
blocked: dependency
blocked: info-needed
bug
duplicate
enhancement
fixed in HEAD
help wanted
hs:arrows
hs:brackets
hs:classes
hs:comments
hs:do-notation
hs:guards
hs:lists
hs:operators
hs:patterns
hs:records
hs:types
invalid
language extension support
layouting
needs confirmation
priority: high
priority: low
question
revisit before next release
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: hexagoxel/brittany#19
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Should this space be added? It's not a style I think I've seen before.
Ah, this seems like a nice purely stylistic question :) and I have no strong opinion on this really. My preference leans towards the current behaviour, but the reasoning is weak. I think the strongest argument is the consistency with "=>" and "->" which might be considered higher-precedence operators inside the type signature, but
forall
is syntax already, so: I am not opposed to changing the default here, generally.A quick grep analysis in the ghc-7.10.3 bootlibs looks like this:
(so 328 without, 266 with space). For some somewhat older stackage snapshot, it looks more in favour of omitting the space:
Two question:
How about the "forall" in existentials? would you prefer
data Foo = forall x. X x => Foo x
as well?The multi-line version is fine? E.g.
And of course it is trivial to make this configurable (although i doubt that many would bother to change the default).
I prefer keeping the dot with the type variables, because unlike
=>
and->
it's not conceptually a type-level operator. This would make the multi-line version:: forall t m.
as well.Please keep the space. With
DependentHaskell
we will have bothforall t m .
andforall t m ->
. If we want the space for the arrow, we should keep it for the dot.I'm in favor of keeping the space. It's not clear to me if we can reach a consensus or if this should be configurable.