<?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://permalink.gmane.org/gmane.comp.lang.haskell.beginners">
    <title>gmane.comp.lang.haskell.beginners</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.haskell.beginners</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://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9969"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9968"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9967"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9966"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9965"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9964"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9963"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9962"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9961"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9960"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9959"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9958"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9957"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9956"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9955"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9954"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9953"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9952"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9950"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9949"/>
      </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://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9969">
    <title>Re: Stymied by mutable arrays in the ST monad</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9969</link>
    <description>&lt;pre&gt;Brilliant. I think I've got it now. Thanks heaps, Tobias.

On Sat, May 26, 2012 at 4:01 AM, Tobias Brandt &amp;lt;tob.brandt&amp;lt; at &amp;gt;googlemail.com&amp;gt;wrote:

&lt;/pre&gt;</description>
    <dc:creator>Matthew Moppett</dc:creator>
    <dc:date>2012-05-25T18:25:37</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9968">
    <title>Re: Stymied by mutable arrays in the ST monad</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9968</link>
    <description>&lt;pre&gt;Thanks, Tobias.

I guess my eyes kind of glazed over when I read "getElems :: (MArray a e
m, Ix i) =&amp;gt; a i e -&amp;gt; m [e]" in the docs, and didn't relate that to the
meaning of "return"... lesson learnt.

About the extra type info needed -- what part of the type "ST s (STArray s
Int Int)" is the compiler unable to infer?

I've worked out from this that the error message "no instance for"... might
signal a missing type signature, but I'm having trouble working out the
general lesson of when the compiler needs some extra hints.


On 25 May 2012 18:50, Matthew Moppett &amp;lt;matthewmoppett&amp;lt; at &amp;gt;gmail.com&amp;gt; wrote:

'getElems array' already has type 'ST s [Int]', you don't need
another 'return'. Furthermore you need to help out with the type
inference a little bit (it's similar to the read-show problem).
This should work:

idST :: [Int] -&amp;gt; [Int]
idST xs = runST $ do
   array &amp;lt;- newListArray (1, (length xs)) xs :: ST s (STArray s Int Int)
   getElems array

(You could also replace STArray by STUArray.)
&lt;/pre&gt;</description>
    <dc:creator>Matthew Moppett</dc:creator>
    <dc:date>2012-05-25T17:43:04</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9967">
    <title>Re: Stymied by mutable arrays in the ST monad</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9967</link>
    <description>&lt;pre&gt;
'getElems array' already has type 'ST s [Int]', you don't need
another 'return'. Furthermore you need to help out with the type
inference a little bit (it's similar to the read-show problem).
This should work:

idST :: [Int] -&amp;gt; [Int]
idST xs = runST $ do
    array &amp;lt;- newListArray (1, (length xs)) xs :: ST s (STArray s Int Int)
    getElems array

(You could also replace STArray by STUArray.)

&lt;/pre&gt;</description>
    <dc:creator>Tobias Brandt</dc:creator>
    <dc:date>2012-05-25T17:05:01</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9966">
    <title>Stymied by mutable arrays in the ST monad</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9966</link>
    <description>&lt;pre&gt;I've been trying to use mutable arrays in the ST monad, and wrote out a
little proof of concept function:

idST :: [Int] -&amp;gt; [Int]
idST xs = runST $ do
    array &amp;lt;- newListArray (1, (length xs)) xs
    return (getElems array)

&lt;/pre&gt;</description>
    <dc:creator>Matthew Moppett</dc:creator>
    <dc:date>2012-05-25T16:50:57</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9965">
    <title>Re: Missing some functions in Hoogle</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9965</link>
    <description>&lt;pre&gt;Thanks Paulo for your comment and sorry for late reply.

On Tue, May 22, 2012 at 11:09 PM, Paulo Pocinho &amp;lt;pocinho&amp;lt; at &amp;gt;gmail.com&amp;gt; wrote:

What does this part mean?
With Hoogle package, you can generate databases for any library, but
the search works only for standard libraries?

Although this is consistent with what I experienced, it's a bit
surprising because this means generating database doesn't make any
sense, does it?

Hayhoo seems to suit what I want.

&lt;/pre&gt;</description>
    <dc:creator>Ken Kawamoto</dc:creator>
    <dc:date>2012-05-25T14:04:26</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9964">
    <title>Re: Help!,was Re: Trouble with "import qualified"</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9964</link>
    <description>&lt;pre&gt;


In particular, it was recently found that GHC doesn't ignore the byte order
marks that some versions of Notepad and friends prepend to text files even
in UTF8 mode.

&lt;/pre&gt;</description>
    <dc:creator>Brandon Allbery</dc:creator>
    <dc:date>2012-05-24T17:46:06</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9963">
    <title>Re: Help!, was Re: Trouble with "import qualified"</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9963</link>
    <description>&lt;pre&gt;
When you say "had this up", what do you mean?  I don't see any other
messages from you to the haskell-beginners list.


It's impossible to tell what's wrong only from this description.  If
you upload an *exact* copy of your file somewhere (e.g. hpaste.org)
I'm sure someone could take a look.  Some general things to watch out
for:

  * the real error could be in the previous line to the one being
    reported

  * all the imports have to come at the very beginning of a module

  * don't put any spaces or tabs before "import"

-Brent

&lt;/pre&gt;</description>
    <dc:creator>Brent Yorgey</dc:creator>
    <dc:date>2012-05-24T17:43:11</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9962">
    <title>Re: Help!,was Re: Trouble with "import qualified"</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9962</link>
    <description>&lt;pre&gt;
For a second I was sure I sent this to the wrong list =)

If the OP doesn't see any misplaced whitespace at the beginning of the
file, I'd also check that there's isn't any unicode junk there.


&lt;/pre&gt;</description>
    <dc:creator>Michael Orlitzky</dc:creator>
    <dc:date>2012-05-24T17:35:49</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9961">
    <title>Re: Help!,was Re: Trouble with "import qualified"</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9961</link>
    <description>&lt;pre&gt;It sounds mostly likely that there were spaces or tabs in the wrong place.

Good luck....

On Thu, May 24, 2012 at 9:58 AM, Keshav Kini &amp;lt;keshav.kini&amp;lt; at &amp;gt;gmail.com&amp;gt; wrote:

&lt;/pre&gt;</description>
    <dc:creator>Tim Perry</dc:creator>
    <dc:date>2012-05-24T17:23:45</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9960">
    <title>Re: Help!,was Re: Trouble with "import qualified"</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9960</link>
    <description>&lt;pre&gt;
I doubt this really matters when it comes to import statements, but note
that the Haskell platform's latest release is using GHC/GHCi version
7.0.4.

(hi mjo :) )

-Keshav


&lt;/pre&gt;</description>
    <dc:creator>Keshav Kini</dc:creator>
    <dc:date>2012-05-24T16:58:53</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9959">
    <title>Re: Help!,was Re: Trouble with "import qualified"</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9959</link>
    <description>&lt;pre&gt;
Try starting from a fresh file? I just tried the simplest thing I could
think of to reproduce this, but it worked:

jumba ~ $ echo "import qualified Data.Map as Map" &amp;gt;&amp;gt; test.hs
jumba ~ $ echo "main = print \"Hello, World\"" &amp;gt;&amp;gt; test.hs
jumba ~ $ runhaskell test.hs
"Hello, World"
jumba ~ $ ghci
GHCi, version 7.4.1: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude&amp;gt; :l test.hs
[1 of 1] Compiling Main             ( test.hs, interpreted )
Ok, modules loaded: Main.
*Main&amp;gt; main
Loading package array-0.4.0.0 ... linking ... done.
Loading package deepseq-1.3.0.0 ... linking ... done.
Loading package containers-0.4.2.1 ... linking ... done.
"Hello, World"
*Main&amp;gt;

&lt;/pre&gt;</description>
    <dc:creator>Michael Orlitzky</dc:creator>
    <dc:date>2012-05-24T16:49:59</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9958">
    <title>Help!, was Re: Trouble with "import qualified"</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9958</link>
    <description>&lt;pre&gt;Hi.  I've had this up for over a week, and haven't received any 
response.  Any help would be greatly appreciated.

On 5/16/12 10:04 PM, Dudley Brooks wrote:


&lt;/pre&gt;</description>
    <dc:creator>Dudley Brooks</dc:creator>
    <dc:date>2012-05-24T16:34:22</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9957">
    <title>Re: Traverse tree with computing current level using Foldable instance.</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9957</link>
    <description>&lt;pre&gt;
By the way, for this sort of pattern where you change the state for
some subcomputation and then restore it after the subcomputation
returns, it can be much nicer to use the Reader monad with the 'local'
function instead of the State monad.  That might actually go a long
way towards making the monadic version nicer to read. =)

-Brent

&lt;/pre&gt;</description>
    <dc:creator>Brent Yorgey</dc:creator>
    <dc:date>2012-05-24T12:54:23</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9956">
    <title>Re: Traverse tree with computing current level using Foldable instance.</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9956</link>
    <description>&lt;pre&gt;
Hi, Chaddaï. Thanks for the clarification!

Now i think i get it. Here is three my solutions. First one is (as you 
suggest)
without monads:

 &amp;gt; import Data.Monoid
 &amp;gt; import Control.Monad.State
 &amp;gt;
 &amp;gt; data Tape a             =  Tape a [Tape a]
 &amp;gt;
 &amp;gt; foldTape :: (a -&amp;gt; [b] -&amp;gt; b) -&amp;gt; Tape a -&amp;gt; b
 &amp;gt; foldTape f (Tape name ts)
 &amp;gt;                         = f name (map (foldTape f) ts)
 &amp;gt;
 &amp;gt; foldTapeD :: (Monoid m) =&amp;gt; (Int -&amp;gt; a -&amp;gt; m) -&amp;gt; Tape a -&amp;gt; m
 &amp;gt; foldTapeD f t           = (foldTape (go f) t) 0
 &amp;gt;   where
 &amp;gt;     go :: (Monoid m) =&amp;gt; (Int -&amp;gt; a -&amp;gt; m) -&amp;gt; a -&amp;gt; [(Int -&amp;gt; m)] -&amp;gt; (Int 
-&amp;gt; m)
 &amp;gt;     go f name xs        = \cs -&amp;gt;
 &amp;gt;                           foldr (mappend . ($ (cs + 1))) (f cs name) xs

second one with monadic go function:

 &amp;gt; foldTapeD1 :: (Monoid m) =&amp;gt; (Int -&amp;gt; a -&amp;gt; m) -&amp;gt; Tape a -&amp;gt; m
 &amp;gt; foldTapeD1 f t          = fst $ runState (foldTape (go f) t) 0
 &amp;gt;   where
 &amp;gt;     go :: (Monoid m) =&amp;gt; (Int -&amp;gt; a -&amp;gt; m) -&amp;gt; a -&amp;gt; [State Int m] -&amp;gt; 
State Int m
 &amp;gt;     go f name xs        = do
 &amp;gt;                             cs &amp;lt;&lt;/pre&gt;</description>
    <dc:creator>Dmitriy Matrosov</dc:creator>
    <dc:date>2012-05-24T11:09:24</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9955">
    <title>Re: [Haskell-cafe] Most C++ compilers will not optimize x^2.0 as x*x but instead will do an expensive ...</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9955</link>
    <description>&lt;pre&gt;
