<?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.beginners">
    <title>gmane.comp.lang.haskell.beginners</title>
    <link>http://blog.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://comments.gmane.org/gmane.comp.lang.haskell.beginners/9966"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9949"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9946"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9944"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9936"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9935"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9932"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9930"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9924"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9923"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9919"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9912"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9897"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9891"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9888"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9854"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9851"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9847"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9842"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9841"/>
      </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.beginners/9966">
    <title>Stymied by mutable arrays in the ST monad</title>
    <link>http://comments.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://comments.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://comments.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://comments.gmane.org/gmane.comp.lang.haskell.beginners/9946">
    <title>Found quote: "One of the ineradicable illusions about C++ is that the compiler should be able to see through ...</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9946</link>
    <description>&lt;pre&gt;all the abstractions and obfuscations an “advanced” C++ program contains.
First and foremost, C++ should be seen as a language that enables complexity
management. The features one has grown fond of in this concept, like
operator
overloading, object orientation, automatic construction/destruction, etc.,
are however
mostly unsuitable for efficient low-level code."

From "Introduction to High Performance Computing for Scientists and
Engineers" CRC Press, 2011.

So if one avoids such C++ complexity management features and a Haskell
compiler can see through most of the complexity management features of
Haskell; they should be comparable. :)


Casey

&lt;/pre&gt;</description>
    <dc:creator>KC</dc:creator>
    <dc:date>2012-05-23T06:48:21</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9944">
    <title>From some "High-Performance Computing" book; "It is hard to eradicate from C++'ers the need for objects, classes, etc. ..."</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9944</link>
    <description>&lt;pre&gt;"For high-performance computing you want to avoid such software engineering
abstractions as classes, objects, etc...."

Therefore, I would say, since Haskell makes possible many fine-levels of
abstraction, if the compiler can strip most of these away, then it would
come close to the speed of C (i.e. C++ without most of the software
engineering abstractions).


Still, I remember that quote that, "Another level of indirection solves
everything."

Or

If you're Penn &amp;amp; Teller, "Another level of misdirection solves everything."

Casey

&lt;/pre&gt;</description>
    <dc:creator>KC</dc:creator>
    <dc:date>2012-05-22T19:04:38</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9936">
    <title>haskell for system administration</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9936</link>
    <description>&lt;pre&gt;Hi,

I am new to HASKELL.Currently I am using shell scripting for 
Administration tasks and all.Kindly suggest me , does HASKELL usefull 
for Linux system administration and reporting purpose.?

Do we use HASKELL for network programming and all?

Regards,
Ben

&lt;/pre&gt;</description>
    <dc:creator>Ben</dc:creator>
    <dc:date>2012-05-21T14:13:47</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9935">
    <title>Traverse tree with computing current levelusing Foldable instance.</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9935</link>
    <description>&lt;pre&gt;Hi.

I can't figure out how should i properly solve the following problem.
There is a tree defined like

data Tape a             =  Tape a [Tape a]

and i want to traverse it in some specific order, computing at the same 
time current level (depth). I.e. it should like fold, and folding 
function should have access to current level in the tree. Here is my 
implementation:

import Data.Monoid
import Control.Monad.State

type TapeState a        =  State Int a
foldMapS2               :: (Monoid m) =&amp;gt; (a -&amp;gt; TapeState m) -&amp;gt; TapeState 
(Tape a) -&amp;gt; TapeState m
foldMapS2 f tt          =  do
     t&amp;lt; at &amp;gt;(Tape name ts) &amp;lt;- tt
     foldr (go f) (f name) ts
   where
     go                  :: (Monoid m) =&amp;gt; (a -&amp;gt; TapeState m) -&amp;gt; Tape a 
-&amp;gt; TapeState m -&amp;gt; TapeState m
     go f t mz           =  do
         cs &amp;lt;- get
         x &amp;lt;- foldMapS2 f (State (\s -&amp;gt; (t, s + 1)))
         put cs
         z &amp;lt;- mz
         put cs
         return (x `mappend` z)

and here is example usage

testTape                =  Tape "A" [ Tape "B"  [ Tape "C" []
                                                 , Tape "F" [Tape "G" 
[Tape "H" []]]
                                                 , Tape "E" []
                                                 ]
                                     , Tape "D"  [ Tape "I" []]
                                     ]

*Main&amp;gt; runState (foldMapS2 (\name -&amp;gt; get &amp;gt;&amp;gt;= \cs -&amp;gt; if cs == 0 then 
return [name] else return mempty) (return (testTape))) 0
(["A"],0)
*Main&amp;gt; runState (foldMapS2 (\name -&amp;gt; get &amp;gt;&amp;gt;= \cs -&amp;gt; if cs == 1 then 
return [name] else return mempty) (return (testTape))) 0
(["B","D"],0)
*Main&amp;gt; runState (foldMapS2 (\name -&amp;gt; get &amp;gt;&amp;gt;= \cs -&amp;gt; if cs == 2 then 
return [name] else return mempty) (return (testTape))) 0
(["C","F","E","I"],0)
*Main&amp;gt; runState (foldMapS2 (\name -&amp;gt; get &amp;gt;&amp;gt;= \cs -&amp;gt; if cs == 3 then 
return [name] else return mempty) (return (testTape))) 0
(["G"],0)
*Main&amp;gt; runState (foldMapS2 (\name -&amp;gt; get &amp;gt;&amp;gt;= \cs -&amp;gt; if cs == 4 then 
return [name] else return mempty) (return (testTape))) 0
(["H"],0)
*Main&amp;gt; runState (foldMapS2 (\name -&amp;gt; get &amp;gt;&amp;gt;= \cs -&amp;gt; if cs == 5 then 
return [name] else return mempty) (return (testTape))) 0
([],0)

As you can see, this just selects all elements at particular tree level.

So, my foldMapS2 looks similar to foldMap from Foldable, but i can't 
figure out, how should i define instances of Foldable (and Monoid?) to 
achieve the same functionality?

&lt;/pre&gt;</description>
    <dc:creator>Dmitriy Matrosov</dc:creator>
    <dc:date>2012-05-21T10:28:03</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9932">
    <title>Missing some functions in Hoogle</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9932</link>
    <description>&lt;pre&gt;Hi,

I'm looking for a way to search Hoogle for Yesod related functions,
say, renderRoute in Yesod.Routes.Class.

First I confirmed the Hoogle site doesn't have it in index.
http://www.haskell.org/hoogle/?hoogle=renderRoute

Then, after installing hoogle via cabal, I built index over all
packages that I have by "hoogle data -l -v all".
Below is an excerpt of the output, looks like yesod-routes is imported
to database, or indexed, correctly.
However, local Hoogle still doesn't return any entry when I searched
for "renderRoute".

---- "hoogle data -l -v all" output
Starting yesod
Starting yesod-auth
Starting yesod-core
Starting yesod-routes
Skipped 1 warnings in yesod-routes
Parse error 11:48: Parse error: family
Converting yesod-routes... done
Finished yesod-routes
Skipped 4 warnings in yesod-core
Parse error 683:77: Parse error in expression: _
Parse error 710:48: Parse error: family
Parse error 803:1: Can't translate
Parse error 806:1: Can't translate
Converting yesod-core... done
Finished yesod-core


Now I'm wondering if I'm missing something, or Hoogle supports only a
predefined set of functions.
Any advise would be appreciated.

&lt;/pre&gt;</description>
    <dc:creator>Ken Kawamoto</dc:creator>
    <dc:date>2012-05-20T23:55:51</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9930">
    <title>[x] and (x:_) for lists -- did you ever think that odd?</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9930</link>
    <description>&lt;pre&gt;Think back to when you first came across Haskell ...

This, for example (from page 4 of the Gentle Intro -- my comments added):

    length      :: [a] -&amp;gt; Integer         -- [ ] means list
    length      [] = 0                    -- [] means list
    length      (x: xs) = 1 + length xs   -- list, but no [ ]

Usually, showing a list uses square brackets and comma separators.

So list literals use square brackets and comma separators.

Type decls for a list uses square brackets.

List builders use square brackets and commas -- such as [1, 3 .. 9] or [0 ..]

Pattern matching for finite length lists use square brackets and commas:
     f   [] = ...
     f   [x] = ...
     f   [x, y] = ...

But pattern matching for unknown-length lists uses round brackets and colon -- 
such as that last binding for `length` above. And (nearly) every list-handling 
function has a pattern for unknown-length lists.

Would this pattern matching seem less odd?:

     head       [x ..] = x
     length     [x, xs&amp;lt; at &amp;gt;..] = 1 + length xs


Experienced Haskellers need not answer: you've got too used to ( : ) ;-)

AntC


&lt;/pre&gt;</description>
    <dc:creator>AntC</dc:creator>
    <dc:date>2012-05-20T21:14:15</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9924">
    <title>Choosing a function randomly...</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9924</link>
    <description>&lt;pre&gt;Hi,

This is kind-of related to my earlier question on looking up functions
by name.  Suppose I have a module with a number of functions with the
same signature:

scale :: Int -&amp;gt; Int -&amp;gt; Int

scale s x = s * x

add :: Int -&amp;gt; Int -&amp;gt; Int

add a x = a + x

...

I'd like to choose and run one of these functions randomly at run
time. I can see I could use some kind of case expression:

op :: Int -&amp;gt; Int -&amp;gt; Int

op p x = case random(1,2) of
   1 -&amp;gt; scale p x
   2 -&amp;gt; add p x

Or some kind of pattern guards:

op p x
  | random(1,2) == 1 = scale p x
  | otherwise  = add p x

Although that method won't work as is for more than two choices.  Are
these methods the most idiomatic way of randomly choosing a function?
 How hard would it be to use the machinery of the QuickCheck library
for this, given it must be doing something similar in test suites?

Thanks,

Stu

&lt;/pre&gt;</description>
    <dc:creator>Stuart Hungerford</dc:creator>
    <dc:date>2012-05-20T06:42:07</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9923">
    <title>Choosing a function by (string) name...</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9923</link>
    <description>&lt;pre&gt;Hi,

Suppose I have a module of functions with identical signatures:

module Functions where

a :: Int -&amp;gt; [Int]

a x = [x + 1, x + 2, x + 3]

b :: Int -&amp;gt; [Int]

b x = [x + 4, x + 5, x + 6]

and in my main function I receive a command line arguments (a string)
naming one of the functions in MyModule. I'd like to lookup and use of
the functions by name:

lookup :: String -&amp;gt; (Int -&amp;gt; [Int])

lookup "a" = MyModule.a

lookup "b" = MyModule.b

...

Is there a more idiomatic Haskell way of going about this?  I can see
there's a fundamental tension between a runtime choice of function
name expressed as a string and the need for compile-time known
function choice.

Thanks,

Stu

&lt;/pre&gt;</description>
    <dc:creator>Stuart Hungerford</dc:creator>
    <dc:date>2012-05-20T06:28:05</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9919">
    <title>change to wikibook?</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9919</link>
    <description>&lt;pre&gt;I was wondering if someone could explain this error? I typed in the sample
code from the Haskell Beginning Wikibook to define a function for absolute
value. I have GHC 7.0.4 for OSX. The error went away when I put parentheses
around the negative value, so did the Haskell interpreter think I was
entering - and a second argument, namely 10, when the parentheses weren't
there? Thank you!

*Main&amp;gt; let abs x = if x &amp;lt; 0 then -x else x
*Main&amp;gt; abs 5
5
*Main&amp;gt; abs -10

