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:  Compiling with HDBC (David McBride)
   2. Re:  Compiling with HDBC (Daniel Fischer)
   3. Re:  Compiling with HDBC (Christopher Done)
   4. Re:  Network.Curl POST body not showing up (Michael Xavier)
   5. Re:  Genetic algorithm for knapsack problem (Karol Samborski)
   6. Re:  Network.Curl POST body not showing up (Michael Snoyman)
   7. Re:  Compiling with HDBC (Daniel Fischer)


----------------------------------------------------------------------

Message: 1
Date: Fri, 13 May 2011 01:44:18 -0400
From: David McBride <[email protected]>
Subject: Re: [Haskell-beginners] Compiling with HDBC
To: Haskell Beginners <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1

Use ghc --make.

I heard that the newest version of ghc uses --make implicitely so you
don't have to specify it, but I haven't actually experienced it myself
yet.

On Fri, May 13, 2011 at 1:35 AM, Christopher Howard
<[email protected]> wrote:
> Hi. I'm very new to Haskell, but I'm trying to compile a simple program
> that uses HDBC with ODBC. I am working on an amd64 Gentoo Linux system.
> I've installed hdbc and hdbc-odbc with the unixOBDC bindings. So far, I
> created a small hello world type program. It doesn't use any HDBC
> functionality yet, but I inserted the following two lines at the top to
> see if I could compile correctly:
>
> import Database.HDBC
> import Database.HDBC.ODBC
>
> However, when I try to compile I get this:
>
> $ ghc Main.hs
> Main.o: In function `s1cY_info':
> (.text+0x1ef): undefined reference to
> `__stginit_HDBCzmodbczm1zi1zi3zi0_DatabaseziHDBCziODBC_'
> Main.o: In function `s1cY_info':
> (.text+0x1fb): undefined reference to
> `__stginit_HDBCzm2zi2zi6zi1_DatabaseziHDBC_'
> collect2: ld returned 1 exit status
>
> Though, these errors do not show up when I run the .hs file with runhaskell.
>
> I'm guessing I just don't know how to link to the correct library or
> libraries. I tried adding -lodbc to the ghc line but that did not help.
> In /usr/lib I see libodbc.so, as well as the directories hdbc-1.1.3 and
> hdbc-odbc-1.1.3.0. I would appreciate any guidance.
>
> --
> frigidcode.com
> theologia.indicium.us
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>



------------------------------

Message: 2
Date: Fri, 13 May 2011 07:50:39 +0200
From: Daniel Fischer <[email protected]>
Subject: Re: [Haskell-beginners] Compiling with HDBC
To: [email protected]
Message-ID: <[email protected]>
Content-Type: Text/Plain;  charset="iso-8859-1"

On Friday 13 May 2011 07:44:18, David McBride wrote:
> Use ghc --make.

This. You rarely need to specify libraries and packages with make.
For nontrivial projects, use Cabal.

> 
> I heard that the newest version of ghc uses --make implicitely so you
> don't have to specify it, but I haven't actually experienced it myself
> yet.

Yup, as of ghc-7, --make is the default (I still type it more often than 
not, muscle memory).



------------------------------

Message: 3
Date: Fri, 13 May 2011 08:17:47 +0200
From: Christopher Done <[email protected]>
Subject: Re: [Haskell-beginners] Compiling with HDBC
To: Daniel Fischer <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"

On 13 May 2011 07:50, Daniel Fischer <[email protected]>wrote:

> On Friday 13 May 2011 07:44:18, David McBride wrote:
> > Use ghc --make.
>
> This. You rarely need to specify libraries and packages with make.
> For nontrivial projects, use Cabal.
>

Personally I'd recommend even trivial projects to use Cabal. If it's a
"project" and not just a 15 minute job, cabal init. It takes 2~ minutes to
edit the resulting Cabal file with the libs you need. cabal-dev would also
be very helpful to newbies. The amount of time I wasted as a newbie
reinstalling packages because I had conflicts with existing installed
packages... cabal-dev solves this and lets you get back to hacking.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20110513/51d064d0/attachment-0001.htm>

------------------------------

Message: 4
Date: Thu, 12 May 2011 23:19:09 -0700
From: Michael Xavier <[email protected]>
Subject: Re: [Haskell-beginners] Network.Curl POST body not showing up
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"

Basic auth is something I'm going to need in http-enumerator pretty

> soon so I'll probably have a stab at it over the next week or two.
> If you're interested in that and you haven't heard back from me
> in say two weeks, feel free to ping me.
>
>
I have an active issue with the author of the project on github discussing
this very thing:

https://github.com/snoyberg/http-enumerator/issues/14#comment_1086615

I'm not really up to implementing auth quite yet but it may help you in your
endeavors. Definitely keep me posted if you decide to tackle this issue. I'd
definitely like to swap out the backend on my library for http-enumerator
which i now greatly prefer to Network.Curl

