[Haskell-cafe] KiCS (Curry to Haskell interpreter) problem

2009-12-02 Thread Bernd Brassel
I am playing around with KiCS and I have a strange problem, when I evaluate a goal the variable bindings are not displayed, I see only the value of the expression. The idea is, that you decide yourself which bindings you want to see. For example, you write (let x free in (not x,x)) to get

Re: [Haskell-cafe] seems like I'm on the wrong track

2009-12-02 Thread Gregg Reynolds
On Tue, Dec 1, 2009 at 7:01 PM, Michael P Mossey m...@alumni.caltech.edu wrote: Perhaps someone could either (1) help me do what I'm trying to do, or (2) show me a better way. In this one example, in a OO way of thinking, I have data called AssignedNumbers that assigns integers to unique

Re: [Haskell-cafe] seems like I'm on the wrong track

2009-12-02 Thread Gregg Reynolds
On Tue, Dec 1, 2009 at 7:55 PM, Michael Mossey m...@alumni.caltech.edu wrote: Thanks for the reply. Was there something specific you were referring to, or Maybe http://plucky.cs.yale.edu/cs431/reading.htm Chapter 9 An Algebra of Music. ___ Haskell-Cafe

Re: [Haskell-cafe] seems like I'm on the wrong track

2009-12-02 Thread Stephen Tetley
Hi Mike There used to be some slides available commenting on Haskore's CSound interface. But they seem to have vanished (I have a copy rendered to pdf when they were available). Like all slide presentations there's a lot of reading between the lines to get a good picture after the fact:

Re: [Haskell-cafe] Building network package on Windows

2009-12-02 Thread Duncan Coutts
On Sat, 2009-06-06 at 21:43 -0700, Iavor Diatchki wrote: Hi, I have been trying to build the package network from hackage (version 2.2.1.3) on Windows Vista, and I could really use some help. Unfortunately, if I try to use my package to build an executable application I get a linker error,

[Haskell-cafe] Ord k = Data.Set.Set k - (k-v) - Data.Map.Map k v

