[Haskell-cafe] Re: What does the Haskell type system do with show (1+2)?

2006-01-13 Thread Christian Maeder
Jared Updike wrote: http://www.haskell.org/onlinereport/decls.html#default-decls http://www.haskell.org/tutorial/numbers.html#sect10.4 I still don't see, why it works for show but not for my_show. On 1/12/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: [...] class (Show a) = My_show a where

Re: [Haskell-cafe] What does the Haskell type system do with show (1+2)?

2006-01-13 Thread Henning Thielemann
On Thu, 12 Jan 2006 [EMAIL PROTECTED] wrote: What does the Haskell type system do with expressions such as these . . . ? show 1 show (1+2) The type of the subexpressions 1 and 1+2 are ambiguous since they have type (Num a) = a. I'm under the assumption before 1+2 is evaluated, the 1 and

Re: [Haskell-cafe] Does anybody have a simple example of using continuation Monad?

2006-01-13 Thread Daniel Fischer
Am Freitag, 13. Januar 2006 01:31 schrieb Cale Gibbard: On 12/01/06, Marc Weber [EMAIL PROTECTED] wrote: I think one simple example like ((+1).(\x-x**2)) in continuation style would make me understand a lot more.. Marc The basic idea about the continuation monad is that the entire

Re: [Haskell-cafe] Re: What does the Haskell type system do with show (1+2)?

2006-01-13 Thread Daniel Fischer
Am Freitag, 13. Januar 2006 11:12 schrieb Christian Maeder: Jared Updike wrote: http://www.haskell.org/onlinereport/decls.html#default-decls http://www.haskell.org/tutorial/numbers.html#sect10.4 I still don't see, why it works for show but not for my_show. Says the report: Ambiguities in

Re: [Haskell-cafe] Re: What does the Haskell type system do with show (1+2)?

2006-01-13 Thread Cale Gibbard
On 13/01/06, Daniel Fischer [EMAIL PROTECTED] wrote: Am Freitag, 13. Januar 2006 11:12 schrieb Christian Maeder: Jared Updike wrote: http://www.haskell.org/onlinereport/decls.html#default-decls http://www.haskell.org/tutorial/numbers.html#sect10.4 I still don't see, why it works for

Re: [Haskell-cafe] Re: What does the Haskell type system do withshow (1+2)?

2006-01-13 Thread Brian Hulley
Cale Gibbard wrote: Snip So long as we're going to have a defaulting mechanism, it seems a bit odd to restrict it to Num, and to classes in the Prelude. Instead of having literals such as 1 that could be Int, Integer, or Float etc, why not just have one Number type declared as something

Re: [Haskell-cafe] Re: What does the Haskell type system do withshow (1+2)?

2006-01-13 Thread Cale Gibbard
On 13/01/06, Brian Hulley [EMAIL PROTECTED] wrote: Cale Gibbard wrote: Snip So long as we're going to have a defaulting mechanism, it seems a bit odd to restrict it to Num, and to classes in the Prelude. Instead of having literals such as 1 that could be Int, Integer, or Float etc, why

[Haskell-cafe] Re: Haskell-Cafe Digest, Vol 29, Issue 36

2006-01-13 Thread Jeff . Harper
Christian Maeder wrote: Jared Updike wrote: http://www.haskell.org/onlinereport/decls.html#default-decls http://www.haskell.org/tutorial/numbers.html#sect10.4 I still don't see, why it works for show but not for my_show. On 1/12/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: [...]

[Haskell-cafe] Inheritance without OOHaskell

2006-01-13 Thread John Goerzen
Hello, I'd like to put forth two situations in which I miss the ability to use inheritance in Haskell, and then see if maybe somebody has some insight that I'm missing out on. Situation #1: In HDBC, there is a Connection type that is more or less equivolent to a class on a OOP language. In

[Haskell-cafe] Splitting a string into chunks

