Skip to content

programmable graphics

after #650 (closed) , we now want (simple) programs: first order pure functional.

[EDIT] short desciption of this project - see https://mail.haskell.org/pipermail/haskell-cafe/2020-December/133175.html

We have

data PictExp = Circle Pos | Row [ PictExp ] | ...

We want

data Program 
  = Circle Pos | Row [ Program ] | ... 
  | Apply Name [Program] | Let [(Name [Name],Program)] Program 

we should really make this more general (abstract from a concrete semantic domain).

Perhaps

data PictF e = Circle Pos | Row [e] | ...

data Program f 
   -- | domain specific:
  = Op (f (Program f)
   -- | general:
  | Apply Name [Program f] | Let [(Name [Name],Program f)] (Program f)

We get the original (name-free) expression type back via

newtype PictExp = PictExp (PictF PictExp)

Do we really want this (refactor the existing exercise)?

We can then no longer use the generic parser because of extra constructors (really?)

Edited by waldmann