Quantcast
Channel: Active questions tagged type-providers - Stack Overflow
Browsing latest articles
Browse All 32 View Live

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 Article



Eagerly 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 Article

Assign 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 Article

Why 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 Article

F# 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 Article


How 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 Article

How 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 Article

F# 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 Article


Using 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 Article


Image may be NSFW.
Clik here to view.

F#: 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 Article

Is 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 Article

F# 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 Article

Not 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 Article


Image may be NSFW.
Clik here to view.

Is 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 Article

Image may be NSFW.
Clik here to view.

F# 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 Article


Error 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 Article

JSON 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 Article


JSON 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 Article

F# 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 Article

F# 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

F# SqlProvider: System.Exception: Error - you cannot update an entity that...

I'm using the SQLProvider type-provider project: https://fsprojects.github.io/SQLProvider/As the documentation states on CRUD usage, I'm trying to update a row like this: let...

View Article


Using JsonProvider from Fsharp.Data for Binance-Request

I'm trying to work with the Binance-Connector for .NET. In the F#-Examples, we have the following:let f = let loggerFactory = LoggerFactory.Create(fun (builder:ILoggingBuilder) ->...

View Article


Could not find file Microsoft.AspNetCore.WebUtilities.FileBufferingReadStream

I'm running an Azure Function locally in Visual Studio but receive the error "Could not find file...

View Article

Using type providers (specifically SwaggerProvider) in a Fable application

I am trying to use SwaggerProvider with Fable (is this even possible?)//.fsproj<Project...

View Article

The type provider 'FSharp.Data.SqlCommandProvider' reported an error:...

I'm trying to create a small F# script that will be using FSharp.Data.SqlClient or other SQL Type Prodiver. I also tried SQLProvider. I always get the following error :The type provider...

View Article


F# Type Provider for postgresql raw queries compatible with .NET6+?

I realize there's similar questions about this on SO however a lot of them are over 5 years old, and the projects they're referring to have since gone stale. For instance this project seems exactly...

View Article

How to translate words from English into Arabic. With this files lib >...

I have the Flutter Android application. I want to translate words into an application, but this method is strange to me. I do not have enough experience in dealing with translation.See photoSee...

View Article

Could not load file or assembly Microsoft.Bcl.AsyncInterfaces

I can not use the SqlType provider due to an issue with Microsoft.Bcl.AsyncInterfaces.I am using a minimal program with .NET 4.7.2 and F# 4.7.0.0.My Nuget packages contain a reference to: package...

View Article

Could not find the correct Provider above this MyWidget Widget

Error: Could not find the correct Provider above this MyWidget WidgetThis happens because you used a BuildContext that does not include the providerof your choice. There are a few common scenarios:You...

View Article



How do I create dynamic type providers based on user input?

I want to allow users to provide complex objects, i.e System.Diagnostics.Process[].I see the documentation of type providers for JSON, CSV, HTML, etc. but I didn't see any type providers for normal...

View Article
Browsing latest articles
Browse All 32 View Live




Latest Images