[Haskell-cafe] Map constructor in a DSL
corentin.dupont at gmail.com
Tue Oct 26 13:42:12 EDT 2010
Values for PlayerNumber are acquired at evaluation time, from the state of
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
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>
> > 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...
More information about the Haskell-Cafe