[Haskell-cafe] databases in Haskell type-safety

2009-01-03 Thread Gour
Hi! I'd like to use sqlite3 as application storage in my haskell project... Browsing the available database options in Haskell it seems that: a) HSQL is dead (hackage reports build-failure with 6.8 6.10) b) haskelldb is also not in a good shape - build fails with 6.8 6.10 For Haskell-newbie

[Haskell-cafe] Re: Updating doubly linked lists

2009-01-03 Thread oleg
Stephan Guenther wrote: Is it possible to change a particular node of the doubly linked list? That is to say, that would like to have a function: update :: DList a - a - DList a where update node newValue returns a list where only the value at the node which is passed in is set to the new

Re: [Haskell-cafe] databases in Haskell type-safety

2009-01-03 Thread Austin Seipp
Excerpts from Gour's message of Sat Jan 03 03:48:44 -0600 2009: Hi! I'd like to use sqlite3 as application storage in my haskell project... Browsing the available database options in Haskell it seems that: a) HSQL is dead (hackage reports build-failure with 6.8 6.10) b) haskelldb is

Re: [Haskell-cafe] unsafeInterleaveIO respecting order of actions

2009-01-03 Thread Henning Thielemann
On Thu, 1 Jan 2009, Brandon S. Allbery KF8NH wrote: On 2009 Jan 1, at 16:44, Henning Thielemann wrote: If it is generally possible to use unsafeInterleaveIO such that it executes actions in the right order, wouldn't this allow the definition of a general lazy IO monad? I thought

[Haskell-cafe] Re: Updating doubly linked lists

2009-01-03 Thread Apfelmus, Heinrich
S. Günther wrote: What kind of structure do you need exactly? What I really need is a structure which represents a two dimensional grid, i.e. it consists of nodes having a value and a list of neighbours attached to it. Point is that if node 1 has node 2 as a neighbour then node 2 has to

Re: [Haskell-cafe] databases in Haskell type-safety

2009-01-03 Thread Henning Thielemann
Gour schrieb: Hi! I'd like to use sqlite3 as application storage in my haskell project... Browsing the available database options in Haskell it seems that: a) HSQL is dead (hackage reports build-failure with 6.8 6.10) No, it is maintained by frede...@ofb.net . I have also contributed

[Haskell-cafe] Re: databases in Haskell type-safety

2009-01-03 Thread Gour
Henning == schlepp...@henning-thielemann.de writes: Henning No, it is maintained by frede...@ofb.net . I have also Henning contributed Oracle/OCI code a half year ago. Oops, I stand corrected...nice to hear. Still, it would be nice to present some info 'cause web site still shows 1.7 from Dec

[Haskell-cafe] Re: databases in Haskell type-safety

2009-01-03 Thread Gour
Austin == Austin Seipp mad@gmail.com writes: Austin Have you tried the simple sqlite3 bindings available? Austin http://hackage.haskell.org/cgi-bin/hackage-scripts/package/sqlite Not (yet), but those are the one I mentioned (besides HDBC) under d) ;) Austin Takusen is based on the (unique)

Re: [Haskell-cafe] Updating doubly linked lists

2009-01-03 Thread Niklas Broberg
Is it possible to change a particular node of the doubly linked list? That is to say, that would like to have a function: update :: DList a - a - DList a where update node newValue returns a list where only the value at the node which is passed in is set to the new Value and all other

Re: [Haskell-cafe] unsafeInterleaveIO respecting order of actions

2009-01-03 Thread Henning Thielemann
On Sat, 3 Jan 2009, Henning Thielemann wrote: On Thu, 1 Jan 2009, Brandon S. Allbery KF8NH wrote: On 2009 Jan 1, at 16:44, Henning Thielemann wrote: If it is generally possible to use unsafeInterleaveIO such that it executes actions in the right order, wouldn't this allow the definition of

Re: [Haskell-cafe] Re: How do we decide on the new logo?

2009-01-03 Thread Richard Kelsall
Achim Schneider wrote: ... Step 3: Re-open contest, accepting submissions _using_ the winning logo, in the categories a) colour schemes[1] b), official shapes[2] c), font[3] to go to b), d) layouts of b) + c) ... This is a good suggestion. I would like small adjustments to the logo to be

[Haskell-cafe] Type Family Relations

2009-01-03 Thread Thomas DuBuisson
Cafe, I am wondering if there is a way to enforce compile time checking of an axiom relating two separate type families. Mandatory contrived example: type family AddressOf h type family HeaderOf a -- I'm looking for something to the effect of: type axiom HeaderOf (AddressOf x) ~ x --

