Skip to content
Robert Peszek edited this page Aug 27, 2016 · 5 revisions

Wiki pages in this projects are all markdown clones of literate Haskell programs. Originals are in 'play' source folder. I wrote a simple conversion program which replaces LaTeX like code blocks with Markdown code blocks allowing me to publish these here.

Legend:
File SN_Xxxx_EMM_Yyyyyyyy.md format abbreviates

  • 'SN': section number N
  • 'Xxxx': section short name
  • 'EMM': example number MM'
  • 'Yyyyyyyy' short title.

So S2_Free_E03_BFS2.md is Example 2.03 in section 2 about free monads and is about BFS traversal.

Examples can cross-reference one another using N.MM (like so: Example 1.02).

TOC

  • Section 1 - Graphs defined using constraint based polymorphism, Haskell type classes with functional dependencies are used to define inheritance.
  • Example 1.01 (S1_Cstr_E01_UnsafeDiamond) Construction of polymophic grah which uses deserialization and is unsafe (can throw errors)
  • Example 1.02 (S1_Cstr_E02_SafeDiamond) Safe version of previous example.
  • Example 1.03 (S1_Cstr_E03_PolyReloaded) A dimond graph instance is reloaded into a polymorphic graph and made into infite graph.
  • Example 1.04 (S1_Cstr_E04_PolyToMax) Instance is not speficied until very last moment. The whole computation remains polymorphic.
  • Example 1.05 (S1_Cstr_E05_Samples) Sample graphs for use in future examples. Applicative and monadic lists are used to simplify the code.
  • Section 2 - DSL-Interpreter desing pattern using Free Monad.
  • Example 2.01 (S2_Free_E01_PolyForFree) Simple DSL to build graphs. Only usage of that DSL is shown.
  • Example 2.02 (S2_Free_E02_BFS) Presents DSL which accumulates information from Breadth-first Search Traversal driven by the interpreter. Example calculate distance on the graph.
  • Example 2.03 (S2_Free_E03_BFS2) Polymorphic generalization of previous example, distance is generalized to shortest path.
  • Example 2.04 (S2_Free_E04_SpanTree) 2 DSL are compined, a BFS traversal DSL observes the traversal and creates a program in Tree building DSL to build the spanning tree. Uses map-reduce with DSL program composition as the reduction step.
  • Example 2.05 (S2_Free_E05_Ratings) Free-Cofree pattern demonstrated with creation of a new DSL, this example builds a new DSL that rates things.
  • Example 2.06 (S2_Free_E06_WalkAndRate) Vertex walk DSL and Rating DSL are combined using Free-Cofree pattern to form a higher level language.
Clone this wiki locally