<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.comp.lang.haskell.cafe">
    <title>gmane.comp.lang.haskell.cafe</title>
    <link>http://blog.gmane.org/gmane.comp.lang.haskell.cafe</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98485"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98479"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98463"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98462"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98461"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98451"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98437"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98429"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98426"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98420"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98415"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98407"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98403"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98393"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98392"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98389"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98387"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98369"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98366"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98361"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98485">
    <title>gona to join in haskell-cafe</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98485</link>
    <description>&lt;pre&gt;Hello,friends!
     I come from China, wishing to enjoy haskell with you.

&lt;/pre&gt;</description>
    <dc:creator>Dante.py</dc:creator>
    <dc:date>2012-05-26T00:58:59</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98479">
    <title>Template Haskell antiquotation in user-definedquasiquoters</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98479</link>
    <description>&lt;pre&gt;Template Haskell supports antiquotation for built-in quasiquotes, e.g.:

   [| \x -&amp;gt; x + $([|3 * 4|]) |]

However, as far as I can tell, there is no way of supporting 
antiquotation in user-defined quasiquoters, because the only way to 
specify a new quasiquoter is through a quoteExp function of type String 
-&amp;gt; Q Exp. Of course, it is perfectly possible to write a parser for some 
fragment of Haskell inside your quoteExp function, but that seems crazy 
given that Template Haskell or rather GHC already implements a parser 
for the whole language.

I know about Language.Haskell.Exts.Parser in haskell-src-exts, which 
provides parseExp :: String -&amp;gt; ParseResult Exp, but that Exp is a 
different type to the one provided by Template 
Haskell.&amp;lt;http://hackage.haskell.org/packages/archive/haskell-src-exts/1.9.0/doc/html/Language-Haskell-Exts-Syntax.html#t:Exp&amp;gt; 
I'm also aware of Dominic Orchard's syntax-trees package, which supports 
converting between the two representations using a cunning hack that 
pretty-prints the haskell-src-exts representation to a string and uses 
Template Haskell to parse it back.

Is there a saner way of simulating antiquotation in user-defined 
quasiquoters?

Sam


&lt;/pre&gt;</description>
    <dc:creator>Sam Lindley</dc:creator>
    <dc:date>2012-05-25T19:51:38</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98463">
    <title>Problem with packet documentation generated by cabalon windows 7</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98463</link>
    <description>&lt;pre&gt;Hi cafe,

I have a problem with haddock documentation created when installing new 
packages with cabal on windows.
The generated html files have all links in the form 
j:\Users\...\doc\...\xxx.html, but firefox says, it cannot open that link.
Actually all links should be prefixed by "file:///".

I wonder if this is only on windows so and if there is a solution to 
this. Is there a cabal or haddock flag for this?

Nicu
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe&amp;lt; at &amp;gt;haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
&lt;/pre&gt;</description>
    <dc:creator>Nicu Ionita</dc:creator>
    <dc:date>2012-05-24T23:19:11</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98462">
    <title>webcam library on github</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98462</link>
    <description>&lt;pre&gt;Hello Cafe,

since I haven't found anything like that, I wrote a small library [1] to
read from a webcam in Haskell, using V4L on Linux. It uses the v4l2
package and repa for images.
Is anyone interested in contributing to that, or giving some hints on
how it could be made faster (I am not sure if I use repa correctly for
best performance at all times), or just in emitting any other
constructive comments? If yes, please give me a shout.


Cheers,
Christian
PS I would put the whole thing on hackage, but my cabal currently
doesn't want to do an sdist.


[1] https://github.com/cgo/hsimage
&lt;/pre&gt;</description>
    <dc:creator>.</dc:creator>
    <dc:date>2012-05-24T22:20:40</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98461">
    <title>"Generic figures and their glueings" book .....please help</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98461</link>
    <description>&lt;pre&gt;Hello,

      I think the above book by Reyes, Reyes and Zolfaghari is quite
intriguing. At the same time I can't get my mind around the notions of
"generic figures" and "change of figures"! The first seems to be
objects in the base category and the latter morphisms in the base
category. Whoever has read this book and understands it please give me
some pointers. Sorry the vague call for help.

Kind regards,