2009-12-02 Thread Matthias Görgens
I feel that Data.Set and Data.Map should be working together more closely. For example you can already get the keyset of a Map, but the `other way' is not built-in. I mean a function with a signature like Ord k = Data.Set.Set k - (k-v) - Data.Map.Map k v You can implement it in O(n): assoc

[Haskell-cafe] computing lists of pairs

2009-12-02 Thread Christian Maeder
Wizards, I've the following small piece of code \begin{code} pairs :: [a] - [b] - [[(a, b)]] pairs l1 = map (zip l1) . takeKFromN l1 takeKFromN :: [b] - [a] - [[a]] takeKFromN s l = case s of [] - [[]] _ : r - [ a : b | a - l, b - takeKFromN r l] \end{code} I have a predicate: p :: (a,

RE: [Haskell-cafe] Type synonym family inside type class

2009-12-02 Thread Simon Peyton-Jones
I agree this is wrong. I've created a Trac bug report http://hackage.haskell.org/trac/ghc/ticket/3714 Thanks for pointing it out Simon | -Original Message- | From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe- | boun...@haskell.org] On Behalf Of Martijn van Steenbergen | Sent:

[Haskell-cafe] Re: inversion lists

2009-12-02 Thread Ted Zlatanov
On Wed, 2 Dec 2009 01:12:23 +0100 Daniel Fischer daniel.is.fisc...@web.de wrote: DF No, quite the opposite. foldr is wonderful for lazy list processing. DF I just need to make my function a wee bit lazier: ... DF No, foldl cannot produce anything before the whole list has been traversed, so it

Re: [Haskell-cafe] computing lists of pairs

2009-12-02 Thread Daniel Fischer
Am Mittwoch 02 Dezember 2009 14:49:21 schrieb Christian Maeder: Wizards, I've the following small piece of code \begin{code} pairs :: [a] - [b] - [[(a, b)]] pairs l1 = map (zip l1) . takeKFromN l1 takeKFromN :: [b] - [a] - [[a]] takeKFromN s l = case s of [] - [[]] _ : r - [ a : b

Re: [Haskell-cafe] seems like I'm on the wrong track

2009-12-02 Thread Michael Mossey
Stephen Tetley wrote: Hi Mike There used to be some slides available commenting on Haskore's CSound interface. But they seem to have vanished (I have a copy rendered to pdf when they were available). Like all slide presentations there's a lot of reading between the lines to get a good picture

Re: [Haskell-cafe] seems like I'm on the wrong track

2009-12-02 Thread Michael Mossey
Hi Gregg, Yes, I've read his book School of Expression and I'll have to check up on this draft. His ideas are very useful at the level of composing music, where an algebraic representation is natural and flies free and high. It's when that representation grinds against an old quaint system

Re: [Haskell-cafe] computing lists of pairs

2009-12-02 Thread Daniel Fischer
Or: fpairs p s l = sequence [[(a,b) | b - filter (p a) l] | a - s] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] seems like I'm on the wrong track

2009-12-02 Thread Michael Mossey
Michael P Mossey wrote: Perhaps someone could either (1) help me do what I'm trying to do, or (2) show me a better way. I have a problem that is very state-ful and I keep thinking of it as OO, which is driving me crazy. Haskell is several times harder to use than Python in this instance,

[Haskell-cafe] Re: computing lists of pairs

2009-12-02 Thread Christian Maeder
Thanks a lot, works as expected and is super short! Cheers Christian Daniel Fischer schrieb: Or: fpairs p s l = sequence [[(a,b) | b - filter (p a) l] | a - s] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Re: computing lists of pairs

2009-12-02 Thread Daniel Fischer
Am Mittwoch 02 Dezember 2009 17:10:02 schrieb Christian Maeder: Thanks a lot, works as expected and is super short! You're welcome. However, according to a couple of tests, the funkyName version is somewhat faster and allocates less. Cheers Christian Daniel Fischer schrieb: Or:

Re: [Haskell-cafe] seems like I'm on the wrong track

2009-12-02 Thread Daniel Fischer
Am Mittwoch 02 Dezember 2009 16:55:01 schrieb Michael Mossey: Does this seem more functional in style? Much more :) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: computing lists of pairs

2009-12-02 Thread Christian Maeder
Daniel Fischer schrieb: However, according to a couple of tests, the funkyName version is somewhat faster and allocates less. My timing tests showed that your fpairs version is fastest. (first argument True selects filteredPairs, False funkyName) My initial version myf is almost unusable.

Re: [Haskell-cafe] Existencial Types

2009-12-02 Thread Ryan Ingram
On Tue, Dec 1, 2009 at 4:44 PM, Luke Palmer lrpal...@gmail.com wrote: Existential types only buy you power when the quantified variable appears more than once on the right hand side, for example:  forall a. Num a = (a,a).  But even those can usually be factored out into more direct

[Haskell-cafe] Re: computing lists of pairs

2009-12-02 Thread Daniel Fischer
Am Mittwoch 02 Dezember 2009 18:54:51 schrieb Christian Maeder: Daniel Fischer schrieb: However, according to a couple of tests, the funkyName version is somewhat faster and allocates less. My timing tests showed that your fpairs version is fastest. (first argument True selects

[Haskell-cafe] Beginner's speed problem

2009-12-02 Thread Aditya M
Hi, I am trying to solve this problem: https://www.spoj.pl/problems/LASTDIG/ It is very simple. Given a and b, return the last digit of a^b. b could be large, so I used logarithmic exponentiation and wrote/submitted the code below for this problem:

Re: [Haskell-cafe] Beginner's speed problem

2009-12-02 Thread Don Stewart
aditya87: Hi, I am trying to solve this problem: https://www.spoj.pl/problems/LASTDIG/ It is very simple. Given a and b, return the last digit of a^b. b could be large, so I used logarithmic exponentiation and wrote/submitted the code below for this problem:

Re: [Haskell-cafe] instance Binary UTCTime (Was: Oprhan instances)

2009-12-02 Thread Joachim Breitner
Hi, Am Montag, den 30.11.2009, 00:30 + schrieb Duncan Coutts: I should also note that distros will not look kindly on solutions that require N * M separate packages. with my Debian-Developer hat on I can very much support this statement. Which is why I’m so interested in a proper solution

Re: [Haskell-cafe] Beginner's speed problem

2009-12-02 Thread Daniel Fischer
Am Mittwoch 02 Dezember 2009 22:44:01 schrieb Don Stewart: aditya87: Hi, I am trying to solve this problem: https://www.spoj.pl/problems/LASTDIG/ It is very simple. Given a and b, return the last digit of a^b. b could be large, so I used logarithmic exponentiation and Just to mention

[Haskell-cafe] Finding HP

2009-12-02 Thread Andrew Coppin
Today I was setting up a my new, and I wanted to put Haskell on it. Rather than download GHC itself, I decided to install the Haskell Platform instead, just to see what it's like. Much to my surprise, I couldn't actually find any reference to its existence anywhere from the haskell.org home

Re: [Haskell-cafe] Finding HP

2009-12-02 Thread Don Stewart
andrewcoppin: Today I was setting up a my new, and I wanted to put Haskell on it. Rather than download GHC itself, I decided to install the Haskell Platform instead, just to see what it's like. Much to my surprise, I couldn't actually find any reference to its existence anywhere from

Re: [Haskell-cafe] Finding HP

2009-12-02 Thread Gregory Crosswhite
On Dec 2, 2009, at 2:26 PM, Andrew Coppin wrote: Subsequently, I realise [as somebody will no doubt point out] that the link is actually there, on the front page, right next to GHC, Hugs, et al. On Dec 2, 2009, at 2:29 PM, Don Stewart wrote: It is listed right on the front page, twice.

[Haskell-cafe] Implicit newtype unwrapping

2009-12-02 Thread Martijn van Steenbergen
So here's a totally wild idea Sjoerd and I came up with. What if newtypes were unwrapped implicitly? What advantages and disadvantages would it have? In what cases would this lead to ambiguous code? Thanks, Martijn. ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Implicit newtype unwrapping

2009-12-02 Thread Tony Morris
Isn't that the point of type-classes? Martijn van Steenbergen wrote: So here's a totally wild idea Sjoerd and I came up with. What if newtypes were unwrapped implicitly? What advantages and disadvantages would it have? In what cases would this lead to ambiguous code? Thanks, Martijn.

[Fwd: Re: [Haskell-cafe] Implicit newtype unwrapping]

2009-12-02 Thread Holger Siegel
Am Donnerstag, den 03.12.2009, 01:16 +0100 schrieb Martijn van Steenbergen: So here's a totally wild idea Sjoerd and I came up with. What if newtypes were unwrapped implicitly? What advantages and disadvantages would it have? In what cases would this lead to ambiguous code? 1) instance

Re: [Fwd: Re: [Haskell-cafe] Implicit newtype unwrapping]

2009-12-02 Thread Sjoerd Visscher
The idea is that there's just enough unwrapping such that you don't need to use getDual and appEndo. On Dec 3, 2009, at 1:25 AM, Holger Siegel wrote: Am Donnerstag, den 03.12.2009, 01:16 +0100 schrieb Martijn van Steenbergen: So here's a totally wild idea Sjoerd and I came up with. What

Re: [Haskell-cafe] Re: Are there standard idioms for lazy, pure error handling?

2009-12-02 Thread wren ng thornton
Nicolas Pouillard wrote: Excerpts from Heinrich Apfelmus's message of Tue Dec 01 11:29:24 +0100 2009: I propose to (trivially) generalize this type to list with an end data ListEnd a b = Cons a (ListEnd a b) | End b because it may have other uses than just lazy error

Re: [Haskell-cafe] Implicit newtype unwrapping

2009-12-02 Thread Gregory Crosswhite
Out of curiosity, why would one want a newtype that were unwrapped implicitly, rather than just using type? Personally, whenever I use a newtype it is precisely because I *want* the compiler not to implicitly turn it into something else in order to protect myself. Cheers, Greg On Dec 2,

Re: [Haskell-cafe] Implicit newtype unwrapping

2009-12-02 Thread Greg Fitzgerald
Gregory Crosswhite gcr...@phys.washington.edu wrote: Out of curiosity, why would one want a newtype that were unwrapped implicitly, rather than just using type? One reason might be because you only switched from 'type' to 'newtype' so that you could write more refined Arbitrary instances for

Re: [Haskell-cafe] Implicit newtype unwrapping

2009-12-02 Thread Luke Palmer
On Wed, Dec 2, 2009 at 6:08 PM, Greg Fitzgerald gari...@gmail.com wrote: Gregory Crosswhite gcr...@phys.washington.edu wrote: Out of curiosity, why would one want a newtype that were unwrapped implicitly, rather than just using type? One reason might be because you only switched from 'type'

Re: [Haskell-cafe] Implicit newtype unwrapping

2009-12-02 Thread Gregory Crosswhite
Ah, that's a really good point. It seems then that there is a use for implicitly unwrapped newtypes, but perhaps only when you never really wanted to use a newtype to begin with but had to in order to use a different instance declaration for the same type. That suggests that the feature we'd

Re: [Haskell-cafe] instance Binary UTCTime (Was: Oprhan instances)

2009-12-02 Thread Reid Barton
On Wed, Dec 02, 2009 at 11:03:52PM +0100, Joachim Breitner wrote: Hi, Am Montag, den 30.11.2009, 00:30 + schrieb Duncan Coutts: I should also note that distros will not look kindly on solutions that require N * M separate packages. with my Debian-Developer hat on I can very much

Re: [Haskell-cafe] Implicit newtype unwrapping

2009-12-02 Thread Greg Fitzgerald
That suggests that the feature we'd really like is a way to declare that we want a type in a context to act as if it had a different instance declaration for a given typeclass, without having to go through newtype. I'd want implicit type coercion from subtypes, so that you wouldn't need an

[Haskell-cafe] Second Call for Copy: Monad.Reader Issue 15

2009-12-02 Thread Brent Yorgey
It's not too late to write something for Issue 15 of the Monad.Reader! Whether you're an established academic or have only just started learning Haskell, if you have something to say, please consider writing an article for The Monad.Reader! The submission deadline for Issue 15 is

[Haskell-cafe] universal binary version of Haskell Platform?

2009-12-02 Thread Benjamin L . Russell
Recently, in changing my work schedule to work mainly from home, I switched from mainly using a work Wintel machine running Windows XP Professional, Service Pack 3, to mainly using my home PowerPC G4 PowerBook Macintosh, currently upgraded to Mac OS X 10.5.8 Leopard. However, to my surprise,

[Haskell-cafe] Haddock Secrets?

2009-12-02 Thread Gregory Crosswhite
Hey everyone, Is there some secret to getting Haddock to work with literate Haskell sources that I am missing? For example, when I download Takusen and type cabal configure cabal haddock It produces HTML files complete with a table of contents, but with all of the

Re: [Haskell-cafe] Beginner's speed problem

2009-12-02 Thread Aditya M
Hello Thanks for all the help! I only have a couple of questions. On Thu, Dec 3, 2009 at 03:45, Daniel Fischer daniel.is.fisc...@web.de wrote: Am Mittwoch 02 Dezember 2009 22:44:01 schrieb Don Stewart: aditya87: Hi, I am trying to solve this problem:

Re: [Haskell-cafe] Implicit newtype unwrapping

2009-12-02 Thread Gregory Crosswhite
But it seems to me like the whole point of using newtype is because you *don't* want your new type to be used everywhere that the old type can be used; otherwise you would just use type to create an alias. The only convincing exception I have heard to this (as you helpfully explained to me)

Re: [Haskell-cafe] Implicit newtype unwrapping

2009-12-02 Thread Max Bolingbroke
2009/12/3 Gregory Crosswhite gcr...@phys.washington.edu: But it seems to me like the whole point of using newtype is because you *don't* want your new type to be used everywhere that the old type can be used;  otherwise you would just use type to create an alias.  The only convincing