GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - essenbee/fsharp-parser: A look at the fascinating subject of Parser Combinators in F#. Over 2 episodes, we create a parser capable of building expression trees for arithmetic operations.

BranchesTags
Open more actions menu

Latest commit

 

History

17 Commits
17 Commits

Folders and files

NameName
Last commit message
Last commit date
.gitignore
.gitignore
 
 
FParser.fsproj
FParser.fsproj
 
 
FParser.sln
FParser.sln
 
 
LICENSE
LICENSE
 
 
Program.fs
Program.fs
 
 
README.md
README.md
 
 

Repository files navigation

fsharp-parser

Twitter

2019-05-20

This is a project that was begun on my live coding stream Codebase Alpha episode 27. That episode is archived to my Youtube channel, along with all of my other videos. My special guest on episode 27 was Mårten Rånge, and he led me through the process of building a parser in F# from first principles.

We felt that building a parser from scratch using the F# programming language and using only a functional style would be interesting and informative, hopefully yielding a better understanding of the functional paradigm through the medium of creating a genuinely useful software artefact. It is my belief that the episode was successful in that regard! I certainly learned a lot and the content certainly stretched my mind and my imagination.

Currently, the code is in the same state as it was at the end of the stream. I do hope to have Mårten on again sometime soon to pick up where we left off, and develop the parser to such an extent, that we can then begin to look at parsing frameworks such as FParsec, and understand them at a deep level. I may make a pass through the code to make some of the code a little more verbose with respect to the naming of parameters. The functional style can be mathematically terse!

Bear in mind that the stated aim of the stream was to end up with software that could parse 1+2 and yield the answer 3. This was achieved (and we went on to parse key-value pairs as well), but time constraints meant that the parser, although it compiles and yields results, remains incomplete as of the time of committing it to this repo. Watch out for updates in the coming months!

2019-05-27

I went over the code, adding comments and making the names used in functions a little less terse. No doubt, the comments will require revision and correction over time, as my understanding grows!

2019-06-03

Episode 33 of Codebase Alpha saw Mårten Rånge return to help me build upon the firm foundations established in Episode 27. Together we built more parser combinators, ending up with a parser that should create expression trees from arithmetic strings such as

  • a+6*(5+b)/(4+1)

i.e full support for variables, operator presidence and parentheses! This episode also covered creating custom operators for our Parser<'T> type, to make using the building blocks easier and more fluent. We ended up with a brief review of the FParsec parser framework.

About

A look at the fascinating subject of Parser Combinators in F#. Over 2 episodes, we create a parser capable of building expression trees for arithmetic operations.

www.youtube.com/playlist?list=PLStUQafDNqPPrJNdyGcw94HE0SCBw1i21

Topics

codebasealphafsharpfunctional-programmingparser-combinatorsstreamer

Resources

Readme
MIT license
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.