Vasili
&lt;/pre&gt;</description>
    <dc:creator>Vasili I. Galchin</dc:creator>
    <dc:date>2012-05-24T19:03:20</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98451">
    <title>What is the difference between runhaskell andcompile?</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98451</link>
    <description>&lt;pre&gt;Hi,
  I am writing a small program using LDAP hackage. A weird problem occured.
  When the code was run by runhaskell, things were fine, worked as expected.
  But when ghc compiled (no any args), and ran, I got this: LDAP
error: ldapSimpleBind: LDAPException LdapServerDown(-1): Can't contact
LDAP server.
  There is sure no problem with the server.
  So I am confused. I thought the two supposed to be the same.
&lt;/pre&gt;</description>
    <dc:creator>Magicloud Magiclouds</dc:creator>
    <dc:date>2012-05-24T09:36:26</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98437">
    <title>question about linking with sqlite3</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98437</link>
    <description>&lt;pre&gt;Hi, I made a cabal package that use HDBC-sqlite3 on Windows.
When cabal install it, I got an error from ld.exe: cannot find -lsqlite3.
How can I tell ld.exe where sqlite3.dll is plcaed?

Thanks.
&lt;/pre&gt;</description>
    <dc:creator>Canhua</dc:creator>
    <dc:date>2012-05-24T02:04:11</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98429">
    <title>Haskell Meeting Munich</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98429</link>
    <description>&lt;pre&gt;Dear all,

our local hackathon in Munich on the 12th of May was a real success. 
Thanks to all those who joined! Look at the
site for a picture:

http://www.haskell-munich.de/dates

Our next regular meeting is on Monday, the 28th of May at Cafe Puck at 
19h30. This is a holiday in Germany.
We hope that many of you will come! If you plan to do so, please click 
the button on the above mentioned site.

Until then, I wish all of you a nice time,
Heinrich

--

hoerdegen&amp;lt; at &amp;gt;funktional.info
www.funktional.info
&lt;/pre&gt;</description>
    <dc:creator>Heinrich Hördegen</dc:creator>
    <dc:date>2012-05-23T14:28:27</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98426">
    <title>Typed TemplateHaskell?</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98426</link>
    <description>&lt;pre&gt;Hello Haskell world.

One well-known missfeature of TemplateHaskell is it's «untypedness». I 
mean, that if you have say an expression (Exp or Q Exp), you do not know 
it's type (does it represent String or Int or whatever). And GHC does 
not know too. So, one could easily construct bad-typed expressions using 
TH, and GHC will complain only on generated code, not on TH code.

Such a missfeature was a reasoned decision, because adding some typing 
into TH will add much complexity to compiler and to language.

As far as can I see, using features of last GHC one could write typed 
TH library relatively easily, and saving backwards compatibility.

For example, now we have Q monad and Exp type in "template-haskell" 
package. Let's imagine some new package, say "typed-template-haskell", 
with new TQ monad and new polymorphic type Exp :: * -&amp;gt; *. Using last 
GHC's features, one will easily write something like "expr :: Exp 
String", which will mean that "expr" represents a string expression. And 
we will need a new function, say runTQ :: TQ a -&amp;gt; Q a (or some more 
complicated type), which will turn TypedTemplateHaskell's constructs 
into plain TH.

One question will be on quotations and antiquotations: they are 
implemented to work untyped TH constructs, how to implement 
compatibility with new typed TH? We could add some support of them to 
GHC... Or, maybe define a phantom type (say, Any), and some conversion 
functions, say untyped :: Language.Haskell.TH.Syntax.Exp -&amp;gt; 
Language.Haskell.TH.Typed.Syntax.Exp Any.

Main idea is: seems new GHC enables us to implement "typed TH" without 
modifying GHC itself, only by writing a library. Is it so?

Any further thoughts?

With best regards,
Ilya Portnov.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe&amp;lt; at &amp;gt;haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
&lt;/pre&gt;</description>
    <dc:creator>Ilya Portnov</dc:creator>
    <dc:date>2012-05-23T11:45:01</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98420">
    <title>HPC question</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98420</link>
    <description>&lt;pre&gt;Dear Haskell Cafe,

I've been playing around with the -fhpc option to GHC and have come 
across some things being highlighted yellow in the HTML markup for which 
I can't work out the right way to 'cover' them.

