Re: [Haskell-cafe] Re: Are GADTs what I need?

2009-07-14 Thread Jason Dagit
On Mon, Jul 13, 2009 at 10:52 PM, Ashley Yakeley ash...@semantic.orgwrote: Ryan Ingram wrote: data Type a where TInt :: Type Int TBool :: Type Bool TChar :: Type Char TList :: Type a - Type [a] TFun :: Type a - Type b - Type (a - b) Type here is what I call a simple type

[Haskell-cafe] Re: Example for formatted show in HStringTemplate

2009-07-14 Thread John MacFarlane
+++ Kemps-Benedix Torsten [Jul 13 09 23:56 ]: Hello, is there a working example of how to use the format clause with HStringTemplate, e.g. for Data.Time.Day? I think, if there is a parameter $day$, a reasonable template might contain e.g.: $day;format=%d.%b.%Y$ But I only get

Re: [Haskell-cafe] Re: Are GADTs what I need?

2009-07-14 Thread Ashley Yakeley
On Mon, 2009-07-13 at 23:20 -0700, Jason Dagit wrote: data EqualType a b where MkEqualType :: EqualType t t Is there any reason to prefer this over: data EqualType a b where MkEqualType :: EqualType a a They're exactly the same. Yours just looks a bit left-biased,

Re: [Haskell-cafe] Re: Are GADTs what I need?

2009-07-14 Thread Luke Palmer
On Mon, Jul 13, 2009 at 10:33 PM, Ashley Yakeley ash...@semantic.orgwrote: On Mon, 2009-07-13 at 23:20 -0700, Jason Dagit wrote: data EqualType a b where MkEqualType :: EqualType t t Is there any reason to prefer this over: data EqualType a b where MkEqualType

[Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Simon Peyton-Jones
Haskell is a great language! Check out haskell.org. I'm ccing the Haskell Cafe which is read by many people better qualified to answer your question than me. (Since I've been working on Haskell for many years, I am not well qualified to say how it seems to a beginner.) S | -Original

Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Andrew Butterfield
Simon Peyton-Jones wrote: Haskell is a great language! Check out haskell.org. I'm ccing the Haskell Cafe which is read by many people better qualified to answer your question than me. (Since I've been working on Haskell for many years, I am not well qualified to say how it seems to a

Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Joe Fredette
If only for the fact that our little Haskell community is composed of about the nicest set of people ever -- I mean, try asking a newbie question on #c sometime -- then Haskell is a great language to learn early. Not only is it great because of it's community, but it's also full of resources

Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Michael Vanier
Simon Peyton-Jones wrote: Haskell is a great language! Check out haskell.org. I'm ccing the Haskell Cafe which is read by many people better qualified to answer your question than me. (Since I've been working on Haskell for many years, I am not well qualified to say how it seems to a

Re: [Haskell-cafe] Program with profiling runs faster than without

2009-07-14 Thread Grigory Sarnitskiy
14.07.09, 12:37, Grigory Sarnitskiy sargrig...@ya.ru: Hello! I can't understand why the following happens. ghc --make -fforce-recomp -O2 -fexcess-precision -fvia-C -optc-O2 Run.lhs -o Run -prof -auto-all and time ./Run TestSim seems to be much faster (I got ~4 times faster indeed) than

Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Miguel Mitrofanov
I disagree. It was easy enough for me. OK, I do have some Category Theory background and it certainly helps a lot. Still, I think that for a beginner (without any experience with C or anything like that) Haskell would be relatively easy. It doesn't involve (at least at the start) an ugly

Re[2]: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Bulat Ziganshin
Hello Michael, Tuesday, July 14, 2009, 2:01:44 PM, you wrote: Haskell is a wonderful language (my favorite language by far) but it is pretty difficult for a beginner. i believe that Haskell is hard for intermediate programmers already knowing any imperative language, but for beginners it

[Haskell-cafe] Re: [Haskell] Re: 20 years ago

2009-07-14 Thread Ketil Malde
[redirected from hask...@] Benjamin L.Russell dekudekup...@yahoo.com writes: One often amusing outgrowth of this is that FP (OOP) fanatics anthropomorphize their functions (objects). Well, I don't think we do. Functions are just mappings of values to values, they may be opaque, but

