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: structural induction, two lists, simultaneous (John Wiegley)
2. Re: Creating Indexes (martin)
3. Haskell type conversion for postgresql array types (Riaan)
4. Re: Haskell type conversion for postgresql array types
(Kim-Ee Yeoh)
5. Re: Creating Indexes (Carl Eyeinsky)
----------------------------------------------------------------------
Message: 1
Date: Sun, 14 Dec 2014 23:23:44 -0600
From: "John Wiegley" <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] structural induction, two lists,
simultaneous
Message-ID: <[email protected]>
Content-Type: text/plain
>>>>> Pascal Knodel <[email protected]> writes:
> But in this 'proof attempt' only "ys" was considered (1. I.H.). What do I
> miss?
You only need induction on 'ys' to proof the stated proposition.
John
------------------------------
Message: 2
Date: Mon, 15 Dec 2014 07:20:04 +0100
From: martin <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Creating Indexes
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
Am 12/14/2014 04:41 PM, schrieb Christopher Reichert:
>
> On Sun, Dec 14 2014, martin <[email protected]> wrote:
>> Hello all,
>>
>> I recently wrote a Haskell program, which accesses Lists extensivly. That
>> was okay to verify the overall idea, but
>> performance degraded rapidly when I made the lists bigger. There was a
>> quadratic effect and this was not surprizing,
>> given the nature of the code.
>>
>
> Are you certain this was because of the List and not something else?
>
> If you are constantly doing lookups on lists then, indeed, performance
> will suffer.
>
>> I am somewhat aware of Haskell types which offer faster access. But they all
>> seem to assume that I know the way data is
>> accessed when I write the type. A new access path may force me to rededign
>> the type.
>>
>> What I am looking for is something which behaves like indexes in a RDBMS,
>> i.e. to define a list-like type on an innocent
>> data type (like a tuple) and then add indexes as needed. Is there such a
>> thing?
>
>
> Would an association list fit the model you are talking about?
Well I *have* an association list, however with more than one column by which I
lookup rows (relationally spreaking). I
know I can use Maps, but I cannot convert to a map for every lookup, because it
will be more expensive than just
taversing the list.
I can also just use Maps all along, but this requires I settle for one key
column (or a combination of columns). When
the necessity arises to lookup by new criteria (other columns) I would have to
redesign the map or add another map or
whatever. In any case it is very different to adding an index in a RDBMS.
------------------------------
Message: 3
Date: Mon, 15 Dec 2014 19:45:40 +1100
From: Riaan <[email protected]>
To: [email protected]
Subject: [Haskell-beginners] Haskell type conversion for postgresql
array types
Message-ID:
<caghwpqrwbuge2p7ct3dp9kzkvgv2ebo_0ssvt_w8p-c9pdj...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
This is a question about database query libraries. I am trying to do some
analytics on a Postgresql database and up to now have been using
Database.HDBC for most of my querying.
One of the columns on the database is a two dimensional float8 array. I
tried using Database.PostgreSQL.Simple but got stuck on this array as I
could not figure out how to extend the built in conversion functions to
cater for something like this. So went back to HDBC. But now my queries
are starting to get fairly long and I have been looking at libraries like
Persistent with Esqualeto, HaskellDB and Groundhog to make my queries a
little more composable and type safe.
However I have not been able to find any examples of any of these libraries
using postgres arrays and given my postgresql-simple experience I worried
that I might similarly be unable, because of my low level of haskell
ability, to extend the conversion functions.
So to my question. Does anyone have experience with one of these libraries
in dealing with postgresql arrays and could someone perhaps send me a
simple example that I could use as a basis. Failing that, can anyone
advise me on which of these libraries have the most haskell newbie (LYAH
trained, but still struggling with RWH) friendly approach to writing new
conversion functions?
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20141215/13b51699/attachment-0001.html>
------------------------------
Message: 4
Date: Mon, 15 Dec 2014 17:16:10 +0700
From: Kim-Ee Yeoh <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Haskell type conversion for
postgresql array types
Message-ID:
<capy+zdsxnjjjo-nm5xcqwvwdwooy9srxpfrs12fjfcohb+9...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
On Mon, Dec 15, 2014 at 3:45 PM, Riaan <[email protected]> wrote:
>
> Failing that, can anyone advise me on which of these libraries have the
> most haskell newbie (LYAH trained, but still struggling with RWH) friendly
> approach to writing new conversion functions?
You may get some responses here, and you'll find that if you ask on cafe,
there are many more people with practical experience of the sort you're
asking.
This list was forked from cafe because there were complaints that some of
the questions being asked on cafe were too simple, i.e. at the level of
LYAH, e.g. monads, number type class, etc.
Over time, haskell-beginners has gotten really good at such questions. YMMV
for anything else.
-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20141215/0c67ee55/attachment-0001.html>
------------------------------
Message: 5
Date: Mon, 15 Dec 2014 13:52:07 +0100
From: Carl Eyeinsky <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Creating Indexes
Message-ID:
<CADkv3aFsUq4hzHhpSjSENg_-8fMZdL4u=PvKxq55XfzrEmOG=g...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Hi, Martin
try ixset [0].
But as you said, a simple data structure is not enough for your use case,
as any "mere" data structure has some concrete performance characteristics.
Something more abstract is needed.
[0] http://hackage.haskell.org/package/ixset
On Mon, Dec 15, 2014 at 7:20 AM, martin <[email protected]> wrote:
>
> Am 12/14/2014 04:41 PM, schrieb Christopher Reichert:
> >
> > On Sun, Dec 14 2014, martin <[email protected]> wrote:
> >> Hello all,
> >>
> >> I recently wrote a Haskell program, which accesses Lists extensivly.
> That was okay to verify the overall idea, but
> >> performance degraded rapidly when I made the lists bigger. There was a
> quadratic effect and this was not surprizing,
> >> given the nature of the code.
> >>
> >
> > Are you certain this was because of the List and not something else?
> >
> > If you are constantly doing lookups on lists then, indeed, performance
> > will suffer.
> >
> >> I am somewhat aware of Haskell types which offer faster access. But
> they all seem to assume that I know the way data is
> >> accessed when I write the type. A new access path may force me to
> rededign the type.
> >>
> >> What I am looking for is something which behaves like indexes in a
> RDBMS, i.e. to define a list-like type on an innocent
> >> data type (like a tuple) and then add indexes as needed. Is there such
> a thing?
> >
> >
> > Would an association list fit the model you are talking about?
>
>
> Well I *have* an association list, however with more than one column by
> which I lookup rows (relationally spreaking). I
> know I can use Maps, but I cannot convert to a map for every lookup,
> because it will be more expensive than just
> taversing the list.
>
> I can also just use Maps all along, but this requires I settle for one key
> column (or a combination of columns). When
> the necessity arises to lookup by new criteria (other columns) I would
> have to redesign the map or add another map or
> whatever. In any case it is very different to adding an index in a RDBMS.
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
--
Carl Eyeinsky
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20141215/e7360896/attachment-0001.html>
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 78, Issue 12
*****************************************