A cut down program that shows what I'm talking about is at 
http://hpaste.org/68888

Looking at the output of hpc show, I see:

    47          0 Main                            15:6-15:9 ExpBox False
    48          2 Main                            15:6-15:9 ExpBox False
    49          0 Main                            15:6-15:9 ExpBox False
    50          0 Main                            15:6-15:9 ExpBox False
    51          1 Main                          22:13-22:14 TopLevelBox 
["=="]
    52          0 Main                          22:13-22:14 TopLevelBox 
["/="]
    53          1 Main                          22:17-22:20 TopLevelBox 
["showsPrec"]
    54          0 Main                          22:17-22:20 TopLevelBox 
["showList"]

I.e. each of those bits whose highlighting I don't understand is made of 
some overlapping boxes, one of which is used.

Now, if I fiddle in the .tix file by hand to fake a usage of (/=) by 
changing the 52nd entry from 0 to 1, the Eq instance isn't highlighted 
any more in the HTML output. More strangely, if I then remove the usage 
of (==) by changing the 51st entry from 1 to 0, the Eq instance still 
isn't highlighted. A similar effect happens with the Show instance. It 
seems to be highlighting based only on the last entry in the .tix file, 
where there are two or more identically-placed boxes. Is this right? I'd 
have expected that if I use (==) then the deriving (Eq) clause should be 
considered 'used'.

Secondly, I can't work out what the four boxes in position 15:6-15:9 are 
supposed to be. If I use -ddump-simpl I can see many calls to 'tick' but 
there's no mention of numbers 47, 49 or 50. Perhaps they've been 
simplified away? I'm afraid I don't know what else to try dumping to get 
at the instrumented code before the simplifier's had a go at it.

I'm using Haskell Platform 2011.2.0.1 (GHC 7.0.3) on Windows if that's 
relevant.

Thanks in advance,

David

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe&amp;lt; at &amp;gt;haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
&lt;/pre&gt;</description>
    <dc:creator>David Turner</dc:creator>
    <dc:date>2012-05-23T09:40:00</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98415">
    <title>vector operations</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98415</link>
    <description>&lt;pre&gt;So I wanted to find the first index in a vector whose running sum is
greater than a given number.

The straightforward way is to create the running sum and then search:

Vector.findIndex (&amp;gt;=target) (Vector.scanl' (+) 0 vector)

But vectors are strict so it could do extra work, and what if I don't
want to generate garbage?  I could do it with a fold, but it would
have to have the ability to abort early.  Of course I could write such
a fold myself using indexing:

import qualified Data.Vector.Generic as Vector

fold_abort :: (Vector.Vector v a) =&amp;gt; (accum -&amp;gt; a -&amp;gt; Maybe accum) -&amp;gt; accum
    -&amp;gt; v a -&amp;gt; accum
fold_abort f accum vec = go 0 accum
    where go i accum = maybe accum (go (i+1)) $ f accum =&amp;lt;&amp;lt; vec Vector.!? i

find_before :: (Vector.Vector v a, Num a, Ord a) =&amp;gt; a -&amp;gt; v a -&amp;gt; Int
find_before n = fst . fold_abort go (0, 0)
    where
    go (i, total) a
        | total + a &amp;gt;= n = Nothing
        | otherwise = Just (i+1, total+a)

So it's bigger and clunkier, but I would think it would be much more
efficient (provided using Data.Vector.Generic won't inhibit inlining
and unboxing).  But I'm a bit surprised there isn't already something
like fold_abort... or is there?
&lt;/pre&gt;</description>
    <dc:creator>Evan Laforge</dc:creator>
    <dc:date>2012-05-23T04:33:36</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98407">
    <title>Haskell Day 2012 (in Japan)</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98407</link>
    <description>&lt;pre&gt;Hello Cafe,

This is just FYI.

We Hasekell community in Japan will have an event called Haskell Day
2012 on 27th May to cerebrate the publication of the Japanese version
of "Learn you". 180+ people have already registered:

# This page is written in Japanese.

http://partake.in/events/ab7f77b4-7541-47a4-867d-21a096ca883c

P.S.

The Japanese version of "Learn you" was on sale yesterday and already
sold out in many bookstores. :-)