And got the following error
&amp;lt;interactive&amp;gt;:1:6:
    No instance for (Num (a0 -&amp;gt; a0))
      arising from the literal `10'
    Possible fix: add an instance declaration for (Num (a0 -&amp;gt; a0))
    In the second argument of `(-)', namely `10'
    In the expression: abs - 10
    In an equation for `it': it = abs - 10
&lt;/pre&gt;</description>
    <dc:creator>Ashley Smith</dc:creator>
    <dc:date>2012-05-12T20:15:42</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9912">
    <title>A wikipedia episode guide parser. [code reviewrequest]</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9912</link>
    <description>&lt;pre&gt;I have written my first piece of haskell code which I'm, to be honest, not
too proud of. I have used the  tag soup library to parse and manipulate the
wikipedia episode list page such as:

http://en.wikipedia.org/wiki/List_of_Weeds_episodes

 to scrape some of the episode information and place it in to a series of
data structures. Nothing too complicated.

I know there are probably better libraries out there, I know of HXT and
others but it uses arrows and I want to start getting to know the basics
before moving on to that. The main point here being that I'm not to
interested in the library I used but the code I produced with it.

My main concern is in the layout of the code. It needs to keep state and
I'm aware of the state monad but is it a good idea to push all of the code
in to the state monad and restructure it that way or is that too complex
for what I do. I'm not really sure how else I could refactor it but any
suggestions on how to improve would be great.

The code is here:

http://pastebin.com/409SLPre

Thanks.
&lt;/pre&gt;</description>
    <dc:creator>Thomas Nickson</dc:creator>
    <dc:date>2012-05-06T18:07:16</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9897">
    <title>Understanding "Signals, Not Generators"</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9897</link>
    <description>&lt;pre&gt;Hey

I am currently reading Signals, Not Generators". I am on page 10 where the phantom type era is introduced. I have trouble understanding because I do not understand how the system is to be used. Let us assume I have a signal and an action to print the output:

signal :: DSignal era Int
action :: Int -&amp;gt; Io ()
action = putStrLn . show

Now, I consume the signal:
reactive = consume signal action

=&amp;gt; reactive :: Reactive era (IO ())

And make an io action:

toIO reactive :: IO ()

My question is: what does this io action do?

Thanks!
&lt;/pre&gt;</description>
    <dc:creator>Nathan Hüsken</dc:creator>
    <dc:date>2012-05-04T14:18:30</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9891">
    <title>Signals and external bindings...</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9891</link>
    <description>&lt;pre&gt;I've just finished a QAD project in Python, and expect them to ask
me to build the production version of the same project. I'd like to
switch to Haskell, but (again, for those who noticed) have some
questions I'd like answered.

One problem I ran into is that I use Unix signals to control the
various processes. In CPython, this causes a problem with extension
code because the python signal handler at the C level just note the
signal, then wait to run the Python "signal handler" the next time the
interpreter. Since my extensions are doing the heavy lifting, they
often run for long periods (by which I mean 10s of minutes). Meaning
the signal is ignored for long periods.

Since I expect to such extensions (the wrappers are available) and
want to leave the control mechanisms in place, I'd like to know if I'm
going to have similar problems in Haskell.

      Thanks,
      &amp;lt;mike
&lt;/pre&gt;</description>
    <dc:creator>Mike Meyer</dc:creator>
    <dc:date>2012-05-02T17:00:41</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9888">
    <title>Compilation error parsing arithmeticexpressions with parsec-3.1.2</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9888</link>
    <description>&lt;pre&gt;Hello.

I want a parser to parse arithmetic expressions using
Parsec-3.1.2. Therefore I wrote the attached Haskell module.

But its compilation with ghc-7.4.1 fails with the message:


Expr1.hs:22:22:
    No instance for (Stream s0 m0 Char)
      arising from a use of `pLexeme'
    Possible fix: add an instance declaration for (Stream s0 m0 Char)
    In the second argument of `(&amp;lt;$&amp;gt;)', namely
      `pLexeme (many1 (satisfy isDigit))'
    In the expression: read &amp;lt;$&amp;gt; pLexeme (many1 (satisfy isDigit))
    In an equation for `pNum':
        pNum = read &amp;lt;$&amp;gt; pLexeme (many1 (satisfy isDigit))


Any clues on how to fix this?

Romildo
&lt;/pre&gt;</description>
    <dc:creator>j.romildo&lt; at &gt;gmail.com</dc:creator>
    <dc:date>2012-05-02T02:38:50</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9854">
    <title>Issue installing  reactive-banana-5.0.0.1</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9854</link>
    <description>&lt;pre&gt;Hi

It appears I can’t install reactive-banana-5.0.0.1:

cabal install reactive-banana
Resolving dependencies...
cabal: cannot configure mtl-2.1. It requires transformers ==0.3.*
For the dependency on transformers ==0.3.* there are these packages:
transformers-0.3.0.0. However none of them are available.
transformers-0.3.0.0 was excluded because reactive-banana-0.5.0.1 requires
transformers ==0.2.*

How can I solve this ?

thank you,
Miguel


&lt;/pre&gt;</description>
    <dc:creator>Miguel Negrao</dc:creator>
    <dc:date>2012-04-27T22:19:39</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9851">
    <title>Haskell as a useful practical 'tool' forintelligent non-programmers</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9851</link>
    <description>&lt;pre&gt;
I am not a programmer, and have no intention of becoming one. I'm a stock
and options trader. MetaStock is one of the primary programs I use. Other
statistical and mathematical programs as well.

Very often when some small need arises, I Google-search for a solution.
There seems to be any number of freeware utilities out there in cyberland --
and more all the time -- that do pretty much whatever is needed.

Additionally, Mathematica (as one example) has a powerful programming
language built in.

So, my question is: Does it make practical sense to spend time learning
Haskell for the purpose of adding it to my assortment of 'tools' -- to
quickly do this or that, as the need arises?

Is there any better general practical 'tool' (or, if you want, 'programming
language') to add to my arsenal.

Thanks for your comments and suggestions.

Nicholas Kormanik




&lt;/pre&gt;</description>
    <dc:creator>Nicholas Kormanik</dc:creator>
    <dc:date>2012-04-27T20:16:38</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9847">
    <title>How to deal with library dependencies?</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9847</link>
    <description>&lt;pre&gt;Hi all,

I've recently installed the latest yesod-platform with cabal and now I'd
like to install yesod-markdown, too.

Problem is, yesod-markdown refuses to install because it depends on
libraries older than the ones installed by yesod-platform on my system:
for example, yesod-markdown requires 0.4 &amp;lt;= blaze-html &amp;lt; 0.5, but latest
yesod-platform depends on blaze-html 0.5.0.

This problem is obviously more general, and so is my question: How to
handle packages that depend of different versions of the same library?

Would you just install the "highest common version" across all the
packages that depend on it? What if it doesn't exist?
Would you manually patch the cabal files for all the packages in the
dependency tree, hoping that newest libraries are backward compatible?
Would you wait for the library developers to update their cabal file
every time a library they rely upon changes?

To me, it looks like dependencies in .cabal files are usually too
strict. Or, packages should agree on the meaning of "minor" version
numbers. For example, if blaze-html's API did not change from 0.4 to 0.5
(supposing that API changes are identified by a change in the major
version number), then there is no point in the libraries that depend on
it to require a dependency &amp;lt;0.5.
Is this rule of minor/major version numbers followed/agreed upon in
Haskell libraries?

Thanks,
L.

&lt;/pre&gt;</description>
    <dc:creator>Lorenzo Bolla</dc:creator>
    <dc:date>2012-04-26T16:42:37</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9842">
    <title>I am having trouble with the type declaration for creating an identity matrix.</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9842</link>
    <description>&lt;pre&gt;initIdentityMat :: Int -&amp;gt; ST s (STUArray s (Int,Int) ((Int, Int), Double))
initIdentityMat m = newListArray ((1,m),(1,m)) ([((i,j), if i == j then 1.0
else 0.0) | i &amp;lt;- [1..m], j &amp;lt;- [1..m]] :: [((Int,Int), Double)])

Doesn't seem to compile, nor do minor variations of the type declaration.

&lt;/pre&gt;</description>
    <dc:creator>KC</dc:creator>
    <dc:date>2012-04-24T21:20:16</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9841">
    <title>A strange expression in Quick Hull example</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9841</link>
    <description>&lt;pre&gt;I copy the Quick Hull snippet from http://darcs.haskell.org/packages/dph/examples/quickhull/QuickHull.hs
The "packed" expression in "hsplitList" is much confusing to me. Why does it have to zip points with cross? Is [ p | (c, p) &amp;lt;- cross, c &amp;gt; 0.0 ] not enough? Thanks.

data Point = Point !Double !Double
data Line  = Line  Point Point

instance Show Point where
  show (Point x y) = show (x, y)

distance :: Point -&amp;gt; Line -&amp;gt; Double
distance (Point xo yo) (Line (Point x1 y1) (Point x2 y2))
  = (x1 - xo) * (y2 - yo) - (y1 - yo) * (x2 - xo)
  
upper :: (a -&amp;gt; a -&amp;gt; Bool) -&amp;gt; [(a, b)] -&amp;gt; b
upper above = snd . foldl1 pick
  where
    pick left&amp;lt; at &amp;gt;(kl, _) right&amp;lt; at &amp;gt;(kr, _) | kl `above` kr = left
                                    | otherwise     = right

hsplitList :: [Point] -&amp;gt; Line -&amp;gt; [Point]
hsplitList points line&amp;lt; at &amp;gt;(Line p1 p2)
  | length packed &amp;lt; 2 = p1:packed
  | otherwise         = hsplitList packed (Line p1 pm) ++ hsplitList packed (Line pm p2)
  where
    cross  = [ (distance p line, p) | p &amp;lt;- points ]
    packed = [ p | (p, (c, _)) &amp;lt;- zip points cross, c &amp;gt; 0.0 ]

    pm     = upper (&amp;gt;) cross

quickHullList :: [Point] -&amp;gt; [Point]
quickHullList [] = []
quickHullList points
  = hsplitList points (Line minx maxx) ++ hsplitList points (Line maxx minx)
  where
    xs   = [ (x, p) | p&amp;lt; at &amp;gt;(Point x y) &amp;lt;- points ]
    minx = upper (&amp;lt;) xs
    maxx = upper (&amp;gt;) xs

Best regards,
Zhi-Qiang Lei
zhiqiang.lei&amp;lt; at &amp;gt;gmail.com

&lt;/pre&gt;</description>
    <dc:creator>Zhi-Qiang Lei</dc:creator>
    <dc:date>2012-04-24T20:36:32</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9838">
    <title>The last statement in a 'do' construct must be an expression: a &lt;- readArray arr (1, 1)</title>
    <link>http://comments.gmane.org/gmane.comp.lang.haskell.beginners/9838</link>
    <description>&lt;pre&gt;I'm getting the above error message and I cannot figure out why?


buildPair =
    do
arr &amp;lt;- newArray ((1,1),(1,10)) 37 :: ST s (STArray s (Int,Int) Int)
a &amp;lt;- readArray arr (1,1)
        writeArray arr (1,1) 64
        b &amp;lt;- readArray arr (1,1)
        return (a,b)


main = print $ runST buildPair


&lt;/pre&gt;</description>
    <dc:creator>KC</dc:creator>
    <dc:date>2012-04-23T20:52:48</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>

