Skip to content

Commit 4721598

Browse files
committed
Core: rename generic type
Enhanced code readability by substituting `'Type` with more meaningful parameter names.
1 parent 9c4d833 commit 4721598

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/FSharpLint.Core/Framework/HintParser.fs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -390,10 +390,10 @@ module HintParser =
390390
let charListToString charList =
391391
Seq.fold (fun x y -> x + y.ToString()) String.Empty charList
392392

393-
let pischar chars : Parser<char, 'Type> =
393+
let pischar chars : Parser<char, 'CharParser> =
394394
satisfy (fun x -> List.exists ((=) x) chars)
395395

396-
let pnotchar chars : Parser<char, 'Type> =
396+
let pnotchar chars : Parser<char, 'CharParser> =
397397
satisfy (fun x -> not <| List.exists ((=) x) chars)
398398

399399
module Operators =
@@ -784,22 +784,22 @@ module HintParser =
784784
satisfy isLetter
785785
.>> notFollowedBy (satisfy isLetter)
786786

787-
let ptuple (pparser:Parser<'Type, unit>) : Parser<'Type list, unit> =
787+
let ptuple (pparser:Parser<'Element, unit>) : Parser<'Element list, unit> =
788788
skipChar '('
789789
>>. pparser
790790
.>> skipChar ','
791791
.>>. sepEndBy1 pparser (skipChar ',')
792792
.>> skipChar ')'
793793
|>> fun (func, rest) -> (func::rest)
794794

795-
let plist (pparser:Parser<'Type, unit>): Parser<'Type list, unit> =
795+
let plist (pparser:Parser<'Element, unit>): Parser<'Element list, unit> =
796796
skipChar '['
797797
>>. spaces
798798
>>. sepEndBy pparser (skipChar ';')
799799
.>> spaces
800800
.>> skipChar ']'
801801

802-
let parray (pparser:Parser<'Type, unit>): Parser<'Type list, unit> =
802+
let parray (pparser:Parser<'Element, unit>): Parser<'Element list, unit> =
803803
skipString "[|"
804804
>>. spaces
805805
>>. sepEndBy pparser (skipChar ';')

src/FSharpLint.Core/Framework/ParseFile.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ module ParseFile =
3333
| AbortedTypeCheck
3434

3535
[<NoComparison>]
36-
type ParseFileResult<'Type> =
36+
type ParseFileResult<'Content> =
3737
| Failed of ParseFileFailure
38-
| Success of 'Type
38+
| Success of 'Content
3939

4040
let private parse file source (checker:FSharpChecker, options) =
4141
let sourceText = SourceText.ofString source

src/FSharpLint.Core/Rules/Conventions/Naming/NamingHelper.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,11 @@ let isImplicitModule (SynModuleOrNamespace.SynModuleOrNamespace(longIdent, _, mo
307307
// TODO: does SynModuleOrNamespaceKind.AnonModule replace this check?
308308
isModule moduleKind && longIdent |> List.forall (fun x -> zeroLengthRange x.idRange)
309309

310-
type GetIdents<'Type> = AccessControlLevel -> SynPat -> 'Type []
310+
type GetIdents<'Items> = AccessControlLevel -> SynPat -> 'Items []
311311

312312
/// Recursively get all identifiers from pattern using provided getIdents function and collect them into array.
313313
/// accessibility parameter is passed to getIdents, and can be narrowed down along the way (see checkAccessibility).
314-
let rec getPatternIdents<'Type> (accessibility:AccessControlLevel) (getIdents:GetIdents<'Type>) argsAreParameters (pattern:SynPat) =
314+
let rec getPatternIdents<'Items> (accessibility:AccessControlLevel) (getIdents:GetIdents<'Items>) argsAreParameters (pattern:SynPat) =
315315
match pattern with
316316
| SynPat.LongIdent(_, _, _, args, access, _) ->
317317
let identAccessibility = checkAccessibility accessibility access

0 commit comments

Comments
 (0)