Re: [Haskell-cafe] overloaded overloading?

2010-01-12 Thread Brad Larsen
Alberto, On Tue, Jan 12, 2010 at 7:17 PM, Alberto G. Corona agocor...@gmail.com wrote: Hi, I sometimes strumble on the same quiestion that forces me to insert functions that process objects of a certain class inside their class definition.  This occurs when a computation uses the object

Re: Re[6]: [Haskell-cafe] Boxed Mutable Arrays

2009-12-16 Thread Brad Larsen
On Wed, Dec 16, 2009 at 11:27 AM, Don Stewart d...@galois.com wrote: [...] The bug described in Ticket #650, AFAICS, prevents implementation of a reasonable, generic hash table in Haskell.  :-( You can certainly implement it, it just requires that you increase the heap size to a bit bigger

Re: Re[2]: [Haskell-cafe] Boxed Mutable Arrays

2009-12-15 Thread Brad Larsen
Bulat, On Tue, Dec 15, 2009 at 1:51 AM, Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello Brad, Tuesday, December 15, 2009, 1:55:41 AM, you wrote: How about a fast STHashTable? you can use array of arrays instead of large array -- Best regards,  Bulat                            

Re: Re[4]: [Haskell-cafe] Boxed Mutable Arrays

2009-12-15 Thread Brad Larsen
On Tue, Dec 15, 2009 at 11:00 AM, Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello Brad, Tuesday, December 15, 2009, 6:53:14 PM, you wrote: How about a fast STHashTable? you can use array of arrays instead of large array Can you elaborate? what exactly? how to implement this or

Re: Re[6]: [Haskell-cafe] Boxed Mutable Arrays

2009-12-15 Thread Brad Larsen
On Tue, Dec 15, 2009 at 11:33 AM, Serguey Zefirov sergu...@gmail.com wrote: If the number of buckets was fixed, one could use an array of STRefs to lists.  I believe this would avoid the bug from Ticket #650? now i see what you mean. no, i mean trivial transformation. #650 says about slow GC.

Re: [Haskell-cafe] Boxed Mutable Arrays

2009-12-15 Thread Brad Larsen
On Tue, Dec 15, 2009 at 12:00 PM, Gregory Collins g...@gregorycollins.net wrote: Bulat Ziganshin bulat.zigans...@gmail.com writes: now i see what you mean. no, i mean trivial transformation. #650 says about slow GC. why it's slow? because once you made any update to the array, the entire

Re: Re[6]: [Haskell-cafe] Boxed Mutable Arrays

2009-12-15 Thread Brad Larsen
Serguey, On Tue, Dec 15, 2009 at 1:07 PM, Serguey Zefirov sergu...@gmail.com wrote: now i see what you mean. no, i mean trivial transformation. #650 says about slow GC. why it's slow? because once you made any update to the array, the entire array is marked as updated and scanned on next minor

[Haskell-cafe] Boxed Mutable Arrays

2009-12-14 Thread Brad Larsen
Is anyone working on fixing ticket #650 http://hackage.haskell.org/trac/ghc/ticket/650? In short, STArray and the garbage collector don't play well together, resulting in array updates being non-constant time operations. This bug makes it very difficult/impossible to write efficient array

Re: [Haskell-cafe] Boxed Mutable Arrays

2009-12-14 Thread Brad Larsen
Don, On Mon, Dec 14, 2009 at 4:16 PM, Don Stewart d...@galois.com wrote: brad.larsen: Is anyone working on fixing ticket #650 http://hackage.haskell.org/trac/ghc/ticket/650?  In short, STArray and the garbage collector don't play well together, resulting in array updates being non-constant

Re: [Haskell-cafe] Boxed Mutable Arrays

2009-12-14 Thread Brad Larsen
On Mon, Dec 14, 2009 at 4:34 PM, Don Stewart d...@galois.com wrote: brad.larsen: The vector package on haskell has boxed arrays.  Is DPH *really* only for primitive, unboxed types?  If so, that's unfortunate. No, it's not only, but all the uses I've seen have been related to numerics,

Re: [Haskell-cafe] Simple hash table creation

2009-11-17 Thread Brad Larsen
On Tue, Nov 17, 2009 at 4:00 PM, michael rice nowg...@yahoo.com wrote: Hi Gregory, I was wondering about that, because of the following: [1 of 1] Compiling Main ( hash1.hs, interpreted ) Ok, modules loaded: Main. *Main ht - new (==) dummy :: IO MyHashTable *Main dummy mike 7

