Currently the compiler allows for some interesting ways to write generic signatures
open System
module Z =
type Alpha< ^b, ^a
when ^ a : (member Name:string)
and ^a: (member Zip
: ^b when
^b : struct )
and ^a
: (static member(+)
: 'a * 'a
-> 'a
)
> () =
member inline __.X = ()
with
static member inline Y = ()
Since this flies flagrantly in the face of the indentation rules, it'd be nice to fix this for the sake of consistency at the least.
This gives an indentation warning on the ( before static
type TypeWithALongName< ^a
when ^a:(static member(+):'a * 'a -> 'a )
and ^a:(static member(-):'a * 'a -> 'a )
and ^a:(static member(*):'a * 'a -> 'a )
and ^a:(static member(/):'a * 'a -> 'a )
> =
static member inline X = ()
To fix the warning you have to indent this far
type TypeWithALongName< ^a
when ^a:(static member(+):'a * 'a -> 'a )
and ^a:(static member(-):'a * 'a -> 'a )
and ^a:(static member(*):'a * 'a -> 'a )
and ^a:(static member(/):'a * 'a -> 'a )
> =
static member inline X = ()
The former seems like it would work based on the typical indentation approach of needing to be indented one space further than the start of the encompassing construct e.g.
let fn x y = fun z ->
x * y * z
Pros and Cons
The advantages of making this adjustment to F# are ...
The disadvantages of making this adjustment to F# are:
- potential to break some horribly formatted code
- more complex syntax parsing
Extra informtion
Estimated cost : M
Related suggestions:
Affadavit (must be submitted)
Please tick this by placing a cross in the box:
Please tick all that apply:
Currently the compiler allows for some interesting ways to write generic signatures
Since this flies flagrantly in the face of the indentation rules, it'd be nice to fix this for the sake of consistency at the least.
This gives an indentation warning on the
(before staticTo fix the warning you have to indent this far
The former seems like it would work based on the typical indentation approach of needing to be indented one space further than the start of the encompassing construct e.g.
Pros and Cons
The advantages of making this adjustment to F# are ...
The disadvantages of making this adjustment to F# are:
Extra informtion
Estimated cost : M
Related suggestions:
Affadavit (must be submitted)
Please tick this by placing a cross in the box:
Please tick all that apply: