<p dir="ltr">I have no experience with the FFI, but conceptually that sounds like a Traversable, not necessarily a Monad. I'd start small, with the simplest superclass, Functor -- so, implement fmap, then move on from there.</p>
<div class="gmail_quote">On Jun 19, 2016 6:48 AM, "nek0" <<a href="mailto:nek0@nek0.eu">nek0@nek0.eu</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello fellow haskellers,<br>
<br>
I am currently working on Haskell bindings to the GEGL [0] library.<br>
Since it's my first time working with the FFI and the whole idea of<br>
binding a library into Haskell, I have now run into a problem I can't<br>
resolve myself.<br>
The GEGL headers expose a function "gegl_buffer_iterator_new" which<br>
returns an iterator over a selected area in a buffer. This iterator<br>
contains a float pointer with pixel data. My problem is to make the<br>
iterator and the data it contains accessible to Haskell and to iterate<br>
over it.<br>
Can someone of you please help me with this problem? One of my initial<br>
thoughts was to wrap it into a monad, but I am totally inexperienced<br>
with that.<br>
My project can be found on my Github profile [1].<br>
<br>
Many thanks in advance,<br>
<br>
nek0<br>
<br>
links:<br>
<br>
[0]: <a href="http://www.gegl.org/" rel="noreferrer" target="_blank">http://www.gegl.org/</a><br>
[1]: <a href="https://github.com/nek0/gegl" rel="noreferrer" target="_blank">https://github.com/nek0/gegl</a><br>
<br>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.<br></blockquote></div>