Re: [Haskell-cafe] Simple hash table creation

2009-11-17 Thread Brad Larsen
On Tue, Nov 17, 2009 at 4:22 PM, michael rice nowg...@yahoo.com wrote: So, what you're telling me is, my dummy hash function IS being used, and because of collisions the other values are placed in different locations? Michael [...] If Data.HashTable is implemented using separate chaining,

Re: [Haskell-cafe] help with Haskell performance

2009-11-10 Thread Brad Larsen
On Tue, Nov 10, 2009 at 8:20 PM, Gokul P. Nair gpnai...@yahoo.com wrote: --- On Sat, 11/7/09, Don Stewart d...@galois.com wrote: General notes: * unpack is almost always wrong. * list indexing with !! is almost always wrong. * words/lines are often wrong for parsing large files

Re: [Haskell-cafe] Type-level naturals multiplication

2009-10-13 Thread Brad Larsen
On Tue, Oct 13, 2009 at 3:37 AM, Simon Peyton-Jones simo...@microsoft.com wrote: [...] It's also worth noting that while undecidable instances sound scary, but all it means is that the type checker can't prove that type inference will terminate.  We accept this lack-of-guarantee for the

[Haskell-cafe] Exponential complexity of type checking (Was: Type-level naturals multiplication)

2009-10-13 Thread Brad Larsen
-Milner type inference, for that matter? (Haskell 98 is not quite Hindley-Milner?) Sincerely, Brad Larsen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Exponential complexity of type checking (Was: Type-level naturals multiplication)

2009-10-13 Thread Brad Larsen
On Tue, Oct 13, 2009 at 12:32 PM, Serguey Zefirov sergu...@gmail.com wrote: 2009/10/13 Lennart Augustsson lenn...@augustsson.net: Yes, there are simple H-M examples that are exponential. x0 = undefined x1 = (x1,x1) x2 = (x2,x2) x3 = (x3,x3) ... xn will have a type with 2^n type variables

[Haskell-cafe] Type-level naturals multiplication

2009-10-10 Thread Brad Larsen
Suppose we implement type-level naturals as so: data Zero data Succ a Then, we can reflect the type-level naturals into a GADT as so (not sure if ``reflect'' is the right terminology here): data Nat :: * - * where Zero :: Nat Zero Succ :: Nat a - Nat (Succ a) Using type families, we can

Re: [Haskell-cafe] Re: Libraries for Commercial Users

2009-10-10 Thread Brad Larsen
On Sat, Oct 10, 2009 at 5:11 PM, Don Stewart d...@galois.com wrote: brad.larsen: John, On Thu, Oct 8, 2009 at 3:20 PM, John A. De Goes j...@n-brain.net wrote: [...] JVM is cross-platform, and contains sufficient typing information to permit one to write something like, import foreign jvm

Re: [Haskell-cafe] Num instances for 2-dimensional types

2009-10-05 Thread Brad Larsen
On Mon, Oct 5, 2009 at 10:36 AM, Miguel Mitrofanov miguelim...@yandex.ru wrote: [...] Of course, it's OK to call anything numbers provided that you stated explicitly what exactly you would mean by that. But then you have to drop all kind of stuff mathematicians developed for the usual notion of

Re: [Haskell-cafe] Cal, Clojure, Groovy, Haskell, OCaml, etc.

2009-09-29 Thread Brad Larsen
Don, On Mon, Sep 28, 2009 at 11:52 PM, Don Stewart d...@galois.com wrote: brad.larsen: On Mon, Sep 28, 2009 at 11:11 PM, Hong Yang hyang...@gmail.com wrote: [...] Maybe later on we can add an Example section to Description, Synopsis, and Documentation sections produced by Haddock.

Re: [Haskell-cafe] Cal, Clojure, Groovy, Haskell, OCaml, etc.

2009-09-28 Thread Brad Larsen
On Mon, Sep 28, 2009 at 11:11 PM, Hong Yang hyang...@gmail.com wrote: [...] Maybe later on we can add an Example section to Description, Synopsis, and Documentation sections produced by Haddock. Also, having a section for comments is helpful. This is the case especially when there are several

