Skip to content

Commit efc6ab4

Browse files
committed
Merge branch 'main' into provided-types-update
# Conflicts: # paket.lock
2 parents 7792f38 + 937980c commit efc6ab4

File tree

13 files changed

+52
-23
lines changed

13 files changed

+52
-23
lines changed

paket.dependencies

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ github fsprojects/FSharp.TypeProviders.SDK src/ProvidedTypes.fsi
1111
github fsprojects/FSharp.TypeProviders.SDK src/ProvidedTypes.fs
1212
github fsprojects/FSharp.TypeProviders.SDK tests/ProvidedTypesTesting.fs
1313

14-
nuget FSharp.Core >= 5.0.1 lowest_matching: true
14+
nuget FSharp.Core >= 6.0.1 lowest_matching: true
1515
nuget Microsoft.SourceLink.GitHub 1.0 copy_local: true
1616
nuget Microsoft.SourceLink.Common 1.0 copy_local: true
1717
nuget Microsoft.Build.Tasks.Git 1.0 copy_local: true
@@ -49,7 +49,7 @@ group Test
4949
frameworks: net6.0
5050
source https://api.nuget.org/v3/index.json
5151

52-
nuget FSharp.Core 5.0.1
52+
nuget FSharp.Core 6.0.1
5353
nuget Microsoft.NET.Test.Sdk
5454
nuget NUnit 3.13.1
5555
nuget NUnit3TestAdapter

paket.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
RESTRICTION: || (== net6.0) (== netstandard2.0)
22
NUGET
33
remote: https://api.nuget.org/v3/index.json
4-
FSharp.Core (5.0.1)
4+
FSharp.Core (6.0.1)
55
Microsoft.Build.Tasks.Git (1.0) - copy_local: true
66
Microsoft.NETCore.App (2.2.8)
77
Microsoft.NETCore.DotNetHostPolicy (>= 2.2.8) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp2.2))
@@ -340,7 +340,7 @@ NUGET
340340
remote: https://api.nuget.org/v3/index.json
341341
FsCheck (2.15.1)
342342
FSharp.Core (>= 4.2.3)
343-
FSharp.Core (5.0.1)
343+
FSharp.Core (6.0.1)
344344
FsUnit (4.0.4)
345345
FSharp.Core (>= 4.3.4)
346346
NETStandard.Library (>= 2.0.3)

src/FSharp.Data.Runtime.Utilities/Caching.fs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ let createInMemoryCache (expiration: TimeSpan) =
5555
/// Get hash code of a string - used to determine cache file
5656
let private hashString (plainText: string) =
5757
let plainTextBytes = Encoding.UTF8.GetBytes(plainText)
58-
let hash = new SHA1Managed()
59-
let hashBytes = hash.ComputeHash(plainTextBytes)
58+
let hashBytes = SHA1.Create().ComputeHash(plainTextBytes)
6059
let s = Convert.ToBase64String(hashBytes)
6160
s.Replace("ab", "abab").Replace("\\", "ab")
6261

src/FSharp.Data.Runtime.Utilities/IO.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ open System.IO
77
open System.Text
88
open FSharp.Data
99

10+
[<Struct>]
1011
type internal UriResolutionType =
1112
| DesignTime
1213
| Runtime

src/FSharp.Data.Runtime.Utilities/NameUtils.fs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,29 @@ open FSharp.Data.Runtime
99
// Active patterns & operators for parsing strings
1010

1111
let private tryAt (s: string) i =
12-
if i >= s.Length then None else Some s.[i]
12+
if i >= s.Length then ValueNone else ValueSome s.[i]
1313

14-
let private sat f (c: option<char>) =
14+
let private sat f (c: voption<char>) =
1515
match c with
16-
| Some c when f c -> Some c
17-
| _ -> None
16+
| ValueSome c when f c -> ValueSome c
17+
| _ -> ValueNone
1818

19+
[<return: Struct>]
1920
let private (|EOF|_|) c =
2021
match c with
21-
| Some _ -> None
22-
| _ -> Some()
22+
| ValueSome _ -> ValueNone
23+
| _ -> ValueSome()
2324

25+
[<return: Struct>]
2426
let private (|LetterDigit|_|) = sat Char.IsLetterOrDigit
27+
28+
[<return: Struct>]
2529
let private (|Upper|_|) = sat (fun c -> Char.IsUpper c || Char.IsDigit c)
30+
31+
[<return: Struct>]
2632
let private (|Lower|_|) = sat (fun c -> Char.IsLower c || Char.IsDigit c)
2733

34+
2835
// --------------------------------------------------------------------------------------
2936

3037
/// Turns a given non-empty string into a nice 'PascalCase' identifier

src/FSharp.Data.Runtime.Utilities/StructuralInference.fs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ open FSharp.Data.Runtime.StructuralTypes
1313
open System.Text.RegularExpressions
1414

1515
/// This is the internal DU representing all the valid cases we support, mapped from the public InferenceMode.
16-
[<Obsolete("This API will be made internal in a future release. Please file an issue at https://github.com/fsprojects/FSharp.Data/issues/1458 if you need this public.")>]
16+
[<Struct;
17+
Obsolete("This API will be made internal in a future release. Please file an issue at https://github.com/fsprojects/FSharp.Data/issues/1458 if you need this public.")>]
1718
type InferenceMode' =
1819
| NoInference
1920
/// Backward compatible mode.