Thanks so much for the code sample Satoshi. It is a bit daunting to me as a
Haskell novice but I was able to massage it into what I needed. It's
unfortunate at how much more convoluted the Curl api is when you want to
POST instead of GET but I suspect as others have suggested that this may
have a lot to do with the underlying C API.

-- 
Michael Xavier
http://www.michaelxavier.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20110512/65624079/attachment-0001.htm>

------------------------------

Message: 5
Date: Fri, 13 May 2011 08:43:23 +0200
From: Karol Samborski <[email protected]>
Subject: Re: [Haskell-beginners] Genetic algorithm for knapsack
        problem
To: AJ Sherbondy <[email protected]>
Cc: Biginners Haskell Mailinglist <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8

Thank you for your answer.
I'll try it and then put some code for comments ;)

Best regards,
Karol Samborski

2011/5/12 AJ Sherbondy <[email protected]>:
> Karol,
> I don't know if you have looked at this module on Hackage or whether it will
> even help you, but there is an evolution algorithm the individual functions
> of which might be useful to you and is described as follows:
> AI.SimpleEA
>
> A framework for simple evolutionary algorithms. Provided with a function for
> evaluating a genome's fitness, a function for probabilistic selection among
> a pool of genomes, and recombination and mutation operators,?runEA?will run
> an EA that lazily produces an infinite list of generations.
>
> AI.SimpleEA.Utils?contains utilitify functions that makes it easier to write
> the genetic operators.
>
> ajsher
>
> On Thu, May 12, 2011 at 10:24 AM, Karol Samborski <[email protected]>
> wrote:
>>
>> Hi all,
>>
>> I'm a student and I got recently a task to do (and I want to do it in
>> haskell). I have to implement "genetic algorithm for knapsack problem"
>> and it would be nice if it will be fast. ?So my question is: what
>> haskell datatypes, modules etc. should I use for this algorithm to
>> achieve this goal? I mean fast as compared to implementation in
>> imperative languages like C.
>>
>> Any advices ?
>>
>> Best regards,
>> Karol Samborski
>>
>> _______________________________________________
>> Beginners mailing list
>> [email protected]
>> http://www.haskell.org/mailman/listinfo/beginners
>
>
>
> --
> AJ Sherbondy
>



------------------------------

Message: 6
Date: Fri, 13 May 2011 09:49:00 +0300
From: Michael Snoyman <[email protected]>
Subject: Re: [Haskell-beginners] Network.Curl POST body not showing up
To: Michael Xavier <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"

On Fri, May 13, 2011 at 9:19 AM, Michael Xavier <[email protected]>wrote:

>
>
> Basic auth is something I'm going to need in http-enumerator pretty
>
>> soon so I'll probably have a stab at it over the next week or two.
>> If you're interested in that and you haven't heard back from me
>> in say two weeks, feel free to ping me.
>>
>>
> I have an active issue with the author of the project on github discussing
> this very thing:
>
> https://github.com/snoyberg/http-enumerator/issues/14#comment_1086615
>
> I'm not really up to implementing auth quite yet but it may help you in
> your endeavors. Definitely keep me posted if you decide to tackle this
> issue. I'd definitely like to swap out the backend on my library for
> http-enumerator which i now greatly prefer to Network.Curl
>
> Thanks so much for the code sample Satoshi. It is a bit daunting to me as a
> Haskell novice but I was able to massage it into what I needed. It's
> unfortunate at how much more convoluted the Curl api is when you want to
> POST instead of GET but I suspect as others have suggested that this may
> have a lot to do with the underlying C API.
>
>
Actually, Erik already submitted a patch adding basic auth support, and I've
released it on Hackage.

Michael


> --
> Michael Xavier
> http://www.michaelxavier.net
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20110513/edd32af9/attachment-0001.htm>

------------------------------

Message: 7
Date: Fri, 13 May 2011 09:20:43 +0200
From: Daniel Fischer <[email protected]>
Subject: Re: [Haskell-beginners] Compiling with HDBC
To: [email protected]
Message-ID: <[email protected]>
Content-Type: Text/Plain;  charset="utf-8"

On Friday 13 May 2011 08:17:47, Christopher Done wrote:
> On 13 May 2011 07:50, Daniel Fischer 
<[email protected]>wrote:
> > On Friday 13 May 2011 07:44:18, David McBride wrote:
> > > Use ghc --make.
> > 
> > This. You rarely need to specify libraries and packages with make.
> > For nontrivial projects, use Cabal.
> 
> Personally I'd recommend even trivial projects to use Cabal. If it's a

I certainly wouldn't want to discourage using Cabal for even the smallest 
things.

I thought of a one-off programme, built from two or three files, using only 
boot packages (say base, containers, arrays, for example) as dependencies 
as 'trivial'; if all it needs is "ghc --make" with a vanilla ghc from 6.2 
to HEAD, you can get away without Cabal.

Anything more, definitely cabalise it.

> "project" and not just a 15 minute job, cabal init.

I'm a slow typist, I'll grant an hour ;)




------------------------------

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 35, Issue 24
*****************************************

Reply via email to