Re: [Haskell-cafe] A proposals

2009-09-27 Thread Brad Larsen
On Sun, Sep 27, 2009 at 5:29 PM, Louis Wasserman wasserman.lo...@gmail.com wrote: I'd like to see something resembling as-patterns in type signatures. Specifically, there are cases where I'm inclined to use (m ~ pat) in a type context when m isn't otherwise constrained, just so I can use m as

Re: [Haskell-cafe] An issue with EDSLs in the ``finally tagless'' tradition

2009-09-26 Thread Brad Larsen
Edward, On Sat, Sep 26, 2009 at 11:41 AM, Edward Kmett ekm...@gmail.com wrote: I would just like to add that Oleg and Chung-chieh made sure in their finally tagless paper to use monomorphic lifting of literals explicitly to avoid this sort of ambiguity. Using Num or another typeclass is fine

[Haskell-cafe] Re: Beginning of a meta-Haskell [was: An issue with the ``finally tagless'' tradition]

2009-09-25 Thread Brad Larsen
Oleg, On Thu, Sep 24, 2009 at 1:54 AM, o...@okmij.org wrote: The topic of an extensible, modular interpreter in the tagless final style has come up before. A bit more than a year ago, on a flight from Frankfurt to San Francisco I wrote two interpreters for a trivial subset of Haskell or ML

Re: [Haskell-cafe] An issue with EDSLs in the ``finally tagless'' tradition

2009-09-24 Thread Brad Larsen
modules, without having to go back and change the EDSL definition. Regards, Bradford Larsen On Sep 24, 2009 2:15 AM, Luke Palmer lrpal...@gmail.com wrote: On Wed, Sep 23, 2009 at 10:24 PM, Brad Larsen brad.lar...@gmail.com wrote: On Wed, Sep 23, 2009 ... I would like to see an example

Re: [Haskell-cafe] An issue with EDSLs in the ``finally tagless'' tradition

2009-09-24 Thread Brad Larsen
Bruno, On Thu, Sep 24, 2009 at 1:20 AM, Bruno Oliveira br...@ropas.snu.ac.kr wrote: Hello Brad, I believe that the problem you encountered is not quite the expression problem (which is about adding new constructors and functions modularly), but rather about refining *existing* constructs

Re: [Haskell-cafe] An issue with EDSLs in the ``finally tagless'' tradition

2009-09-24 Thread Brad Larsen
Wren, On Thu, Sep 24, 2009 at 8:36 PM, wren ng thornton w...@freegeek.org wrote: Brad Larsen wrote: The modularity problem I speak of is that to add a new interpretation of the DSL, I will likely have to modify the EDSL definition to add additional constraints. Ideally, I would like

[Haskell-cafe] An issue with EDSLs in the ``finally tagless'' tradition

2009-09-23 Thread Brad Larsen
I seem to have run into an instance of the expression problem [1], or something very similar, when experimenting with ``finally tagless'' EDSLs, and don't see a good way to work around it. I have been experimenting with embedded DSLs, using the techniques described in a couple recent papers

Re: [Haskell-cafe] An issue with EDSLs in the ``finally tagless'' tradition

2009-09-23 Thread Brad Larsen
Luke, On Wed, Sep 23, 2009 at 11:12 PM, Luke Palmer lrpal...@gmail.com wrote: On Wed, Sep 23, 2009 at 7:59 PM, Brad Larsen brad.lar...@gmail.com wrote: The trouble comes in when defining a more general arithmetic expression type class. Suppose we want polymorphic arithmetic expressions

Re: [Haskell-cafe] An issue with EDSLs in the ``finally tagless'' tradition

2009-09-23 Thread Brad Larsen
Luke, On Wed, Sep 23, 2009 at 11:12 PM, Luke Palmer lrpal...@gmail.com wrote: On Wed, Sep 23, 2009 at 7:59 PM, Brad Larsen brad.lar...@gmail.com wrote: The trouble comes in when defining a more general arithmetic expression type class. Suppose we want polymorphic arithmetic expressions

Re: [Haskell-cafe] An issue with EDSLs in the ``finally tagless'' tradition

2009-09-23 Thread Brad Larsen
Peter, On Thu, Sep 24, 2009 at 12:22 AM, Peter Gammie pete...@gmail.com wrote: [...] Ambiguity is IMHO best handled with a judicious application of type (or data) families, but you can get surprisingly far by simply requiring that every class member mention all type variables in the class