src/FSharp.Data.Runtime.Utilities/StructuralTypes.fs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ type InferedProperty =
2020
/// For heterogeneous types (types that have multiple possible forms
2121
/// such as differently named XML nodes or records and arrays mixed together)
2222
/// this type represents the number of occurrences of individual forms
23-
[<Obsolete("This API will be made internal in a future release. Please file an issue at https://github.com/fsprojects/FSharp.Data/issues/1458 if you need this public.")>]
23+
[<Struct;
24+
Obsolete("This API will be made internal in a future release. Please file an issue at https://github.com/fsprojects/FSharp.Data/issues/1458 if you need this public.")>]
2425
type InferedMultiplicity =
2526
| Single
2627
| OptionalSingle
@@ -188,23 +189,26 @@ type internal InferedTypeTag with
188189

189190
/// Dummy type to represent that only "0" was found.
190191
/// Will be generated as 'int', unless it's converted to Bit.
191-
[<Obsolete("This API will be made internal in a future release. Please file an issue at https://github.com/fsprojects/FSharp.Data/issues/1458 if you need this public.")>]
192+
[<Struct;
193+
Obsolete("This API will be made internal in a future release. Please file an issue at https://github.com/fsprojects/FSharp.Data/issues/1458 if you need this public.")>]
192194
type Bit0 = Bit0
193195

194196
/// Dummy type to represent that only "1" was found
195197
/// Will be generated as 'int', unless it's converted to Bit
196-
[<Obsolete("This API will be made internal in a future release. Please file an issue at https://github.com/fsprojects/FSharp.Data/issues/1458 if you need this public.")>]
198+
[<Struct;
199+
Obsolete("This API will be made internal in a future release. Please file an issue at https://github.com/fsprojects/FSharp.Data/issues/1458 if you need this public.")>]
197200
type Bit1 = Bit1
198201

199202
/// Dummy type to represent that only one of "0" and "1" were found
200203
/// Will be generated as a 'bool', unless it's converted to another numerical type
201-
[<Obsolete("This API will be made internal in a future release. Please file an issue at https://github.com/fsprojects/FSharp.Data/issues/1458 if you need this public.")>]
204+
[<Struct;
205+
Obsolete("This API will be made internal in a future release. Please file an issue at https://github.com/fsprojects/FSharp.Data/issues/1458 if you need this public.")>]
202206
type Bit = Bit
203207

204208
// ------------------------------------------------------------------------------------------------
205209

206210
/// Represents a transformation of a type
207-
[<RequireQualifiedAccess>]
211+
[<Struct; RequireQualifiedAccess>]
208212
[<Obsolete("This API will be made internal in a future release. Please file an issue at https://github.com/fsprojects/FSharp.Data/issues/1458 if you need this public.")>]
209213
type TypeWrapper =
210214
/// No transformation will be made to the type

src/FSharp.Data.Runtime.Utilities/TextConversions.fs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,19 @@ module private Helpers =
1919
| true, v -> Some v
2020
| _ -> None
2121

22+
[<return: Struct>]
2223
let (|StringEqualsIgnoreCase|_|) (s1: string) s2 =
2324
if s1.Equals(s2, StringComparison.OrdinalIgnoreCase) then
24-
Some()
25+
ValueSome()
2526
else
26-
None
27+
ValueNone
2728

29+
[<return: Struct>]
2830
let (|OneOfIgnoreCase|_|) set str =
2931
if Array.exists (fun s -> StringComparer.OrdinalIgnoreCase.Compare(s, str) = 0) set then
30-
Some()
32+
ValueSome()
3133
else
32-
None
34+
ValueNone
3335

3436
// note on the regex we have /Date()/ and not \/Date()\/ because the \/ escaping
3537
// is already taken care of before AsDateTime is called

tests/FSharp.Data.Core.Tests.CSharp/FSharp.Data.Core.Tests.CSharp.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,8 @@
2222
<ProjectReference Include="..\..\src\FSharp.Data.Html.Core\FSharp.Data.Html.Core.fsproj" />
2323
<ProjectReference Include="..\..\src\FSharp.Data.WorldBank.Core\FSharp.Data.WorldBank.Core.fsproj" />
2424
</ItemGroup>
25-
<Import Project="..\..\.paket\Paket.Restore.targets" />
25+
<ItemGroup>
26+
<PackageReference Update="FSharp.Core" Version="6.0.1" />
27+
</ItemGroup>
28+
<Import Project="..\..\.paket\Paket.Restore.targets" />
2629
</Project>

tests/FSharp.Data.Core.Tests/FSharp.Data.Core.Tests.fsproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,8 @@
4343
<ProjectReference Include="..\..\src\FSharp.Data.Html.Core\FSharp.Data.Html.Core.fsproj" />
4444
<ProjectReference Include="..\..\src\FSharp.Data.WorldBank.Core\FSharp.Data.WorldBank.Core.fsproj" />
4545
</ItemGroup>
46+
<ItemGroup>
47+
<PackageReference Update="FSharp.Core" Version="6.0.1" />
48+
</ItemGroup>
4649
<Import Project="..\..\.paket\Paket.Restore.targets" />
4750
</Project>

0 commit comments

Comments
 (0)