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

2009-01-04 Thread Robin Green
On Mon, 5 Jan 2009 07:27:13 +0100 Achim Schneider wrote: > Achim Schneider wrote: > > > [...] > > > Hmmm... I seem to have left out the academics definition of bogosity. > I bet that others are much more qualified to elaborate on this, but my > working assumption has been (and still is) that it

Re: [Haskell-cafe] Type Family Relations

2009-01-04 Thread Matt Morrow
Hi, > I think that > >>> class HeaderOf addr hdr | addr -> hdr > does not enforce that there must be a corresponding instance > AddressOf hdr addr. Hence, the type checker cannot use that information > either. Do you have a way to remedy that? I've often wanted something similar, and experimentin

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

2009-01-04 Thread Achim Schneider
Achim Schneider wrote: > [...] > Hmmm... I seem to have left out the academics definition of bogosity. I bet that others are much more qualified to elaborate on this, but my working assumption has been (and still is) that it does include a wide range of working code, and excludes a lot of abstrac

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

2009-01-04 Thread Achim Schneider
"Jamie Brandon" wrote: > The haskell community has a well deserved reputation for being one of > the friendliest online communities. Perhaps this would be a good point > to figure out what we're doing right? I'm convinced that part of it is > that offtopic conversation is encouraged through on ha

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

2009-01-04 Thread Achim Schneider
Lauri Alanko wrote: > Personally, I find the idea appealing (and have implemented the Refs > in the paper with IORefs and unsafePerformIO), because really, even > currently a programmer has to care about sharing since it can have > radical implications for performance and memory usage. Making it

Re: [Haskell-cafe] Thoughts on Haskell and OOP

