| jql | never seen someone use Haskell as their first *or* second language. :) |
| MP0 | is there a way to declare a data type in a let statement? I've tried "let data AAA = A | B | C deriving (Eq, Ord) in (A<B)" |
| emu | no |
| dons | jql, it was my first language :-) |
| ddarius | jql: Occasionally if they get it in a university. |
| dons | and thousands of others at unsw, actually. or chalmers, or oxford, or ... |
| MP0 | is there a reason why that's not possible? |
| ddarius | dons: In my experience, they tend not to be the ones that stay. |
| jql | is there an inverse first-language-BASIC rule in effect? does learning haskell first cripple you with regard to learning more primitive languages? :) |
| dons | MP0, types (which is what you're declaring), are at the top level of a module ddarius: that's true. |
| sjanssen | MP0: it's a little tricky, what is the type of "let data A = A in A"? |
| MP0 | hmm, I was hoping if it derived Ord, it would be 0 or 1 |
| dons | if you derive Enum > fromEnum True |
| lambdabot | 1 |
| MP0 | sorry, Enum |
| jql | Every Haskell program I've written feels more like writing a maths proof than an imperative progrem |
| dons | > fromEnum LT |
| lambdabot | 0 |
| dons | jql, maybe you write the wrong kind of haskell program? |
| jql | I can't picture going from that to... say, VB |
| siti | write a gui app :D |
| ddarius | jql: You are writing a logical proof. |
| jql | no, I meant that in the good way. :) |
| dons | here's some imperative haskell :-) http://www.cse.unsw.edu.au/~dons/code/nobench/bin/bench.hs |
| ddarius | That said, writing Haskell feels like neither to me. |
| dons | (that's a testsuite driver) quick hack |
| jql | I don't want to write another kind of Haskell program. I'm trying to escape the finger-diarrea of other languages |
| araujo | hello |
| siti | enough indentation? |
| dons | just a little just to say, you can hack perlish scripts in haskell too ;) but they'll have data types in them |
| sjanssen | MP0: I think the answer to your question is a cost vs. benefit issue. Let scoped data decls are rarely (never?) needed, and they'd be quite complicated to describe in the standard |
| MP0 | ah. My only issue is that it makes it impossible to play with in ghci so I've changed over to writing into a text file |
| sjanssen | MP0: that is the recommended workflow with ghci or hugs type the definitions in a file, then :load the file and explore |
| action | ddarius doesn't say something about Church encoding data types into functions... |
| ddarius | doesn't say something about Church encoding data types into functions... |