--Kazu
&lt;/pre&gt;</description>
    <dc:creator>Kazu Yamamoto</dc:creator>
    <dc:date>2012-05-23T02:20:59</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98403">
    <title>(+1) vs let inc=(+1)</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98403</link>
    <description>&lt;pre&gt;In ghci 7.4.1:

Prelude&amp;gt; :t (+1)
(+1) :: Num a =&amp;gt; a -&amp;gt; a

Prelude&amp;gt; let inc=(+1)
Prelude&amp;gt; :t inc
inc :: Integer -&amp;gt; Integer

Why the difference?

Thanks,
Greg
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe&amp;lt; at &amp;gt;haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
&lt;/pre&gt;</description>
    <dc:creator>Greg Fitzgerald</dc:creator>
    <dc:date>2012-05-22T19:27:54</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98393">
    <title>Encoding issues with LDAP package</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98393</link>
    <description>&lt;pre&gt;Hej,

I'm using the LDAP package by John Goerzen to retrieve some information from an Active Directory database. Part of this information are the full names of my company's employees.

Many of these names contain characters which aren't part of the standard ASCII set, for example ä å ü ê and so on. When I retrieve those names from the directory (the LDAP package returns them as Strings) the encoding breaks and I get results like "R\195\188diger" instead of "Rüdiger".

