Parsing an XML with namespaces using F# XMLProvider
I've been trying to parse an XML NLog message using XMLProvider.In my project I defined the provider in the following way:XmlProvider<"""<log4j:event logger="MyTest" level="INFO"...
View ArticleEagerly loading all paginated data with json type provider
Cosider an API which reply is always of this structure:{"pagination": {"limit": int,"offset": int,"count": int,"total": int },"data": [ {...some obj...} ]}So payloads differ only in structure of data...
View ArticleAssign indexes to read CSV rows in F# query
What is the easiest way to add indexes to the read contents of a CSV/TSV file read in with CsvProvider and a query expression?I have a tab separated file that contains thousands of orders that...
View ArticleWhy does the R type provider throw an exception when it does not in a similar...
I have two computers with seemingly equal code and configurations, one compiles a solution, the other does not.The problem is related to the R Type Provider. This is the code:/// Path to project data...
View ArticleF# XML Type Provider - Using an XSD
I am probably missing the boat here, but how can you build a reusable tool that uses the XML Type Provider if the XML you are giving to XMLProvider doesn't have all of the possible elements? In other...
View ArticleHow to write F# Type Provider to generate P/Invoke code?
I was trying to develop a native C interop library in F#.I wonder if there is a way to leverage F# type provider to read that C library header file, parse it and use the AST to generate the boilerplate...
View ArticleHow can I transform an object of a given type to a record?
I get a IEnumerable of object from using a SqlCommandProvider. Those objects match my rows and columns. Lets called it B. In my program I created a type matching those columns too. Lets call this...
View ArticleF# JsonProvider type fails to parse decimal
Why can't someJsonType parse 9.433536880271462E-4 to decimal?Parsing the value myself works fine let c = decimal "9.433536880271462E-4"#r "nuget: FSharp.Data, 3.3.3"type someJsonType =...
View ArticleUsing reflection in type providers to mimic RFC FS-1023
As I understand it, only primitive types can be given as parameters to a type provider so you can't do something like TypeProvider<Option<int>> but you can do...
View ArticleF#: Providing type annotation for overloaded constructor
I'm getting a FS0041 error for an overloaded constructor, and I can't find my way around it.Here are two screenshot of my attempts:and:How can I execute the desired constructor?
View ArticleIs there a way to enumerate JSON properties using F# JsonProvider?
I parse some data in JSON format using F# and JSON Type Provider.example.json:{"contracts": {"11": {"id": 11,"date": "08.01.2021" },"12": {"id": 12,"date": "09.01.2021" },"13": {"id": 13,"date":...
View ArticleF# quotation with spliced parameter of any type
I am trying to develop F# type provider.It provides some DTOs (with the structure described in some external document) and a set of methods for processing them. The processing algorithm is based on...
View ArticleNot being able to build F# type provider SDK
I have finally come across something that no one else seemed to have come across (at least from what I can tell). I trying to build an F# type provider using TypeProviders.SDK.As soon as I build the...
View ArticleIs it possible to use a custom type with the FSharp.Data.CsvProvider when...
I'm working in F# with a CSV that looks like this:When,Where,HowMuch11/24/2019,Germany,100 EUR11/25/2019,France,100 EUR11/26/2019,Switzerland,50 CHF11/27/2019,USA,75 USDI'm using the CSV Type Provider...
View ArticleF# Type Provider Set Optional Field With Required Parameter, Getting a...
I'm trying to build a type provider for Bloomberg (they provide schema xml files that describe the types). I'm able to generate types that look like the following class:type Example(x:...
View ArticleError while using type provider 'FSharp.Configuration.ResourceProvider'
I just loaded FSharp.Configuration in paket files and created a type withopen FSharp.Configurationtype ResourceProvider = ResXProvider<file="Resources/Strings.resx">In Strings.resx are resources...
View ArticleJSON Type provider with Saturn Framework `Controller.getModel` not working
I've some trouble getting my type to work with Saturn and the JSON type-provider. My type: (generated by the typeprovider)[<CLIMutable>]type FeatureModel = JsonProvider<"../example.json">My...
View ArticleJSON TypeProvider and null values in arrays
This codeopen FSharp.Data[<Literal>]let sample = """ { "foo": [ 10, null ] }"""type InputTypes = JsonProvider<sample>InputTypes.Parse(sample).Foo |> DumpResults in Foo being type int[]...
View ArticleF# WSDL Type Provider and Confluence
When I use the WSDL Type provider to create a client for Confluence SOAP service then I get all methods with (unit -> unit) signature.#r "System.ServiceModel.dll"#r...
View ArticleF# SQL type provider sample: `dotnet build` works, but VS fails
I'm having a hard time understanding why this very basic sample of F# type providers (using the SqlProvider nuget package) builds fine in Windows in the command line but in VS2022 it...
View Article
More Pages to Explore .....