[Haskell-cafe] How to check object's identity?

2009-01-03 Thread Xie Hanjian
Hi, I tried this in ghci: Prelude 1:2:[] == 1:2:[] True Does this mean (:) return the same object on same input, or (==) is not for identity checking? If the later is true, how can I check two object is the *same* object? Thanks Jan -- jan=callcc{|jan|jan};jan.call(jan) pgpJa3i8YUIrV.pgp

[Haskell-cafe] Re: How to check object's identity?

2009-01-03 Thread Günther Schmidt
Hi Jan, in functional programming there is no such thing as identity as we understand the idea from OO. There is only such as thing as equality though. Günther Am 03.01.2009, 16:28 Uhr, schrieb Xie Hanjian jan.h@gmail.com: Hi, I tried this in ghci: Prelude 1:2:[] == 1:2:[] True

Re: [Haskell-cafe] How to check object's identity?

2009-01-03 Thread Xie Hanjian
Thanks guys :-) * Nicolas Pouillard nicolas.pouill...@gmail.com [2009-01-03 16:39:59 +0100]: Excerpts from Xie Hanjian's message of Sat Jan 03 16:28:30 +0100 2009: Hi, I tried this in ghci: Prelude 1:2:[] == 1:2:[] True Does this mean (:) return the same object on same input, or

Re: [Haskell-cafe] databases in Haskell type-safety

2009-01-03 Thread brian
On Sat, Jan 3, 2009 at 4:25 AM, Austin Seipp mad@gmail.com wrote: NB: I have *just* (about 5 minutes ago) sent in a patch for takusen to get it to build on GHC 6.10.1 to Oleg. Hopefully an updated version will appear on hackage in the next few days. Yay! Thanks. I've been waiting.

Re: [Haskell-cafe] Type Family Relations

2009-01-03 Thread Austin Seipp
Excerpts from Thomas M. DuBuisson's message of Sat Jan 03 09:22:47 -0600 2009: Mandatory contrived example: type family AddressOf h type family HeaderOf a -- I'm looking for something to the effect of: type axiom HeaderOf (AddressOf x) ~ x -- Valid: type instance AddressOf

[Haskell-cafe] Haskell Weekly News: Issue 99 - January 3, 2009

2009-01-03 Thread Brent Yorgey
--- Haskell Weekly News http://sequence.complete.org/hwn/20090103 Issue 99 - January 03, 2009 --- Welcome to issue 99 of HWN, a newsletter covering

Re: [Haskell-cafe] [ANN] Haskell web server + wiki: salvia-0.0.4 + orchid-0.0.6

2009-01-03 Thread Gwern Branwen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Thu, Jan 1, 2009 at 9:04 AM, Sebastiaan Visser wrote: Happy new year, you all! I'm pleased to announce three new packages on Hackage: I had some trouble getting all dependencies right on systems other than my own. Using `cabal install'

Re: [Haskell-cafe] Use of abbreviations in Haskell

2009-01-03 Thread Ketil Malde
Isaac Dupree m...@isaac.cedarswampstudios.org writes: Derek Elkins wrote: I haven't been able to find any semantic difficulties with this addition. I like it too... what I run into is that there's an implicit assumption that module of name Foo.Bar.Baz *must* be found in a file

Re: [Haskell-cafe] Re: How do we decide on the new logo?

2009-01-03 Thread Eelco Lempsink
On 3 jan 2009, at 17:33, Sebastian Sylvan wrote: On Sat, Jan 3, 2009 at 3:15 AM, rocon...@theorem.ca wrote: On Sat, 3 Jan 2009, Achim Schneider wrote: Step 2: Determine the winner by polling preferences, same-level preference (ambivalence) allowed (eg. place 1 for logos C and D, place 2 for A

[Haskell-cafe] Re: Pattern combinators

2009-01-03 Thread Massimiliano Gubinelli
David Menendez dave at zednenem.com writes: On Sun, Dec 21, 2008 at 10:14 PM, Andrew Wagner wagner.andrew at gmail.com wrote: I'd love to see a copy of this go up on hackage for experimentation. Would you care to upload your code, or send it to me so I can upload it? I've uploaded

[Haskell-cafe] Re: [Haskell] #haskell IRC channel reaches 600 users

2009-01-03 Thread Henk-Jan van Tuyl
On Fri, 02 Jan 2009 21:27:24 +0100, Don Stewart d...@galois.com wrote: A small announcement :) 7 years after its inception, under the guiding hand of Shae Erisson (aka shapr), the #haskell IRC channel[1] on freenode has reached 600 concurrent users! It's now in the top 3 language channels by

