Skip to content

Instantly share code, notes, and snippets.

(*
JsonParser.fsx
A JSON parser built from scratch using a combinator library.
Related blog post: http://fsharpforfunandprofit.com/posts/understanding-parser-combinators-4/
*)
#load "ParserLibrary.fsx"
(*
ParserLibrary.fsx
Final version of a parser library.
Related blog post: http://fsharpforfunandprofit.com/posts/understanding-parser-combinators-3/
*)
module TextInput =
open System
(*
ParserLibrary_v2.fsx
Version 2 of the code for a parser library.
Related blog post: http://fsharpforfunandprofit.com/posts/understanding-parser-combinators-2/
*)
open System
(*
ParserLibrary_v1.fsx
Version 1 of the code for a parser library.
Related blog post: http://fsharpforfunandprofit.com/posts/understanding-parser-combinators/
*)
open System
module SimplifiedVendorExample =
type Product =
| Bought of string
| Made of Product list
let rec cataProduct fBought fMade product :'r =
let recurse = cataProduct fBought fMade
match product with
@swlaschin
swlaschin / RecursiveTypesAndFold-3b-json-with-error-handling.fsx
Last active August 30, 2015 19:53
Serializing and deserializing a tree to JSON (with error handling). Related blog post: http://fsharpforfunandprofit.com/posts/recursive-types-and-folds-3b/
(*
RecursiveTypesAndFold-3b-json-with-error-handling.fsx
Related blog post: http://fsharpforfunandprofit.com/posts/recursive-types-and-folds-3b/
*)
// ==============================================
// PART 3b - Serializing and deserializing a tree to JSON (with error handling)
// ==============================================
(*
RecursiveTypesAndFold-3b-json.fsx
Example: Serializing and deserializing a tree to JSON
Related blog post: http://fsharpforfunandprofit.com/posts/recursive-types-and-folds-3b/
*)
// ==============================================
// PART 3b - Serializing and deserializing a tree to JSON (without error handling)
(*
RecursiveTypesAndFold-3b-database.fsx
Example: Storing a tree in a database
Related blog post: http://fsharpforfunandprofit.com/posts/recursive-types-and-folds-3b/
*)
// ==============================================
// PART 3b - Storing a tree in a database
(*
RecursiveTypesAndFold-3b-grep.fsx
Related blog post: http://fsharpforfunandprofit.com/posts/recursive-types-and-folds-3b/
*)
// ==============================================
// PART 3b - Parallel grep
// ==============================================