Re: [Haskell-cafe] Space usage and CSE in Haskell

2007-07-25 Thread Janis Voigtlaender
Melissa O'Neill wrote: Clearly, simplifying the second version of primes into the first by performing CSE actually makes the code much *worse*. This CSE- makes-it-worse property strikes me as interesting. So, is it interesting...? Has anyone worked on characterizing CSE space leaks (and

Re: [Haskell-cafe] Space usage and CSE in Haskell

2007-07-25 Thread Melissa O'Neill
I wrote: This CSE-makes-it-worse property strikes me as interesting. Has anyone worked on characterizing CSE space leaks (and avoiding CSE in those cases)? and Simon replied: You might find chapter 23 The pragmatics of graph reduction in my 1987 book worth a look. It gives other

[Haskell-cafe] Re: partitions of a multiset

2007-07-25 Thread DavidA
It seems to me (unless I've missed something?) that this method generates the power set of the original multiset (i.e. all subsets) rather than partitions.  Oops, sorry, wasn't concentrating. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] NDP documentation

2007-07-25 Thread Manuel M T Chakravarty
Andrew, Actually, I was just reading through all the Data Parallel Haskell and Nested Data Parallelism documentation. It says in several places that parallel array comprehensions are available since GHC 6.6, but they are broken; please use the development versions; this will be fixed in GHC

[Haskell-cafe] Re: [Haskell] View patterns in GHC: Request for feedback

2007-07-25 Thread apfelmus
Jules Bean wrote: Have you tried using pattern guards for views? f s | y : ys - viewl s = | EmptyL - viewl s = Hm, I'd simply use a plain old case-expression here f s = case viewl s of y : ys - ... EmptyL - ... In other words, case-expressions are as powerful as

Re: [Haskell-cafe] Re: [Haskell] View patterns in GHC: Request for feedback

2007-07-25 Thread Jules Bean
apfelmus wrote: IMHO, the long-time debate about views is not whether they're useful (I think they are!) but which concrete form to choose. Unfortunately, all of the proposals so far are somehow like Dr. Jekyll and Mr. Hyde: one side is nice but the other is rather ugly. In the end, I might end

Re: [Haskell-cafe] GHC and GLUT

2007-07-25 Thread Marc A. Ziegert
to replace only libglut.so is not enough. if i understand you correctly, you changed the backend without the API. (you need .h at compiletime, .a (an archive of .o files) when you link everything to an executable, and .so at runtime.) my libglut installation comes with... /usr/lib/libglut.a

[Haskell-cafe] [meta] the haskell wiki management

2007-07-25 Thread Andrea Rossato
Hi, this is what happened to me recently. Recently I had the opportunity to join the community around XMonad, a project, you should know something about it, led by some well know haskellers. It's a very exiting project, and by joining it you have the opportunity to code with people who know

Re: [Haskell-cafe] [meta] the haskell wiki management

2007-07-25 Thread Neil Mitchell
Hi Andrea, I though that using the Haskell wiki was appropriate, so I started writing down what I learned thanks to those guys. It is certainly a good place to put it! Then suddenly, Sunday night, I could not find my page anymore. On renaming a page, doesn't a redirect get placed from the

Re: [Haskell-cafe] snoc vs cons

2007-07-25 Thread Conor McBride
Hi folks Scary word warning: Monoid, Monad, Applicative, Traversable, Context, Cursor Eric: Does anyone know of a good article which discusses snoc vs cons lists? Derek: There's no reason to; there is no difference between a snoc list and a cons list. There's no technical reason to,

Re: [Haskell-cafe] [meta] the haskell wiki management

2007-07-25 Thread Andrea Rossato
On Wed, Jul 25, 2007 at 11:14:59AM +0100, Neil Mitchell wrote: You know, changing a wiki page title means breaking all links to that page from other sites. So, changing an old page title, means taking that page off the Net. Not if the redirect is done, certainly wikipedia does this. I

Re: [Haskell-cafe] [meta] the haskell wiki management

2007-07-25 Thread Andrea Rossato
On Wed, Jul 25, 2007 at 11:14:59AM +0100, Neil Mitchell wrote: You know, changing a wiki page title means breaking all links to that page from other sites. So, changing an old page title, means taking that page off the Net. Not if the redirect is done, certainly wikipedia does this.

Re: [Haskell-cafe] Re: [Haskell] View patterns in GHC: Request for feedback