The Active Directory server supports LDAP v2 and v3. I assume the OpenLDAP C API, which is the backend behind the LDAP package, automatically chooses v3 to connect if available (this is speculation, correct me if I'm wrong).

Since LDAP v3 only speaks UTF8 and ASCII I also assume that the server returns UTF8.

Is this a known problem in the LDAP package? Or is this related to the OpenLDAP C API? Or even something on the server side?

Any information would be helpful!

Best regards,
Vincent
&lt;/pre&gt;</description>
    <dc:creator>Vincent Ambo</dc:creator>
    <dc:date>2012-05-22T14:30:47</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98392">
    <title>Parallel cooperative multithreading?</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98392</link>
    <description>&lt;pre&gt;Has anyone ever worked on implementing something like this in Haskell?

http://www.cs.hmc.edu/~stone/papers/ocm-unpublished.pdf

The outline of the idea:

- Concurrent programming is really hard with the popular frameworks
today.
- For most purposes parallel programming is hard, in some part because
it requires concurrent programming.  Of course there are attempts to do
non-concurrent parallel programming, but I hope it's not too
controversial to say that such frameworks are still on the fringe.
- Cooperative concurrency is way easier than preemptive concurrency
because between invocations of pause/yield/wait, sequential reasoning
works.
- Historically, cooperative concurrency only worked on a single
processors, because running threads in parallel would break the
atomicity of sequential blocks (between invocations of p/y/w).
- Researchers have been poring tons of effort into efficiently running
blocks of code atomically.
- Hey, we can do parallel cooperative multithreading!

The paper discusses implementations in Lua, C++ and C, but I think
Haskell could be an awesome substrate for such a framework.  Has anyone
thought about this?

Ben
&lt;/pre&gt;</description>
    <dc:creator>Benjamin Ylvisaker</dc:creator>
    <dc:date>2012-05-22T13:55:41</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98389">
    <title>Data.Array.Unboxed in GHC 7.4</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98389</link>
    <description>&lt;pre&gt;Dear cafe,

I have just upgraded to GHC 7.4, and now I run into some compilation
problems. Specifically, I have a package that needs both Data.Array.Unboxed
and System.IO.Unsafe. But I cannot enable both base and haskell98 in a
cabal file. is there any way out of this?

If I enable both haskell98 and base, I get

Query.hs:1:1:
    Ambiguous module name `Prelude':
      it was found in multiple packages: base haskell98-2.0.0.1
cabal: Error: some packages failed to install:

as documented elsewhere (http://hackage.haskell.org/trac/ghc/ticket/4958)

With haskell98 replacing base, I get

Query.hs:55:8:
    Could not find module `System.IO.Unsafe'
    It is a member of the hidden package `base'.
    Perhaps you need to add `base' to the build-depends in your .cabal file.
    Use -v to see a list of the files searched for.
cabal: Error: some packages failed to install:

and without haskell98 or array, cabal tells me to add those to .cabal
build-depends.

So how can I use the Data.Array.Unboxed package together with all the stuff
from base that is not in haskell98?

Thanks,

Tom
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe&amp;lt; at &amp;gt;haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
&lt;/pre&gt;</description>
    <dc:creator>Tom Nielsen</dc:creator>
    <dc:date>2012-05-22T09:41:57</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98387">
    <title>Zipper and Comonad</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98387</link>
    <description>&lt;pre&gt;Hi all,

After using zippers for a while, I wanted to dig a bit deeper into them.
I found there is some relation between Zipper and Comonad, but this
confuses me somewhat.

After reading a bit more about Comonads [1] and [2], I think I
understand them somewhat, and I see how they too are useful for
navigating a data structures and giving functions the ability to "look
around".

What confuses me though, is the relation between these 2.
This source [3] mentions all zippers can be made instances of Comonad,
and demonstrates how to do this for simple, 1-dimensional (list)
zippers.
But a comment on [4] says a Zipper by itself is already an application
of Comonad.
I want to find out which is the case. Looking at the types does not
yield me a solution yet.

This is Zipper from LYAH:

data Tree a = Empty | Node a (Tree a) (Tree a)
data Crumb a = LeftCrumb a (Tree a) | RightCrumb a (Tree a)
type Breadcrumbs a = [Crumb a]
type Zipper a = (Tree a, Breadcrumbs a)

This is Comonad from the comonad package (flattened to 1 class):

class Functor w =&amp;gt; Comonad w where
    duplicate :: w a -&amp;gt; w (w a)
    extend :: (w a -&amp;gt; b) -&amp;gt; w a -&amp;gt; w b
    extract :: w a -&amp;gt; a

Now, if [3] is correct, I can write "instance Comonad Zipper".
If I understood all this correctly, "extend" becomes "(Zipper a -&amp;gt; b)
-&amp;gt; Zipper a -&amp;gt; Zipper b".
This gives me something like a "look-around fmap" which sounds useful.

If the comment on [4] is correct though, Zipper somehow has a Comonad
"built-in", (probably hidden the interaction between Tree and
[Crumb]).
So in that case, a Zipper would be a (somewhat customized) "instance
Comonad Tree" with some extensions.
"(Tree a -&amp;gt; b) -&amp;gt; Tree a -&amp;gt; Tree b" seems reasonable. It will build up
a new tree with the same shape as the input tree, and allows the
mapping function to examine every node _and_ its child nodes. It does
not allow "looking up" though.

So what do I make of this?
It's clear that every Zipper can be a Comonad, and it's probably
useful in some cases, but on the other hand, a Zipper already gives
the ability to look around and modify (a -&amp;gt; a) things, so the
comonadic instance only allows you to do this in a somewhat
structure-preserving way.

It's still not clear to me whether there is some truth in "a Zipper
itself is an application of Comonad". What I looked at above is just a
Tree instance, which obviously lost power compared to a full Zipper.
But I somehow feel there indeed is a somewhat deeper relation between
these 2 compared to just "can be made instance of".

Please share your thoughts.

Thanks,
Mathijs

[1] http://blog.sigfpe.com/2006/12/evaluating-cellular-automata-is.html
[2] http://blog.sigfpe.com/2008/03/comonadic-arrays.html
[3] http://blog.sigfpe.com/2007/01/monads-hidden-behind-every-zipper.html
[4] http://gelisam.blogspot.com/2007/04/i-understand-comonads.html
&lt;/pre&gt;</description>
    <dc:creator>Mathijs Kwik</dc:creator>
    <dc:date>2012-05-22T06:42:46</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98369">
    <title>Formalisation for types of monads</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98369</link>
    <description>&lt;pre&gt;When explaining monads to beginners (having an imperative background), I
found myself to say that there is *roughly* three "groups" of monads
(because they're always worried about their cost, i.e. their incidental
complexity):

- Function-oriented monads (e.g. State, Reader, Cont)
- Reductible data-oriented monads (e.g. Maybe, Identity, Writer)
- Irreductible data-oriented monads (e.g. List, free monads) (which, as I
understood, have a (&amp;gt;&amp;gt;=) operation that has a quadratic complexity if not
used properly)

Are there others "groups" I'm missing and is there terms to formalize them?
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe&amp;lt; at &amp;gt;haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
&lt;/pre&gt;</description>
    <dc:creator>Yves Parès</dc:creator>
    <dc:date>2012-05-21T13:25:40</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98366">
    <title>Mighttpd 2.6.0 has been released</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98366</link>
    <description>&lt;pre&gt;Hello cafe,

I have released Mighttpd 2.6.0:

http://mew.org/~kazu/proj/mighttpd/en/

Some users started using Mighttpd 2 and I was requested to implement
missing features for real world operation. So, I implemented the
following features in Mighttpd 2.6.0:

- Route file reloading
- Graceful shutdown for upgrading
- URL rewriting (with HTTP redirection)

For more information, please read the homepage above.

I would like to thank Michael Snoyman for merging the necessary patch
to warp.

Regards,

--Kazu
&lt;/pre&gt;</description>
    <dc:creator>Kazu Yamamoto</dc:creator>
    <dc:date>2012-05-21T02:49:34</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98361">
    <title>Cardinal Haskell RBTree?  And structural sharing.</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98361</link>
    <description>&lt;pre&gt;
I dug this haskell code of the internet wayback machine.  Don't worry,
Dons - it may be old; but it's still Golden. . .  it seems to be from
the Okasaki book with a working delete and key-value variant:

http://web.archive.org/web/20100629235553/http://www.cse.unsw.edu.au/~dons/data/RedBlackTree.html

I'm still at the lower end of Haskell expertise; but I can read this,
and am porting the concept into my Heresy library for CL.  The algorithm
seems to be proven via some haskell static means (that I don't fully
understand); but it also holds up to my heavy unit tests.

What I value from functional containers, though, is that the modded
structure shares the bulk of its identity/nodes with the prior variant. 
However, I added sharing as a metric to my unit test, so it can also
discover when a new (by identity) node exists in the modified/new
reference that is logically analogous to a node the old/prior one. . . .
.  which would waste space if people are holding various references to
evolving containers.

When purely translating this code, even in zero-change cases, one
function will build a red node from a black, only to have the caller use
*that* to build a brand new black - as across the 2 levels it has no way
of seeing that the optimal node is merely the original node.

Through some fundamental changes, and a bit of "whack a mole"
(especially in the delete case) I *think* I caught and removed them all.
. . .

Anyway, my point:  It seems that these containers can be analyzed with
respect to their pure algorithm/logical correctness; but also structural
storage.  Is there much talk on that side of the issue?  Is there any
cardinal reference for this or similar data structures with the storage
issue resolved?  I'd be interested in looking at another implementation,
especially one where the size issue isn't just tested; but proven. . . .
&lt;/pre&gt;</description>
    <dc:creator>Matt Lamari</dc:creator>
    <dc:date>2012-05-20T20:34:03</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98359">
    <title>A functional programming solution for Mr and MrsHollingberry</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.cafe/98359</link>
    <description>&lt;pre&gt;Hi all,

I'm in the process of learning how to approach problems from a
functional perspective, coming from an Object Oriented background
(mostly Smalltalk).

One of the general concerns/questions raised when talking to people in
a similar position is:
"How do I design/model a problem when I don't have my trusted classes
and objects available?"

With this in mind I've created a programming exercise where I imagine
an OO programmer would use an object hierarchy with subtype
polymorphism as part of the solution. And then I'd like to compare
functional implementations of the same problem:

https://github.com/apauley/HollingBerries

I want to see how elegant a solution I can get in a functional
language, given that the problem description is not really elegant at
all. It has a few annoying exceptions to the normal rules, typical of
what one might get in a real specification from some client.

Currently there are 3 implementations:
 - one in Erlang, my attempt at implementing a functional solution
 - one in Ruby, my attempt to see how an object hierarchy could be used
 - one in Clojure, done by one of the people in our FP user group [1]

I would love to include some Haskell implementations as well, if any
of you are interested.

Kind regards,
Andreas Pauley

1. http://www.meetup.com/lambda-luminaries/

&lt;/pre&gt;</description>
    <dc:creator>Andreas Pauley</dc:creator>
    <dc:date>2012-05-20T17:33:13</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.lang.haskell.cafe">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.lang.haskell.cafe</link>
  </textinput>
</rdf:RDF>