2009-01-04 Thread Derek Elkins
On Sun, 2009-01-04 at 19:47 -0600, Drew Vogel wrote: > I saw a blog entry once (sorry, google can't seem to find it now) > proposing the idea that OOP really is just language support for CPS > (continuation-passing-style). Does anyone have a link to this? 'don't think I've heard of it, but it soun

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

2009-01-04 Thread wren ng thornton
Original Message Message-ID: <496176cf.3090...@freegeek.org> Date: Sun, 04 Jan 2009 21:56:15 -0500 From: wren ng thornton User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: ChrisK Subject: Re: ANN: bytestring-trie 0.1.1 (bugfix) References: <494c8b52.

[Haskell-cafe] Haskell good for parallelism/concurrency on manycore?

2009-01-04 Thread Ahn, Ki Yung
Dear Haskellers, I just got an inquiry from a research department head of a Korean company seriously considering to adopt functional languages because they heard that functional languages can do good at parallel programming on manycore platforms. They want to know what technologies out there impl

Re: [Haskell-cafe] Thoughts on Haskell and OOP

2009-01-04 Thread Drew Vogel
I saw a blog entry once (sorry, google can't seem to find it now) proposing the idea that OOP really is just language support for CPS (continuation-passing-style). Does anyone have a link to this? Drew Kevin Van Horn wrote: > Haskell has been around in one form or another for nearly two decades

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

2009-01-04 Thread Peter Verswyvelen
Maybe you could use stable names for this: http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Mem-StableName.html "Stable names are a way of performing fast (O(1)), not-quite-exact comparison between objects. Stable names solve the following problem: suppose you want to build a has

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

2009-01-04 Thread Ketil Malde
Aaron Tomb writes: > As others have explained, the == operator doesn't tell you whether two > values are actually stored at the same location in memory. Nobody yet mentioned that (==) doesn't guarantee *anything* - it's a user defined function. So while it may and should give structural equalit

Fwd: [Haskell-cafe] Auto-deriving Control.Exception.Exception

2009-01-04 Thread Antoine Latter
Forwarding response to cafe -- Forwarded message -- From: Antoine Latter Date: Sun, Jan 4, 2009 at 2:13 PM Subject: Re: [Haskell-cafe] Auto-deriving Control.Exception.Exception To: "eyal.lo...@gmail.com" On Sun, Jan 4, 2009 at 11:50 AM, eyal.lo...@gmail.com wrote: > If this i

[Haskell-cafe] Haskell, successing crossplatform API standart: first feedback

2009-01-04 Thread Belka
Thanks everybody for your responses, they helped a lot. And sorry for my misconcept on JSON. ;] Sterling Clover, Nov 30, 2008: >These days, however, web services seem to be moving towards a RESTful >model with a JSON layer and there are plenty of JSON libraries on >hackage, which you could ju

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

2009-01-04 Thread Henning Thielemann
On Sat, 3 Jan 2009, Henning Thielemann wrote: I think I now have general Applicative functionality ... I hope the following is a proper Monad implementation. In contrast to Applicative a Writer for sequencing actions does no longer work, instead I need a State monad. newtype LazyIO a = L

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

2009-01-04 Thread ChrisK
Question and suggestion: looking at http://hackage.haskell.org/packages/archive/bytestring-trie/0.1.1/doc/html/src/Data-Trie.html#Trie I am questioning your choice of foldr in fromList: -- | Convert association list into a trie. On key conflict, values -- earlier in the list shadow later ones.

[Haskell-cafe] Auto-deriving Control.Exception.Exception

2009-01-04 Thread eyal.lo...@gmail.com
If this is valid: import qualified Control.Exception as Exc genericFromException :: Typeable a => Exc.SomeException -> Maybe a genericFromException (Exc.SomeException e) = cast e instance Exc.Exception SomeType where fromException = genericFromException then why not have an auto-

Re: [Haskell-cafe] teaching functional programming at work

2009-01-04 Thread Paul Johnson
Warren Harris wrote: I am seeking suggestions from the haskell cafe for teaching functional programming concepts to colleagues at work. I'd suggest starting with a couple of hours of "Why Haskell" talk to sell them on the concepts, followed by something like the the study group you mentioned f

Re: [Haskell-cafe] Type Family Relations

2009-01-04 Thread Mark P. Jones
Hi Thomas, The specific problem you describe has a simple solution using multiple parameter classes with syntactic sugar for functional notation instead of type families [1]: > class AddressOf h a | h -> a, a -> h -- bijections > class HeaderOf a h | a -> h, h -> a > instance HeaderOf (Address

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

2009-01-04 Thread Thomas Davie
On 4 Jan 2009, at 18:08, Aaron Tomb wrote: On Jan 3, 2009, at 7:28 AM, Xie Hanjian wrote: 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 obje

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

2009-01-04 Thread Aaron Tomb
On Jan 3, 2009, at 7:28 AM, Xie Hanjian wrote: 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? As others have expl

[Haskell-cafe] ANN: wxHaskell 0.11.1

2009-01-04 Thread Jeremy O'Donoghue
The wxHaskell development team is pleased to announce the release of wxHaskell 0.11.1, a Haskell binding for the wxWidgets GUI library. The Haskell support is built on a reasonably complete C language binding, which could be used as the basis for wxWidgets support on other languages/platforms whic

Re: [Haskell-cafe] teaching functional programming at work

2009-01-04 Thread Neil Mitchell
Hi Warren, I'd recommend getting them to read Why FP Matters (http://www.cs.chalmers.se/~rjmh/Papers/whyfp.html) to tempt them, followed by Programming in Haskell (http://www.cs.nott.ac.uk/~gmh/book.html) to teach them the concepts/syntax etc, possibly with Learn You a Haskell (http://learnyouahas

Re: [Haskell-cafe] Type Family Relations

2009-01-04 Thread Tom Schrijvers
Hi, I like collecting examples of different type system related issues, and I am curious in what way is the solution that I posted limited. Do you happen to have an example? Hi Iavor, I think that class HeaderOf addr hdr | addr -> hdr does not enforce that there must be a corresponding inst

[Haskell-cafe] Connect to DBMS - what's the cost

2009-01-04 Thread Belka
Hello, community people! Is anybody aware, what aproximately is the cost for the acquiring connection to DB (and also disconnecting from it)? I guess that may differ from DBMS to DBMS, so I mostly am interested in PostgreSQL case, but for other DBMS it's also good to know. Actually, since all H

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

2009-01-04 Thread Lauri Alanko
On Sun, Jan 04, 2009 at 04:19:38PM +0800, Evan Laforge wrote: > If you don't have set-car!, then identity and equality are impossible > to differentiate. There's still eqv?. (I wish people wouldn't use eq? as an example of an identity-comparison operation. It's as underdefined as unsafePtrEq.) So

Re: [Haskell-cafe] Type Family Relations

2009-01-04 Thread Iavor Diatchki
Hi, I like collecting examples of different type system related issues, and I am curious in what way is the solution that I posted limited. Do you happen to have an example? Thanks, Iavor On Sat, Jan 3, 2009 at 8:35 PM, Thomas DuBuisson wrote: > Thank you all for the responses. I find the soluti

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

2009-01-04 Thread Miguel Mitrofanov
On 4 Jan 2009, at 07:11, Thomas DuBuisson wrote: 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 by the programmer and thus s/he couldn't make a polymorphic function fo

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

2009-01-04 Thread Evan Laforge
>> So it *looks* like there's only one list created in 'lvl1', but I >> can't see where it's turning into a tuple, and I don't understand the >> ' = : ' stuff, > > You're reading it wrong. : is a name. > It's lvl5 = (:) @ Char a2 ([] @ Char) where @ is type application > (instantiation). Triming t

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

2009-01-04 Thread jan . h . xie
* Evan Laforge [2009-01-04 16:19:38 +0800]: > > Although equal? treats the two as the *same*, they're different lists > > because if we modify one (e.g by set-car!) the other won't be affected. > > > > So here comes another question: when we say a function always give the > > same output for the

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

2009-01-04 Thread Derek Elkins
On Sun, 2009-01-04 at 16:19 +0800, Evan Laforge wrote: > > Although equal? treats the two as the *same*, they're different lists > > because if we modify one (e.g by set-car!) the other won't be affected. > > > > So here comes another question: when we say a function always give the > > same output

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

2009-01-04 Thread Evan Laforge
> Although equal? treats the two as the *same*, they're different lists > because if we modify one (e.g by set-car!) the other won't be affected. > > So here comes another question: when we say a function always give the > same output for the same input, what the *same* means here? ídentity > or eq

[Haskell-cafe] Re: about the concatenation on a tree

2009-01-04 Thread Achim Schneider
"Max cs" wrote: > hi all, not sure if there is someone still working during holiday > like me : ) > > I got a little problem in implementing some operations on tree. > > suppose we have a tree date type defined: > > data Tree a = Leaf a | Branch (Tree a) (Tree a) > > I want to do a concatenat