Re: [Haskell-cafe] Re: cabal: : openFile: does not exist (No such file or directory)

2009-09-02 Thread Brad Larsen
I had the same issue, using the ghc 6.10.4 generic linux tarball on Ubuntu Jaunty x86_64. I attempted to install a newer Haskell Platform over the older one. I'm not sure what causes the issue. After several attempts to remedy it without success, I ended up completely reinstalling ghc and

Re: [Haskell-cafe] Haskell as a religion

2008-12-18 Thread Brad Larsen
soon, nor Python compile-time type inference. I think perl6 is specced with pervasive laziness, although I'm not sure it's actually implemented anywhere. I'm not sure about pervasive, but I read somewhere that Perl 6's lists are head-strict, tail-lazy by default... Regards, Brad Larsen

Re: [Haskell-cafe] Re: Go Haskell! - array libraries

2008-11-29 Thread Brad Larsen
Regards, Brad Larsen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Very silly

2008-10-13 Thread Brad Larsen
typeclasses to me, but perhaps the similarity is merely superficial. :-) Regards, Brad Larsen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] timing question

2008-08-03 Thread Brad Larsen
' from Data.List is strict in its function argument, and is probably what you want. See also http://www.haskell.org/haskellwiki/Stack_overflow. Regards, Brad Larsen On Sun, 03 Aug 2008 07:06:40 -0400, Arie Groeneveld [EMAIL PROTECTED] wrote: Sorry, should go the forum. Ok, thanks

Re: [Haskell-cafe] a really dumb posting question ;^(

2008-07-30 Thread Brad Larsen
Vasili, You respond to whatever message interests you, just like normal email. Make sure the message is CC'd or addressed to haskell-cafe@haskell.org to allow everyone to see it. Regards, Brad Larsen 2008/7/31 Galchin, Vasili [EMAIL PROTECTED]: Hello, What do I do to do a followup

Re: [Haskell-cafe] More fun with micro-benchmarks and optimizations. (GHC vs Perl)

2008-07-23 Thread Brad Larsen
to the Corey's perl version: $ time perl Sum.pl Duration (sec): 3155.6266438 real0m0.181s user0m0.164s sys 0m0.012s Regards, Brad Larsen On Wed, 23 Jul 2008 15:01:24 -0400, Don Stewart [EMAIL PROTECTED] wrote: coreyoconnor: I have the need to regularly write tiny programs that analyze

Re: [Haskell-cafe] Integer = infinite precision integer? How?

2008-07-04 Thread Brad Larsen
). Regards, Brad Larsen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Type issues for a foldable trie in Haskell

2008-01-20 Thread Brad Larsen
want, preferably without using ghc extensions? Thanks! Brad Larsen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Type System (Was: Currying and Partial Evaluation)

2008-01-08 Thread Brad Larsen
described with 'b' instead of 'a'? Cheers, Brad Larsen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] A Foldable binary search tree

2007-12-23 Thread Brad Larsen
On Sun, 23 Dec 2007 06:42:52 -0500, Neil Mitchell [EMAIL PROTECTED] wrote: Hi Brad, Experience has taught me to _never_ put class contexts on data definitions. Now you can't write something as simple as Empty - you have to give it a class context. This is just plain annoying. With the

Re: [Haskell-cafe] Why does this blow the stack?

2007-12-21 Thread Brad Larsen
too large (x:_) !! 0 = x (_:xs) !! n = xs !! (n-1) Isn't this tail recursive? What is eating up the stack? Brad Larsen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Creating a type for a subset of the integers

2007-12-20 Thread Brad Larsen
On Wed, 19 Dec 2007 02:00:53 -0500, Jules Bean [EMAIL PROTECTED] wrote: Brad Larsen wrote: Hi there list, How would one go about creating a new type for a subset of the integers, for (contrived) example just the even integers? I was thinking of making a new type newtype EvenInt

[Haskell-cafe] Creating a type for a subset of the integers

2007-12-18 Thread Brad Larsen
to prevent this, the module does not export the constructor for it---rather, the module exports a function `mkEvenInt' that creates an EvenInt if the given value is acceptable or raises an error otherwise. What's the right way to do this? Thanks! Brad Larsen