2007-07-25 Thread Conor McBride
Hi Ok, I'm not quite under my rock yet,,, On 25 Jul 2007, at 10:28, apfelmus wrote: Jules Bean wrote: Have you tried using pattern guards for views? f s | y : ys - viewl s = | EmptyL - viewl s = This is annoying because the intermediate computation gets repeated. I don't

[Haskell-cafe] Re: [Haskell] View patterns in GHC: Request for feedback

2007-07-25 Thread Benjamin Franksen
apfelmus wrote: Jules Bean wrote: Have you tried using pattern guards for views? f s | y : ys - viewl s = | EmptyL - viewl s = Hm, I'd simply use a plain old case-expression here f s = case viewl s of y : ys - ... EmptyL - ... In other words,

[Haskell-cafe] Re: [Haskell] View patterns in GHC: Request for feedback

2007-07-25 Thread Dan Licata
[I think we should move the rest of this thread to haskell-cafe, since it's getting long. Note that there have already been some responses on both lists.] Hi Claus, On Jul25, Claus Reinke wrote: I think that the signature type Typ unit :: Typ - Maybe () arrow :: Type - Maybe

Re: [Haskell-cafe] GHC 6.6.1: Where is Graphics.SOE ?

2007-07-25 Thread Dmitri O.Kondratiev
Thanks! I just tried a new pre-built version (http://haskell.org/gtk2hs /gtk2hs-0.9.11.3.exe) and at least this simple prog. works in GHCi: module GWindow where import Graphics.SOE.Gtk main() = runGraphics ( do w - openWindow Graphics Test (300, 300)

Re[4]: [Haskell-cafe] i need wxHaskell compiled for ghc 6.6.1 on Windows

2007-07-25 Thread Bulat Ziganshin
Hello shelarcy, Tuesday, July 24, 2007, 2:32:01 AM, you wrote: So I put newer Windows binary on my project's file space. http://sourceforge.net/project/showfiles.php?group_id=168626 thank you very much!!! now i'm really happy - it works without any problems. the only question that remains -

Re[4]: [Haskell-cafe] i need wxHaskell compiled for ghc 6.6.1 on Windows

2007-07-25 Thread Bulat Ziganshin
Hello Duncan, Monday, July 23, 2007, 4:02:42 AM, you wrote: i've taken a look at gtk2hs, but 2 reasons forced me to give wxHaskell a try: - native appearance I think that's pretty good these days, the native theme on Windows has been getting better and better from Gtk+ 2.6 to the current

[Haskell-cafe] upgrading Text.Printf

2007-07-25 Thread Benjamin Franksen
Hi, I am using Text.Printf (package base, ghc-6.6.1) and am missing %X formatting. Checking out the darcs repo of the base package I see that it has already been added there. Is there any way to upgrade to the latest version while keeping ghc-6.6.1? I keep hearing Bulat saying that this is not

Re: [Haskell-cafe] Re: [Haskell] View patterns in GHC: Request forfeedback

2007-07-25 Thread Claus Reinke
Hi Dan, No, of course not. All I meant to say is that sometimes you want a total view, and that a total view should be given a type that says as much. The latter says this better than the former. On the other hand, there are lots of circumstances in which you want a partial view, and I think

Re: Re[4]: [Haskell-cafe] i need wxHaskell compiled for ghc 6.6.1 on Windows

2007-07-25 Thread Duncan Coutts
On Wed, 2007-07-25 at 16:57 +0400, Bulat Ziganshin wrote: Hello Duncan, Monday, July 23, 2007, 4:02:42 AM, you wrote: i've taken a look at gtk2hs, but 2 reasons forced me to give wxHaskell a try: - native appearance I think that's pretty good these days, the native theme on

Re: Re[4]: [Haskell-cafe] i need wxHaskell compiled for ghc 6.6.1 on Windows

2007-07-25 Thread Neil Mitchell
Hi There's really no such thing as Windows native controls any more, at least not ones that any apps actually use. You'll note that Internet Explorer, MS Office and VisualStudio all paint their own custom control set that are similar but not exactly the same as the native controls (eg those

Re: [Haskell-cafe] Re: [Haskell] View patterns in GHC: Request for feedback

2007-07-25 Thread Dan Licata
Hi Conor, This is a really good point, especially in the presence of GADTs and type-level functions and so on, which introduce aspects of dependency. Why are you so fatalistic about with in Haskell? Is it harder to implement than it looks? It seems to be roughly in the same category as our view

Re: Re[4]: [Haskell-cafe] i need wxHaskell compiled for ghc 6.6.1 on Windows

2007-07-25 Thread Duncan Coutts
On Wed, 2007-07-25 at 14:58 +0100, Neil Mitchell wrote: Hi There's really no such thing as Windows native controls any more, at least not ones that any apps actually use. You'll note that Internet Explorer, MS Office and VisualStudio all paint their own custom control set that are

Re: Re[6]: [Haskell-cafe] i need wxHaskell compiled for ghc 6.6.1 on Windows

2007-07-25 Thread Neil Mitchell
Hi Bulat, can you please give screenshots? in particular, i see unix-like style in TreeCtrl and scrollbars in examples i've built from gtk2hs. The scroll bars are OK: http://www-users.cs.york.ac.uk/~ndm/temp/proof.png The appearance is native, but the arrow on the left shouldn't be disabled

Re[6]: [Haskell-cafe] i need wxHaskell compiled for ghc 6.6.1 on Windows

2007-07-25 Thread Bulat Ziganshin
Hello Duncan, Wednesday, July 25, 2007, 5:54:13 PM, you wrote: afaiu, GTK paints all controls itself without using native controls and therefore controls look at Windows just the same as in Unix Gtk+ uses themes too, and on Windows it uses a Windows theme. can you please give screenshots?

[Haskell-cafe] Re: [Haskell] View patterns in GHC: Request for feedback

2007-07-25 Thread apfelmus
Benjamin Franksen wrote: apfelmus wrote: In other words, case-expressions are as powerful as any view pattern may be in the single-parameter + no-nesting case. This is how I do it, no pattern guards, no view patterns: zip :: Seq a - Seq b - Seq (a,b) zip xs ys = case (viewl xs,viewl ys)

Re: [Haskell-cafe] GHC and GLUT

2007-07-25 Thread Paul L
Thanks for the info. I indeed replaced everything, but it only works after I recompile Graphics.UI.GLUT module. Regards, Paul L On 7/25/07, Marc A. Ziegert [EMAIL PROTECTED] wrote: to replace only libglut.so is not enough. if i understand you correctly, you changed the backend without the

[Haskell-cafe] Re: [Haskell] View patterns in GHC: Request for feedback

2007-07-25 Thread Jon Fairbairn
Simon Marlow [EMAIL PROTECTED] writes: Dan Licata wrote: Simon PJ and I are implementing view patterns, a way of pattern matching against abstract datatypes, in GHC. At the risk of being a spoil-sport, I have a somewhat negative take on view patterns. Not because I think they're

[Haskell-cafe] how to see operators precedence in GHCi

2007-07-25 Thread Bulat Ziganshin
Hello , from http://community.livejournal.com/ru_declarative/54566.html Q: how to see operators precedence in GHCi? A: Prelude let showParen = (undefined::()-()) Prelude showParen $ 2+3*4 interactive:1:12: No instance for (Num ()) arising from use of `+' at

[Haskell-cafe] Re: how to see operators precedence in GHCi

2007-07-25 Thread Jon Fairbairn
Bulat Ziganshin [EMAIL PROTECTED] writes: Hello , from http://community.livejournal.com/ru_declarative/54566.html Q: how to see operators precedence in GHCi? A: Prelude let showParen = (undefined::()-()) Prelude showParen $ 2+3*4 interactive:1:12: No instance for (Num

Re: [Haskell-cafe] Re: [Haskell] View patterns in GHC: Request for feedback

2007-07-25 Thread Dan Licata
On Jul25, apfelmus wrote: The point is to be able to define both zip and pairs with one and the same operator : . There's actually a quite simple way of doing this. You make the view type polymorphic, but not in the way you did: type Queue elt empty :: Queue elt cons :: elt -

Re: [Haskell-cafe] Re: [Haskell] View patterns in GHC: Request for feedback

2007-07-25 Thread Jonathan Cast
On Wednesday 25 July 2007, Jon Fairbairn wrote: Simon Marlow [EMAIL PROTECTED] writes: Dan Licata wrote: Simon PJ and I are implementing view patterns, a way of pattern matching against abstract datatypes, in GHC. At the risk of being a spoil-sport, I have a somewhat negative take

Re: [Haskell-cafe] snoc vs cons

2007-07-25 Thread Derek Elkins
On Wed, 2007-07-25 at 11:37 +0100, Conor McBride wrote: Hi folks Scary word warning: Monoid, Monad, Applicative, Traversable, Context, Cursor Eric: Does anyone know of a good article which discusses snoc vs cons lists? Derek: There's no reason to; there is no difference

Re: [Haskell-cafe] Re: [Haskell] View patterns in GHC: Request for feedback

2007-07-25 Thread Derek Elkins
On Wed, 2007-07-25 at 14:12 +0200, Benjamin Franksen wrote: Cheers Ben, member of the we-want-real-views-or-nothing-at-all movement ;-) Derek, member of the counter-culture, we-don't-want-real-views-but-nothing-at-all-may-suffice movement. ___

[Haskell-cafe] Re: Re: [Haskell] View patterns in GHC: Request for feedback

2007-07-25 Thread Benjamin Franksen
Dan Licata wrote: On Jul25, apfelmus wrote: The point is to be able to define both zip and pairs with one and the same operator : . There's actually a quite simple way of doing this. You make the view type polymorphic, but not in the way you did: type Queue elt empty :: Queue

Re: [Haskell-cafe] Re: how to see operators precedence in GHCi

2007-07-25 Thread Bulat Ziganshin
Hello Jon, Wednesday, July 25, 2007, 8:07:57 PM, you wrote: Q: how to see operators precedence in GHCi? In the definition of `it': it = showParen $ (2 + (3 * 4)) Hmm, OK, but not that much quicker than going Prelude :info (*) it just my poor english :) i mean - how to see how

Re: [Haskell-cafe] HDBC or HSQL

2007-07-25 Thread Duncan Coutts
On Wed, 2007-07-25 at 21:04 +0300, George Moschovitis wrote: Dear devs, I am a Haskell newbie and I would like to hear your suggestions regarding a Database conectivity library: HSQL or HDBC ? which one is better / more actively supported? My impression (as a packager not a user) is

Re: [Haskell-cafe] Another analogy

2007-07-25 Thread Hugh Perkins
* Haskell* is an incredibly elegantly-designed and beautiful car, which is rumored to be able to drive over extremely strange terrain. The one time you tried to drive it, it didn't actually drive along the road; instead, it made copies of itself and the road, with each successive copy of the

Re: [Haskell-cafe] HDBC or HSQL

2007-07-25 Thread Geoffrey Zhu
Hi, I use HSQL with PostgreSQL bindings. It works great and I found it very easy to use. -- Rich I don't mean to hijack the thread. Does anyone have experience in using either HDBC or HSQL with Microsoft SQL server? Thanks, cg ___ Haskell-Cafe

RE: [Haskell-cafe] Re: how to see operators precedence in GHCi

2007-07-25 Thread Simon Peyton-Jones
| Uhm... that didn't work :) | | Not quite as nice: | | [EMAIL PROTECTED]:~$ ghci -ddump-rn-trace You probably wanted -ddump-rn Simon ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: how to see operators precedence in GHCi

2007-07-25 Thread Stefan O'Rear
On Thu, Jul 26, 2007 at 12:42:52AM +0100, Simon Peyton-Jones wrote: | Uhm... that didn't work :) | | Not quite as nice: | | [EMAIL PROTECTED]:~$ ghci -ddump-rn-trace You probably wanted -ddump-rn Seemed so, but that option has no effect (bug?): [EMAIL PROTECTED]:~$ ghci -ddump-rn

Re: [Haskell-cafe] Space usage and CSE in Haskell

2007-07-25 Thread ok
On 25 Jul 2007, at 6:50 pm, Melissa O'Neill wrote: [section 23.4.2 of Simon's 1987 book]. The really scary thing about this example is that so much depends on the order in which the subsets are returned, which in many cases does not matter. Here's code that I tried with GHC on a 500MHz SPARC.

[Haskell-cafe] Re: Compile-time here document facility

2007-07-25 Thread Dave Bayer
Donald Bruce Stewart dons at cse.unsw.edu.au writes: bayer: I couldn't find a compile-time here document facility, so I wrote one using Template Haskell: Very nice! You should wrap it in a little .cabal file, and upload it to hackage.haskell.org, so we don't forget about it. Details

Re: [Haskell-cafe] Re: [Haskell] View patterns in GHC: Request for feedback

2007-07-25 Thread Stefan O'Rear
On Wed, Jul 25, 2007 at 09:35:32PM +0200, apfelmus wrote: Integer = (forall a . ViewInt a = a) can even be done implicitly and for all types. Together with the magic class View, this would give real views. Jón Fairbairn wrote: It's essential to this idea that it doesn't involve

Re: [Haskell-cafe] HDBC or HSQL

2007-07-25 Thread jeff p
Hello, I don't mean to hijack the thread. Does anyone have experience in using either HDBC or HSQL with Microsoft SQL server? I use HDBC with MS SQL Server, Sybase, and Oracle. I use the ODBC bindings. I am running on both a windows XP machine and a linux machine (although I haven't been able

Re: [Haskell-cafe] Re: Compile-time here document facility

2007-07-25 Thread Brandon S. Allbery KF8NH
On Jul 25, 2007, at 19:15 , Dave Bayer wrote: A here document is a kind of data, but it is really a language extension, and one that depends on a GHC extension, Template Haskell. I'd go for Data.HereDocs but that doesn't seem quite right. The newbie in me doesn't want to park my car

Re: [Haskell-cafe] Polymorphic variants

2007-07-25 Thread Josef Svenningsson
On 7/26/07, Jon Harrop [EMAIL PROTECTED] wrote: Does Haskell have anything similar to OCaml's polymorphic variants? No as such, but it's possible to simulate them. As always Oleg was the one to demonstrate how: http://okmij.org/ftp/Haskell/generics.html Cheers, Josef

[Haskell-cafe] ANN: Finance.Quote.Yahoo-0.2

2007-07-25 Thread brad clawsie
i have released Finance.Quote.Yahoo 0.2 i have broken the 0.1 api, be careful if you use it i have added support for historical quotes which some people requested http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Finance-Quote-Yahoo-0.2 i received useful input from dale jordan and

Re: [Haskell-cafe] UTF-16

2007-07-25 Thread Donald Bruce Stewart
andrewcoppin: I don't know if anybody cares, but... Today a wrote some trivial code to decode (not encode) UTF-16. I believe somebody out there has a UTF-8 decoder, but I needed UTF-16 as it happens. (I didn't bother decoding code points outside the BMP - I'm sure you can figure out

Re: [Haskell-cafe] UTF-16

2007-07-25 Thread Colin Paul Adams
Andrew == Andrew Coppin [EMAIL PROTECTED] writes: Andrew I believe somebody out there has a UTF-8 decoder, but I Andrew needed UTF-16 as it happens. (I didn't bother decoding Andrew code points outside the BMP - I'm sure you can figure out Andrew why.) Well I can't. And if you

[Haskell-cafe] UTF-16

2007-07-25 Thread Andrew Coppin
I don't know if anybody cares, but... Today a wrote some trivial code to decode (not encode) UTF-16. I believe somebody out there has a UTF-8 decoder, but I needed UTF-16 as it happens. (I didn't bother decoding code points outside the BMP - I'm sure you can figure out why.) If anybody is

[Haskell-cafe] Re: upgrading Text.Printf

2007-07-25 Thread Benjamin Franksen
Ian Lynagh wrote: On Wed, Jul 25, 2007 at 03:38:50PM +0200, Benjamin Franksen wrote: I am using Text.Printf (package base, ghc-6.6.1) and am missing %X formatting. Checking out the darcs repo of the base package I see that it has already been added there. Is there any way to upgrade to the

Re: [Haskell-cafe] Printing the function result

2007-07-25 Thread Alexteslin
Thank you guys, i didn't understand the concept of the chapter. Brent Yorgey wrote: On 7/25/07, Alexteslin [EMAIL PROTECTED] wrote: Hi, I am going through examples from the textbook and trying them out but some don't work. For example: addNum :: Int - (Int - Int) addNum n = addN

Re: [Haskell-cafe] HDBC or HSQL

2007-07-25 Thread jeff p
Hello, Would you go as far to say that when new programmers ask which database binding to use, we should _recommend_ HDBC then? (As we do gtk2hs, for the gui libraries). I'm not sure about this. Although I didn't extensively compare HSQL and HDBC, I got the impression that they offered

[Haskell-cafe] Re: [Haskell] View patterns in GHC: Request for feedback

2007-07-25 Thread apfelmus
Dan Licata wrote: There's actually a quite simple way of doing this. You make the view type polymorphic, but not in the way you did: myzip :: Queue a - Queue b - Queue (a,b) myzip a b = case (view a, view b) of (EmptyL, _) - empty (_, EmptyL) - empty

Re: [Haskell-cafe] NDP documentation

2007-07-25 Thread Andrew Coppin
Bulat Ziganshin wrote: Hello Andrew, Monday, July 23, 2007, 11:50:32 PM, you wrote: Actually, I was just reading through all the Data Parallel Haskell and Nested Data Parallelism documentation. It says in several places that parallel array comprehensions are available since GHC 6.6, but

Re: [Haskell-cafe] Re: Re: [Haskell] View patterns in GHC: Request for feedback

2007-07-25 Thread Dan Licata
On Jul25, Benjamin Franksen wrote: Dan Licata wrote: On Jul25, apfelmus wrote: The point is to be able to define both zip and pairs with one and the same operator : . There's actually a quite simple way of doing this. You make the view type polymorphic, but not in the way you

Re: [Haskell-cafe] HDBC or HSQL

2007-07-25 Thread david48
On 7/25/07, George Moschovitis [EMAIL PROTECTED] wrote: I am a Haskell newbie and I would like to hear your suggestions regarding a Database conectivity library: HSQL or HDBC ? which one is better / more actively supported? HDBC Supports Mysql only through ODBC :(

[Haskell-cafe] HDBC or HSQL

2007-07-25 Thread George Moschovitis
Dear devs, I am a Haskell newbie and I would like to hear your suggestions regarding a Database conectivity library: HSQL or HDBC ? which one is better / more actively supported? thanks in advance, -g. -- http://phidz.com http://blog.gmosx.com http://cull.gr http://www.joy.gr

Re: [Haskell-cafe] Re: how to see operators precedence in GHCi

2007-07-25 Thread Stefan O'Rear
On Wed, Jul 25, 2007 at 10:55:56AM -0700, Stefan O'Rear wrote: On Wed, Jul 25, 2007 at 09:35:38PM +0400, Bulat Ziganshin wrote: Hello Jon, Wednesday, July 25, 2007, 8:07:57 PM, you wrote: Q: how to see operators precedence in GHCi? In the definition of `it': it = showParen $ (2 +

Re: [Haskell-cafe] filterFirst

2007-07-25 Thread Alexteslin
Thank you Dan Dan Weston wrote: If you find it tedious to pass parameters that never change, remember that you can access symbols defined in the enclosing environment (closure), freeing you from passing it on each time: filterAlpha :: (a - Bool) - [a] - [a] filterAlpha f =

Re: [Haskell-cafe] Printing the function result

2007-07-25 Thread Brent Yorgey
On 7/25/07, Alexteslin [EMAIL PROTECTED] wrote: Hi, I am going through examples from the textbook and trying them out but some don't work. For example: addNum :: Int - (Int - Int) addNum n = addN where addN m = n+m This error message i am getting: ERROR - Cannot find show

Re: [Haskell-cafe] Printing the function result

2007-07-25 Thread Stefan O'Rear
On Wed, Jul 25, 2007 at 11:27:59AM -0700, Alexteslin wrote: Hi, I am going through examples from the textbook and trying them out but some don't work. For example: addNum :: Int - (Int - Int) addNum n = addN where addN m = n+m This error message i am getting: ERROR

Re: [Haskell-cafe] HDBC or HSQL

2007-07-25 Thread Donald Bruce Stewart
mutjida: Hello, Would you go as far to say that when new programmers ask which database binding to use, we should _recommend_ HDBC then? (As we do gtk2hs, for the gui libraries). At this point in time, my advice to new Haskell programmers would be: first try Takusen, as long as it can

[Haskell-cafe] expension of fractions

2007-07-25 Thread Tom Pledger
Arie Groeneveld wrote: : | Looking at the result of my rewriting gives me the idea it isn't | Haskelly enough. | | Anyways, here's my interpretation: | | -- period m/n base = (period length, preperiod digits, period digits) | period :: Integer - Integer - Integer - (Int, ([Integer],

[Haskell-cafe] Polymorphic variants

2007-07-25 Thread Jon Harrop
Does Haskell have anything similar to OCaml's polymorphic variants? They act as inferred sum types: # let rec eval = function | `Int n - n | `Add(f, g) - eval f + eval g | `Mul(f, g) - eval f * eval g;; val eval : ([ `Add of 'a * 'a | `Int of int | `Mul of 'a * 'a ] as 'a) - int =