JSON Parser using Regular Expressions & Active Patterns (just for fun).
8 people like thisPosted: 13 years ago by Phillip Trelford
There's an easy way to create JSon objects using Newtonsoft's Json.Net. The common problem with Json.Net is that there's usualy a lot of overhead when creating Json with it as there're a lot of 'new', parentheses, nested objects when we don't need them. And it becomes annoying quite fast. DU Json and toJson function allow to create Json tree and convert it to Json.Net JObject hierarchy. On the examples the usage of lightweight syntax doesn't give a lot of win but it will be more clearer when it come to more complicated objects.
7 people like thisPosted: 12 years ago by Dmitry Lobanov
A simple Twitter search function, leveraging the JSON type provider.
9 people like thisPosted: 11 years ago by Lincoln Atkinson
Just something I whipped up to check out the Marvel Comics API using JSON Type Provider
0 people like thisPosted: 10 years ago by David Grenier
Simple fs script to convert a wql statement to a json string
3 people like thisPosted: 9 years ago by max
A fast generic Json serializer for F# types using TypeShape and FParsec
3 people like thisPosted: 7 years ago by Eirik Tsarpalis
Not super efficient, and doesn't work on every case, but works most of the time. Json.NET JsonConverter for a JsonValue, i.e. JsonValueConverter. If you're using with a converter for discriminated unions, be sure to give this one higher precedence (since JsonValue is implemented as a DU).
2 people like thisPosted: 6 years ago by Nat Elkins
High-performance JSON parsing with System.Text.Json and F#
1 people like thisPosted: 1 year ago by Tuomas Hietanen
A script that consumes the Stackoverflow API in a dynamic fashion
6 people like thisPosted: 12 years ago by Mauricio Scheffer
Rename JSON property names by reconstructing JSON object.
9 people like thisPosted: 12 years ago by Dmitry Lobanov
Sample retail domain model, using F# types (records and discriminated unions) with JSON sample data using F# Data type provider.
2 people like thisPosted: 11 years ago by Tomas Petricek & Phil Trelford
Set creation can be quite slow for large sets (> 15000ish string items). If input sequence to create the set is sorted then some optimizations can be applied. For even larger unordered sets (> 30000ish string items) it can be faster doing an up front sort on the data, and then using the Set creation method as described. 1) Set.union is very fast when the greatest element in one of the sets is less than the smallest element in the other; basically becoming an O(1) operation. And Set.add is faster for smaller sets than larger sets, given O(log2 n) of the add operation. So when we have ordered data, makings lots of smaller sets from the stream and union-ing them together can provide a performance boost. 2) On top of the method described in (1), because all the sets are immutable inputs and outputs, then they can be partitioned off onto Tasks to perform the set creation in parallel. If you are using Newtonsoft's Json.net, then provided is a JsonConverter that can be added to the serializer to use this for Set creation like: serializer.Converters.Add Newtonsoft.fastFSharpSetConverter
2 people like thisPosted: 9 years ago by manofstick
A simple example of using datatype generic JSON operations from Infers.Toys.
4 people like thisPosted: 8 years ago by Vesa Karvonen
Given a location as a float tuple (latitude, longitude) it will return the plane closest nearby as a JsonValue using the OpenSky API. For fun also demonstrating some operator overloading with (-->) between two coordinates. I'm new to these functional languages, so please feel free to update the solution with interesting refactortings and whatnot.
4 people like thisPosted: 6 years ago by Johan Irvall
There is a namespace System.Runtime.Serialization.Json To serialize generic object you can do like this...
3 people like thisPosted: 3 years ago by Tuomas Hietanen