Skip to content

Commit

Permalink
Removing the "Typed" suffix from the type providers.
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed May 3, 2012
1 parent 50b20a1 commit b49492c
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/FSharpx.TypeProviders/AppSettingsProvider.fs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ let addTypedAppSettings (cfg:TypeProviderConfig) (configFileName:string) (tyDef:
| exn -> tyDef

let typedAppSettings (cfg:TypeProviderConfig) =
erasedType<obj> thisAssembly rootNamespace "AppSettingsTyped"
erasedType<obj> thisAssembly rootNamespace "AppSettings"
|> staticParameter "configFileName" (fun typeName configFileName ->
erasedType<obj> thisAssembly rootNamespace typeName
|> addTypedAppSettings cfg configFileName )
2 changes: 1 addition & 1 deletion src/FSharpx.TypeProviders/FileSystemProvider.fs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ let rec annotateAsFileSystemInfo (fileSystemInfo:FileSystemInfo) (ownerTy:Provid
| exn -> ownerTy

let typedFileSystem =
erasedType<obj> thisAssembly rootNamespace "FileSystemTyped"
erasedType<obj> thisAssembly rootNamespace "FileSystem"
|> staticParameter "path" (fun typeName path ->
annotateAsFileSystemInfo
(new DirectoryInfo(path))
Expand Down
2 changes: 1 addition & 1 deletion src/FSharpx.TypeProviders/RegexProvider.fs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ open FSharpx.TypeProviders.Settings
open FSharpx.TypeProviders.DSL

let regexTy =
erasedType<Regex> thisAssembly rootNamespace "RegexTyped"
erasedType<Regex> thisAssembly rootNamespace "Regex"
|> staticParameters
["pattern", typeof<string>, None]
(fun typeName parameterValues ->
Expand Down
2 changes: 1 addition & 1 deletion src/FSharpx.TypeProviders/RegistryProvider.fs
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ let subNodes =
|> Seq.map (fun key -> key,key.Name)

let typedRegistry =
erasedType<obj> thisAssembly rootNamespace "RegistryTyped"
erasedType<obj> thisAssembly rootNamespace "Registry"
|++> (Seq.map createRegistryNode subNodes)
6 changes: 3 additions & 3 deletions tests/FSharpx.TypeProviders.Tests/AppSettings.Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ open NUnit.Framework
open FSharpx
open FsUnit

type Settings = AppSettingsTyped<"Test.App.config">
type Settings = AppSettings<"Test.App.config">

[<Test>]
let ``Can return a string from the config file``() =
Settings.Test2.GetType() |> should equal typeof<string>
Settings.Test2 |> should equal "Some Test Value 5"

[<Test>]
let ``Can return an integer from the config file``() =
let ``Can return an integer from the config file``() =
Settings.TestInt.GetType() |> should equal typeof<int>
Settings.TestInt |> should equal 102

Expand All @@ -24,4 +24,4 @@ let ``Can return a double from the config file``() =
[<Test>]
let ``Can return a boolean from the config file``() =
Settings.TestBool.GetType() |> should equal typeof<bool>
Settings.TestBool |> should equal true
Settings.TestBool |> should equal true
8 changes: 6 additions & 2 deletions tests/FSharpx.TypeProviders.Tests/FileSystem.Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ open FSharpx
open NUnit.Framework
open FsUnit

type T = FileSystemTyped< @"C:\Users\">
type Users = FileSystem<"C:\\Users\\">

[<Test>]
let ``Can create type for users path``() =
T.Path |> should equal @"C:\Users\"
Users.Path |> should equal @"C:\Users\"

[<Test>]
let ``Can access the default users path``() =
Users.Default.Path |> should equal @"C:\Users\Default"
2 changes: 1 addition & 1 deletion tests/FSharpx.TypeProviders.Tests/Regex.Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ open NUnit.Framework
open FSharpx
open FsUnit

type PhoneRegex = RegexTyped< @"(?<AreaCode>^\d{3})-(?<PhoneNumber>\d{3}-\d{4}$)">
type PhoneRegex = Regex< @"(?<AreaCode>^\d{3})-(?<PhoneNumber>\d{3}-\d{4}$)">

[<Test>]
let ``Can call typed IsMatch function``() =
Expand Down
8 changes: 4 additions & 4 deletions tests/FSharpx.TypeProviders.Tests/Registry.Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ open FsUnit

[<Test>]
let ``Can create type for HKEY_CURRENT_USER``() =
RegistryTyped.HKEY_CURRENT_USER.Path
|> should equal @"HKEY_CURRENT_USER"
Registry.HKEY_CURRENT_USER.Path
|> should equal "HKEY_CURRENT_USER"

[<Test>]
let ``Can create subtype for HKEY_LOCAL_MACHINE``() =
RegistryTyped.HKEY_LOCAL_MACHINE.SOFTWARE.Path
|> should equal @"HKEY_LOCAL_MACHINE\SOFTWARE"
Registry.HKEY_LOCAL_MACHINE.SOFTWARE.Path
|> should equal @"HKEY_LOCAL_MACHINE\SOFTWARE"

0 comments on commit b49492c

Please sign in to comment.