[Haskell-beginners] First Project: Imperative Algorithm Visualization tool
daniel.trstenjak at gmail.com
Mon Nov 10 09:26:38 UTC 2014
On Sun, Nov 09, 2014 at 11:19:48PM +0530, Adit Biswas wrote:
> So my higher level idea on approaching this problem is:
> 1. Create a dsl for describing data structures, e.g Link lists,
> trees, graphs
> 2. Create a dsl for describing each step of the algorithms
> manipulating the data structures
> 3. The algorithms would be a monadic composition of the step ADTs
> 4. Lift the algorithm to some monad which carries out the side
> effects of making changes to a visualization.
I would start with defining the data structures which represent
your algorithm and then defining a function that renders your data.
If you're using OpenGL ist could be as simple as:
render :: YourData -> IO ()
If you've a working version of this, then you could try defining
a DSL, and if you want a monadic one, then most likely you will
be using a free monad[1,2], so you don't have to write your own one.
But at the end runnning your DSL will just result into 'YourData'
and you can reuse your 'render' function.
You don't need any kind of special Monad for the rendering and
I also don't see any kind of advantage having one.
More information about the Beginners