Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Re: dynamic set of objects in netwire (Nathan H?sken)
2. Re: dynamic set of objects in netwire (Ertugrul S?ylemez)
----------------------------------------------------------------------
Message: 1
Date: Thu, 08 Nov 2012 22:33:56 +0100
From: Nathan H?sken <[email protected]>
Subject: Re: [Haskell-beginners] dynamic set of objects in netwire
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
On 11/08/2012 06:58 PM, Nathan H?sken wrote:
> On 11/07/2012 07:46 PM, Ertugrul S?ylemez wrote:
>> Nathan H?sken <[email protected]> wrote:
>>
>>> I need (in netwire) a way to handle a dynamic set of objects.
>>> Therefor I need a way of growing and shrinking the set. Since I have
>>> little experience with Haskell and FRP, I would appreciate some input.
>>>
>>> Shrinking is not problem, as I can just remove wires that inhibit. But
>>> how to let the set grow?
>>
>> Originally the 4.0.0 release should include the manager wire, but I have
>> long tried to come up with an interface that is generic enough to fit in
>> as many situations as possible.
>>
>> The most obvious interface is through input. However, this really only
>> works when only the user of the manager should be able to add or remove
>> subwires. The interface is as simple as something like this:
>>
>> data MgrMsg k e m a b =
>> Add k (Wire e m a b) |
>> Delete k
>>
>> managerBasic ::
>> (Monad m, Monoid b, Ord k) =>
>> Wire e m (a, [MgrMsg k e m a b]) b
>
> Mmh, how could you (form the outside) connect the output to the
> induvidual managed wires?
> Let's say I from one of the values in the output "b" I decide I want to
> delete the corresponding wire? I need to know the key "k". OK, I could
> encode "k" in the output but should I then not explicitly return "k"
> with it?
Acually I am just realizing that I can "plumb" my wires so, that its
output is (k,b) to get exactly this effect.
------------------------------
Message: 2
Date: Fri, 9 Nov 2012 04:06:54 +0100
From: Ertugrul S?ylemez <[email protected]>
Subject: Re: [Haskell-beginners] dynamic set of objects in netwire
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"
Nathan H?sken <[email protected]> wrote:
> >> The most obvious interface is through input. However, this really
> >> only works when only the user of the manager should be able to add
> >> or remove subwires. The interface is as simple as something like
> >> this:
> >>
> >> data MgrMsg k e m a b =
> >> Add k (Wire e m a b) |
> >> Delete k
> >>
> >> managerBasic ::
> >> (Monad m, Monoid b, Ord k) =>
> >> Wire e m (a, [MgrMsg k e m a b]) b
> >
> > Mmh, how could you (form the outside) connect the output to the
> > induvidual managed wires?
> > Let's say I from one of the values in the output "b" I decide I want
> > to delete the corresponding wire? I need to know the key "k". OK, I
> > could encode "k" in the output but should I then not explicitly
> > return "k" with it?
>
> Acually I am just realizing that I can "plumb" my wires so, that its
> output is (k,b) to get exactly this effect.
This is a more general problem: How does a subwire /select/ a key for a
new wire it wants to create? To most obvious answer is to use the
underlying monad, which should be safe enough. Otherwise you can allow
adding without a key and the corresponding subwire then gets the key fed
back.
Greets,
Ertugrul
--
Not to be or to be and (not to be or to be and (not to be or to be and
(not to be or to be and ... that is the list monad.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20121109/65374ff9/attachment-0001.pgp>
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 53, Issue 14
*****************************************