Re: [Haskell-cafe] Type Family Relations

2009-01-03 Thread Ryan Ingram
I've been fighting this same problem for a while. The solution I've come up with is to encode the axioms into a typeclass which gives you a proof of the axioms. Here's an excerpt from some code I've been playing around with; HaskTy and Lift are type families. -- Theorem: for all t instance of

Re: [Haskell-cafe] Type Family Relations

2009-01-03 Thread Iavor Diatchki
Hello, Usually, you can program such things by using super-classes. Here is how you could encode your example: {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances #-} class HeaderOf addr hdr | addr - hdr class HeaderOf addr hdr = AddressOf hdr addr | addr - hdr data

[Haskell-cafe] teaching functional programming at work

2009-01-03 Thread Warren Harris
I am seeking suggestions from the haskell cafe for teaching functional programming concepts to colleagues at work. I'm currently working on a project using ocaml and functional programming techniques, and am a lone ranger at my workplace when it comes to this sort of thing (we are

Re: [Haskell-cafe] How to check object's identity?

2009-01-03 Thread Luke Palmer
2009/1/3 Xie Hanjian jan.h@gmail.com Hi, I tried this in ghci: Prelude 1:2:[] == 1:2:[] True Does this mean (:) return the same object on same input, Also, in functional programming, *every* function returns the same output for the same input. That's part of the definition of

Re: [Haskell-cafe] Use of abbreviations in Haskell

2009-01-03 Thread Isaac Dupree
Ketil Malde wrote: A module may be defined in a file with a name corresponding to the module name, or any dot-separated prefix of it? I.e. the file Foo/Bar.hs will define module Foo.Bar and optionally Foo.Bar.Baz as well? GHC should then be able to find it, and I believe it already has a

[Haskell-cafe] ANN: bytestring-trie 0.1.1 (bugfix)

2009-01-03 Thread wren ng thornton
-- bytestring-trie 0.1.1 (bugfix) An efficient finite map from (byte)strings to values. The implementation is based on big-endian patricia trees, like Data.IntMap. We first trie on the Word8 elements of a

Re: [Haskell-cafe] How to check object's identity?

2009-01-03 Thread Xie Hanjian
* Luke Palmer lrpal...@gmail.com [2009-01-03 18:46:50 -0700]: 2009/1/3 Xie Hanjian jan.h@gmail.com Hi, I tried this in ghci: Prelude 1:2:[] == 1:2:[] True Does this mean (:) return the same object on same input, Also, in functional programming, *every* function returns

Re: [Haskell-cafe] Use of abbreviations in Haskell

2009-01-03 Thread Thomas DuBuisson
Cafe, I was going to write about this earlier, but I'm so ill read on the record selector papers that I deleted the draft. My proposal would be for each selector name to be a special type of phantom type class (existing in the intermediate language only). This type class would not be accessible

Re: [Haskell-cafe] How to check object's identity?

2009-01-03 Thread Luke Palmer
2009/1/3 Xie Hanjian jan.h@gmail.com * Luke Palmer lrpal...@gmail.com [2009-01-03 18:46:50 -0700]: 2009/1/3 Xie Hanjian jan.h@gmail.com Hi, I tried this in ghci: Prelude 1:2:[] == 1:2:[] True Does this mean (:) return the same object on same input, Also,

Re: [Haskell-cafe] Type Family Relations

2009-01-03 Thread Thomas DuBuisson
Thank you all for the responses. I find the solution that omits type families [Diatchki] to be too limiting while the solution 'class (Dual (Dual s) ~ s) =' [Ingram] isn't globally enforced. I've yet to closely study your first solution, Ryan, but it appears to be what I was looking for - I'll

Re: [Haskell-cafe] Updating doubly linked lists

2009-01-03 Thread S. Günther
G'Day, and phew... quite a lot of code to grok. Thanks for the answers, they're much appreciated. On Sun, Jan 4, 2009 at 1:43 AM, Niklas Broberg niklas.brob...@gmail.com wrote: What you need is for the nodes to keep track of the length of the list. Here's a different solution from that oleg

Re: [Haskell-cafe] How to check object's identity?

2009-01-03 Thread Anton van Straaten
Luke Palmer wrote: I, like many arrogant Haskellers, reject Scheme and other such impure languages as functional. At least until I turn on my brain. If Haskell is functional, then so is Scheme - it's just that Scheme lets you use IORefs and the IO monad without going to nearly as much