[Haskell-cafe] Map constructor in a DSL

Dupont Corentin corentin.dupont at gmail.com
Tue Oct 26 13:42:12 EDT 2010

Hey Chris!
Values for PlayerNumber are acquired at evaluation time, from the state of
the system.

I have not included the evaluation of AllPlayers.
Here how it looks:

evalObs AllPlayers  = return . pure  =<< gets players

But when you build your Obs, you have yet no idea how much players it will
This is just symbolic at this stage.

To give you a better insight, here is want I want to do with Map:

everybodyVote :: Obs [Bool]
everybodyVote = Map (Vote (Konst "Please vote")) AllPlayers

In memory, everybodyVote is just a tree.
This rule can be executed latter whenever I want to perform this democratic
vote ;)

Hope this answer to your question.

On Tue, Oct 26, 2010 at 7:17 PM, Christopher Done
<chrisdone at googlemail.com>wrote:

> On 26 October 2010 18:07, Dupont Corentin <corentin.dupont at gmail.com>
> wrote:
> > But how can I write the evaluator for Map?
> Where do values for PlayerNumber come from? Unless I'm mistaken, the
> only thing that Map can be used with is Obs [PlayerNumber], a list of
> values PlayerNumber which we have no means of acquiring in order to
> provide to the Map function.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20101026/bf3daac2/attachment.html

More information about the Haskell-Cafe mailing list