2006-01-13 Thread Adam Turoff
Hi, I'm trying to split a string into a list of substrings, where substrings are delimited by blank lines. This feels like it *should* be a primitive operation, but I can't seem to find one that works. It's neither a fold nor a partition, since each chunk is separated by a 2-character sequence.

Re: [Haskell-cafe] Inheritance without OOHaskell

2006-01-13 Thread Cale Gibbard
On 13/01/06, John Goerzen [EMAIL PROTECTED] wrote: Hello, I'd like to put forth two situations in which I miss the ability to use inheritance in Haskell, and then see if maybe somebody has some insight that I'm missing out on. Situation #1: In HDBC, there is a Connection type that is more

Re: [Haskell-cafe] Splitting a string into chunks

2006-01-13 Thread Sebastian Sylvan
On 1/13/06, Adam Turoff [EMAIL PROTECTED] wrote: Hi, I'm trying to split a string into a list of substrings, where substrings are delimited by blank lines. This feels like it *should* be a primitive operation, but I can't seem to find one that works. It's neither a fold nor a partition,

Re: [Haskell-cafe] Splitting a string into chunks

2006-01-13 Thread Sebastian Sylvan
On 1/13/06, Sebastian Sylvan [EMAIL PROTECTED] wrote: On 1/13/06, Adam Turoff [EMAIL PROTECTED] wrote: Hi, I'm trying to split a string into a list of substrings, where substrings are delimited by blank lines. This feels like it *should* be a primitive operation, but I can't seem to

Re: [Haskell-cafe] Splitting a string into chunks

2006-01-13 Thread Jared Updike
That works except it loses single newline characters. let s = 1234\n5678\n\nabcdefghijklmnopq\n\n,,.,.,. Prelude blocks s [12345678,abcdefghijklmnopq,,,.,.,.] Jared. On 1/13/06, Sebastian Sylvan [EMAIL PROTECTED] wrote: On 1/13/06, Sebastian Sylvan [EMAIL PROTECTED] wrote: On 1/13/06, Adam

Re: [Haskell-cafe] Splitting a string into chunks

2006-01-13 Thread Jon Fairbairn
On 2006-01-13 at 13:32PST Jared Updike wrote: That works except it loses single newline characters. let s = 1234\n5678\n\nabcdefghijklmnopq\n\n,,.,.,. Prelude blocks s [12345678,abcdefghijklmnopq,,,.,.,.] Also the argument to groupBy ought to be some sort of equivalence relation. blocks =

Re: [Haskell-cafe] Splitting a string into chunks

2006-01-13 Thread Robert Dockins
On Jan 13, 2006, at 4:35 PM, Jon Fairbairn wrote: On 2006-01-13 at 13:32PST Jared Updike wrote: That works except it loses single newline characters. let s = 1234\n5678\n\nabcdefghijklmnopq\n\n,,.,.,. Prelude blocks s [12345678,abcdefghijklmnopq,,,.,.,.] Also the argument to groupBy ought

Re: [Haskell-cafe] Splitting a string into chunks

2006-01-13 Thread Adam Turoff
On 1/13/06, Sebastian Sylvan [EMAIL PROTECTED] wrote: blocks = map concat . groupBy (const (not . null)) . lines Thanks. That's a little more involved than I was looking for, but that certainly looks better than pattern matching on ('\n':'\n':rest). ;-) For the record, lines removes the

[Haskell-cafe] HDBC Transactions with Sqlite3

2006-01-13 Thread Tom Hawkins
I have HDBC running with Sqlite3, but I'm getting a SqlError due to a locked table. Please excuse my SQL ignorance, but what may be causing the problem? In SQL, are we not allowed to select, update, and delete from a table within a single transaction? If not, what are the rules for

Re: [Haskell-cafe] Re: What does the Haskell type system do with show (1+2)?

2006-01-13 Thread Lennart Augustsson
Daniel Fischer wrote: Now the question is, could that restriction be lifted, i.e., would it be possible/worthwhile to let defaulting also take place if user defined classes are involved? The current defaulting mechanism in Haskell is very, very conservative. You could easily relax the