[Haskell-cafe] AW: Example for formatted show in HStringTemplate

2009-07-14 Thread Kemps-Benedix Torsten
John, thanks for your answer, but HStringtemplate has instance definitions for Date.Time.Day. The question is more on the script side: How do I have to write the ST calls with ;format= embedded in HTML? regards, Torsten -Ursprüngliche Nachricht- Von: John MacFarlane

Re: [Haskell-cafe] Program with profiling runs faster than without

2009-07-14 Thread Malcolm Wallace
On 14 Jul 2009, at 11:09, Grigory Sarnitskiy wrote: I think it is quite strange to the profiled version to run faster I'm really interested how to obtain the same speed withput profiling compilation. This is only a guess, but maybe there is a context-qualified CAF-like value that is

Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Duncan Coutts
On Tue, 2009-07-14 at 03:01 -0700, Michael Vanier wrote: Charles, Haskell is a wonderful language (my favorite language by far) but it is pretty difficult for a beginner. In fact, it is pretty difficult for anyone to learn in my experience, because it has so many advanced concepts that

[Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Patai Gergely
Hello all, I was asked to give a one-hour 'introductory' seminar on Haskell. The audience is a bunch of very clever people with a wider than usual perspective on programming and mathematics, and my talk should be rather informational than evangelistic. Which topics do you think I should touch by

Re: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Thomas Davie
On 14 Jul 2009, at 15:30, Patai Gergely wrote: Hello all, I was asked to give a one-hour 'introductory' seminar on Haskell. The audience is a bunch of very clever people with a wider than usual perspective on programming and mathematics, and my talk should be rather informational than

Re: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Magnus Therning
On Tue, Jul 14, 2009 at 2:42 PM, Thomas Davietom.da...@gmail.com wrote: On 14 Jul 2009, at 15:30, Patai Gergely wrote: Hello all, I was asked to give a one-hour 'introductory' seminar on Haskell. The audience is a bunch of very clever people with a wider than usual perspective on

Re: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Cristiano Paris
On Tue, Jul 14, 2009 at 3:42 PM, Thomas Davietom.da...@gmail.com wrote: On 14 Jul 2009, at 15:30, Patai Gergely wrote: Hello all, I was asked to give a one-hour 'introductory' seminar on Haskell. The audience is a bunch of very clever people with a wider than usual perspective on

Re: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Cristiano Paris
2009/7/14 Patai Gergely patai_gerg...@fastmail.fm: Hello all, I was asked to give a one-hour 'introductory' seminar on Haskell. The audience is a bunch of very clever people with a wider than usual perspective on programming and mathematics, and my talk should be rather informational than

Re: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Andrew Wagner
http://www.haskell.org/haskellwiki/Tying_the_Knot would seem to be relevant. On Tue, Jul 14, 2009 at 9:55 AM, Cristiano Paris fr...@theshire.org wrote: I would like to know them. I'm looking for small snippets of code that are elegant when written in Haskell (which is lazy by default) but

Re: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Miguel Mitrofanov
Domain theory semantics, I guess. I know, that if I (or rather a younger copy of me, not knowing a thing about Haskell) would be one of your students, and you tell me that there is such a clean and nice semantics for what we are doing, I'd be excited. Patai Gergely wrote: Hello all, I was

Re: [Haskell-cafe] Program with profiling runs faster than without

2009-07-14 Thread Grigory Sarnitskiy
14.07.09, 15:16, Malcolm Wallace malcolm.wall...@cs.york.ac.uk: This is only a guess, but maybe there is a context-qualified CAF-like value that is being re-evaluated multiple times in the non-profiling case, but is appropriately monomorphised in the profiling case, so it is only

Re: AW: [Haskell-cafe] Example for formatted show in HStringTemplate

2009-07-14 Thread Sterling Clover
What I suspect that you've encountered is an infelicity when importing GenericStandard. The ToSElem instance defaults to that provided by (Data a) context. However, there is no special handler for Data.Time types in the `extQ` chain. I could add one, but that would require relying on the

Re: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Magnus Therning
On Tue, Jul 14, 2009 at 3:01 PM, Cristiano Parisfr...@theshire.org wrote: 2009/7/14 Patai Gergely patai_gerg...@fastmail.fm: Hello all, I was asked to give a one-hour 'introductory' seminar on Haskell. The audience is a bunch of very clever people with a wider than usual perspective on

Re[2]: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Bulat Ziganshin
Hello Cristiano, Tuesday, July 14, 2009, 6:01:14 PM, you wrote: When you create the presentation, please consider the big picture of Haskell, not only its technological features like laziness, curryfication, HOF, monadic syntax, type inference, type classes and so on. I would concentrate

[Haskell-cafe] Problem resizing widget contained in window

2009-07-14 Thread Jeff Heard
I created a window, like so: Gtk.windowSetTitle win name Gtk.widgetSetName win Hieroglyph Gtk.onDestroy win (exitWith ExitSuccess) Gtk.windowSetDefaultSize win w h Gtk.containerResizeChildren win And an GLDrawingArea like so: config ← Gtk.glConfigNew [Gtk.GLModeRGBA, Gtk.GLModeMultiSample,

Re: Re[2]: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Cristiano Paris
On Tue, Jul 14, 2009 at 4:46 PM, Bulat Ziganshinbulat.zigans...@gmail.com wrote: ... the question is how to justify this in 1 hour. technical people don't buy such arguments with justification. but if it will be done, it would be best presentation possible I think it's important to elaborate

Re: Re[2]: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Ross Mellgren
I agree -- I think the most major learning curve problem (for me) was not learning haskell directly, it was un-learning all those patterns and workarounds and so on from imperative/OOP languages. Of course, the only problem with learning haskell first is that one will probably be mildly

Re: Re[2]: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Cristiano Paris
On Tue, Jul 14, 2009 at 5:12 PM, Cristiano Parisfr...@theshire.org wrote: ... Why don't we create a specific Wiki page about Haskell advocation, http://haskell.org/haskellwiki/Advocation Cristiano ___ Haskell-Cafe mailing list

Re: Re[2]: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Max Cantor
Any chance of renaming it to Advocacy? On Jul 14, 2009, at 11:42 PM, Cristiano Paris wrote: On Tue, Jul 14, 2009 at 5:12 PM, Cristiano Parisfr...@theshire.org wrote: ... Why don't we create a specific Wiki page about Haskell advocation, http://haskell.org/haskellwiki/Advocation Cristiano

Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Thomas Davie
On 14 Jul 2009, at 13:48, Duncan Coutts wrote: On Tue, 2009-07-14 at 03:01 -0700, Michael Vanier wrote: Charles, Haskell is a wonderful language (my favorite language by far) but it is pretty difficult for a beginner. In fact, it is pretty difficult for anyone to learn in my experience,

Re: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Don Stewart
patai_gergely: Hello all, I was asked to give a one-hour 'introductory' seminar on Haskell. The audience is a bunch of very clever people with a wider than usual perspective on programming and mathematics, and my talk should be rather informational than evangelistic. Which topics do you

Re: Re[2]: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Patai Gergely
I would concentrate on the fact that when you use Haskell, you write code that is less prone to errors and bugs. When you write a program in Haskell and it finally compiles, chances are that there are far less bugs than in a program written in another language the question is how to

Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Jake McArthur
Michael Vanier wrote: Haskell is a wonderful language (my favorite language by far) but it is pretty difficult for a beginner. In fact, it is pretty difficult for anyone to learn in my experience, because it has so many advanced concepts that simply don't exist in other languages, and trying

Re: Re[2]: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Matthias Görgens
Dear Gergely, Okasaki's Purely Functional Data Structures is a treasure trove of interesting things to demonstrate Haskell on. Especially the data structures based on numerical representations (skew binary numbers and so on) appealed to my mathematical side. Matthias.

Re: Re[2]: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Don Stewart
patai_gergely: I would concentrate on the fact that when you use Haskell, you write code that is less prone to errors and bugs. When you write a program in Haskell and it finally compiles, chances are that there are far less bugs than in a program written in another language the

[Haskell-cafe] Re: AW: Example for formatted show in HStringTemplate

2009-07-14 Thread John MacFarlane
Torsten, I'm not quite sure what you're asking -- but this simple example seems to work fine: Prelude Text.StringTemplate let (a :: StringTemplate String) = newSTMP $day;format=\%d.%b.%Y\$ Prelude Text.StringTemplate Data.Time render $ setAttribute day (ModifiedJulianDay 234) a 09.Jul.1859

Re: [Haskell-cafe] Haskell as a first language?

2009-07-14 Thread Gareth Smith
On Tue, 2009-07-14 at 03:01 -0700, Michael Vanier wrote: Haskell is a wonderful language (my favorite language by far) but it is pretty difficult for a beginner. In fact, it is pretty difficult for anyone to learn in my experience, because it has so many advanced concepts that simply

Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Jeremy Shaw
At Tue, 14 Jul 2009 03:01:44 -0700, Michael Vanier wrote: Haskell is a wonderful language (my favorite language by far) but it is pretty difficult for a beginner. In fact, it is pretty difficult for anyone to learn in my experience, because it has so many advanced concepts that simply

[Haskell-cafe] Re: Goldman Sachs - your home for OCaml and Erlang?

2009-07-14 Thread Ahn, Ki Yung
Max Cantor wrote: I know that this is a bit off topic, but thought it would interest several readers. Apparently, GS, which. AFAIK, doesn't make a lot of noise in the FP space compared to some other banks, does use some FP: http://www.zerohedge.com/article/aleynikov-code-dump-uncovered The

[Haskell-cafe] Re: Haskell as a first language?

2009-07-14 Thread Ahn, Ki Yung
Before teaching any data structure course, one MUST learn functional languages with ADTs. It makes everything so easy to understand. So, it MUST be a first language in every institution. The biggest reason that one should learn functional languages with algebraic data type(ADT)s first is

Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Matthias Görgens
It maybe be that Haskell is harder to learn as your *second* language because you have to unlearn things. Especially if your first language was something like C or Python. Python is not too bad. You can nearly use it a as a strict functional programming language. While this is not the

[Haskell-cafe] Circular pure data structures?

2009-07-14 Thread John Ky
Hello, Is it possible to create a circular pure data structure in Haskell? For example: a :: Data let b = getNext a let c = getNext b c == a -- Gives True Thanks, -John ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Build 32-bit apps on 64-bit Windows?

2009-07-14 Thread Lyle Kopnicky
If I am running GHC on 64-bit Windows, do I have a choice of building a 32-bit or 64-bit app? On a cursory glance through the command-line options, I didn't find anything. - Lyle ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Circular pure data structures?

2009-07-14 Thread Brandon S. Allbery KF8NH
On Jul 14, 2009, at 18:27 , John Ky wrote: Is it possible to create a circular pure data structure in Haskell? For example: http://haskell.org/haskellwiki/Tying_the_knot -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com system administrator [openafs,heimdal,too

Re: [Haskell-cafe] Circular pure data structures?

2009-07-14 Thread Ross Mellgren
Yes, using lazy semantics. http://www.haskell.org/haskellwiki/Tying_the_Knot -Ross On Jul 14, 2009, at 6:27 PM, John Ky wrote: Hello, Is it possible to create a circular pure data structure in Haskell? For example: a :: Data let b = getNext a let c = getNext b c == a -- Gives True

Re: [Haskell-cafe] Circular pure data structures?

2009-07-14 Thread Felipe Lessa
On Wed, Jul 15, 2009 at 08:27:04AM +1000, John Ky wrote: a :: Data let b = getNext a let c = getNext b c == a -- Gives True What do you mean? This works type Data = () getNext = id but I guess this is not what you meant ;). -- Felipe.

Re: [Haskell-cafe] Circular pure data structures?

2009-07-14 Thread John Dorsey
John, Is it possible to create a circular pure data structure in Haskell? For example: Creating the data structure is easy; as other respondents have pointed out. A simple example is this... ones = 1 : ones ones' = 1 : ones' Comparing these values is harder. All of (ones), (ones'), (tail

Re: [Haskell-cafe] How to Read this?

2009-07-14 Thread Gwern Branwen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Tue, Jul 14, 2009 at 1:49 AM, Magicloud Magiclouds wrote: Hi, I have a data structure, which shows like this: AttrBgColor {bgColor = Color 0 0 0} And the following is my Read code. But it failed parsing 31 instance Read Attribute

[Haskell-cafe] laziness blowup exercise

2009-07-14 Thread Thomas Hartman
Challenge: change one function in the following pipeline so that t doesn't blow up when executed in ghci. import qualified Data.Set as S t = last . take (10^6) . iterate f $ S.empty f s = S.delete 1 . S.insert 1 $ s Please suggest more of these types of exercises if you have them and maybe we

[Haskell-cafe] Re: iteratee enumHandle (and parsing)

2009-07-14 Thread John Lato
Hello, This explanation is entirely correct. I'm not happy with this situation, because I think it's confusing for people just starting with iteratee. However, I do want something that will be unicode (and other possible encodings) aware. Currently, I'm waiting to see how unicode support in

Re: [Haskell-cafe] Circular pure data structures?

2009-07-14 Thread wren ng thornton
John Dorsey wrote: John, Is it possible to create a circular pure data structure in Haskell? For example: Creating the data structure is easy; as other respondents have pointed out. A simple example is this... ones = 1 : ones ones' = 1 : ones' Comparing these values is harder. All of

Re: [Haskell-cafe] ANN: AC-Vector, AC-Colour and AC-EasyRaster-GTK

2009-07-14 Thread Richard O'Keefe
On Jul 10, 2009, at 8:44 PM, Wolfgang Jeltsch wrote: Am Freitag, 10. Juli 2009 05:26 schrieb rocon...@theorem.ca: I find it amazing that you independently chose to spell colour with a `u'. It makes me feel better about my choice. I have to admit that it makes me unhappy. :-( Why do we

Re: [Haskell-cafe] Leaner Haskell.org frontpage

2009-07-14 Thread Richard O'Keefe
On Jul 10, 2009, at 6:14 PM, Thomas Davie wrote: In my mind, the front page is for nothing more than enticing people to use Haskell for long enough to look at a second page where all the useful stuff is if you are a haskell programmer. I would have thought that a web page should serve its

Re: [Haskell-cafe] Circular pure data structures?

2009-07-14 Thread John Ky
Hello, Actually, I wanted to be able to create a tree structure when I can navigate both leaf-ward and root-ward. I didn't actually care for equality. I think the tying the knot technique as mentioned by others is sufficient for this purpose. Cheers, -John On Wed, Jul 15, 2009 at 8:55 AM,

Re: [Haskell-cafe] Circular pure data structures?

2009-07-14 Thread Miguel Mitrofanov
Sufficient, but not good. Try zippers instead. On 15 Jul 2009, at 08:29, John Ky wrote: Hello, Actually, I wanted to be able to create a tree structure when I can navigate both leaf-ward and root-ward. I didn't actually care for equality. I think the tying the knot technique as

Re: [Haskell-cafe] Circular pure data structures?

2009-07-14 Thread John Ky
Hello, If I use zippers, do all my nodes need to be the same type? My tree doesn't have the same type for every node. For example: Modules - Module - Types - Type - Members - Member - Type - ... Thanks -John On Wed, Jul 15, 2009 at 2:41 PM, Miguel Mitrofanov miguelim...@yandex.ruwrote:

Re: [Haskell-cafe] Circular pure data structures?

2009-07-14 Thread Eugene Kirpichov
Zippers come up as the derivative of the type; if you haven't yet encountered this trick, then first find it :) Try differentiating your datastructure. 2009/7/15 John Ky newho...@gmail.com: Hello, If I use zippers, do all my nodes need to be the same type?  My tree doesn't have the same type

Re: [Haskell-cafe] Circular pure data structures?

2009-07-14 Thread Antoine Latter
On Wed, Jul 15, 2009 at 12:13 AM, Eugene Kirpichovekirpic...@gmail.com wrote: Zippers come up as the derivative of the type; if you haven't yet encountered this trick, then first find it :) Try differentiating your datastructure. Here's a paper with a good introduction to the concept and

[Haskell-cafe] Re: [Haskell] Re: 20 years ago

2009-07-14 Thread Benjamin L . Russell
On Tue, 14 Jul 2009 12:36:02 +0200, Ketil Malde ke...@malde.org wrote: [redirected from hask...@] Benjamin L.Russell dekudekup...@yahoo.com writes: One often amusing outgrowth of this is that FP (OOP) fanatics anthropomorphize their functions (objects). Well, I don't think we do.