I don't think anyone's disputing that, it's just that the form of many
of his/her messages + lack of threading means that they'll get ignored
(because they don't make sense without context... which is unavailable)
or that KC will get killfiled (after seeing enough "meaningless"
messages from a person this tends to happen). Which would be a shame.

Regards,


&lt;/pre&gt;</description>
    <dc:creator>Bardur Arantsson</dc:creator>
    <dc:date>2012-05-24T03:33:38</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9954">
    <title>Re: [Haskell-cafe] Most C++ compilers will not optimize x^2.0 as x*x but instead will do an expensive ...</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9954</link>
    <description>&lt;pre&gt;Just to play devil's advocate, if you look back at the list, KC has
written a lot of helpful and informative messages in the past.

Tom

On 5/23/12, Bardur Arantsson &amp;lt;spam&amp;lt; at &amp;gt;scientician.net&amp;gt; wrote:

&lt;/pre&gt;</description>
    <dc:creator>Tom Murphy</dc:creator>
    <dc:date>2012-05-24T03:24:04</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9953">
    <title>Re: [Haskell-cafe] Most C++ compilers will not optimize x^2.0 as x*x but instead will do an expensive ...</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9953</link>
    <description>&lt;pre&gt;
Right. I was actually just about to respond to (only) KC in person, but
perhaps unwisely, decided to "hijack" your response to add a little
explanation for everyone.

You are of course right that not quoting context and just randomly
spewing out small bits of text is not really suitable for a mailing list.


&lt;/pre&gt;</description>
    <dc:creator>Bardur Arantsson</dc:creator>
    <dc:date>2012-05-24T02:39:34</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9952">
    <title>Re: [Haskell-cafe] Most C++ compilers will not optimize x^2.0 as x*x but instead will do an expensive ...</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9952</link>
    <description>&lt;pre&gt;

That, however, ignores the rest of it; the lack of references in this case
forms a pattern with the other things I noted, in that a conversation is
apparently being held in the form of single observations emitted at the
point of observation instead of being collected and presented *as* a
conversation.

&lt;/pre&gt;</description>
    <dc:creator>Brandon Allbery</dc:creator>
    <dc:date>2012-05-24T02:31:32</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9950">
    <title>Re: Most C++ compilers will not optimize x^2.0 as x*x but instead will do an expensive ...</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9950</link>
    <description>&lt;pre&gt;

Is it me or is this style of message — content broken between subject and
body, no reference information tying it to the presumed topic (or possibly
a /non sequitur/) — better suited to Twitter than a mailing list?

&lt;/pre&gt;</description>
    <dc:creator>Brandon Allbery</dc:creator>
    <dc:date>2012-05-24T02:13:33</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9949">
    <title>Most C++ compilers will not optimize x^2.0 as x*x but instead will do an expensive ...</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9949</link>
    <description>&lt;pre&gt;exponentiation and logarithm.

So, I believe this C++ versus Haskell versus (your language of choice) is a
Penn &amp;amp; Teller misdirection.

Whereas, another level of indirection solves everything.

&lt;/pre&gt;</description>
    <dc:creator>KC</dc:creator>
    <dc:date>2012-05-24T01:47:31</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9948">
    <title>Re: Traverse tree with computing current level using Foldable instance.</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.haskell.beginners/9948</link>
    <description>&lt;pre&gt;
So, you wrote it correctly :


This appears desperate since there's no mention of Int anywhere in
this function and the function applied stay the same whatever the
level : the initially given f parameter.
But there's a trick to this, we'll have to treat some of our type
variable like functions, here only b can vary freely (a is imposed by
the Tape a inputted), so let's see what it looks like if we make it a
functional type (with Int parameter):


much more promising wouldn't you say ? The solution now looks like that :


I let you write your solution (if you didn't find before tomorrow
evening, I'll give you the answer).

You can then call foldTapeD thus :


(much nicer than your initial solution, is it not ?)
&lt;/pre&gt;</description>
    <dc:creator>Chaddaï Fouché</dc:creator>
    <dc:date>2012-05-23T16:48:27</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.lang.haskell.beginners">
    <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.beginners</link>
  </textinput>
</rdf:RDF>

