Re: [Haskell-cafe] Dealing with heterogeneously-typed lists?

2008-08-13 Thread Thomas Davie
On 13 Aug 2008, at 00:44, Leif Warner wrote: Hi all, I'm dealing with some datatype, say: data Invoice = Invoice { invoiceNum:: String, dollarAmt :: Currency, printDate :: Date, dueDate :: Date,

Re: [Haskell-cafe] Cyclic Inclusions

2008-08-13 Thread Thomas Davie
On 13 Aug 2008, at 05:06, [EMAIL PROTECTED] wrote: G'day all. Quoting Thomas Davie [EMAIL PROTECTED]: Why is separate compilation important? I'm a little shocked that anyone on this list should have to ask this question. Two people have asked it now. The simplest answer is that unless

Re: [Haskell-cafe] Cyclic Inclusions

2008-08-13 Thread Thomas Davie
On 13 Aug 2008, at 11:10, Henning Thielemann wrote: On Wed, 13 Aug 2008, Thomas Davie wrote: On 13 Aug 2008, at 05:06, [EMAIL PROTECTED] wrote: Quoting Thomas Davie [EMAIL PROTECTED]: Why is separate compilation important? I'm a little shocked that anyone on this list should have to ask

Re: [Haskell-cafe] Cyclic Inclusions

2008-08-13 Thread Thomas Davie
On 13 Aug 2008, at 13:18, [EMAIL PROTECTED] wrote: G'day all. Quoting Thomas Davie [EMAIL PROTECTED]: To be honest, ghc compiles things so fast (at least on any of my systems) that I couldn't care less if it took 10 times as long (I would however like some added convenience for that time

Re: [Haskell-cafe] GLfloat on a Mac

2008-08-12 Thread Thomas Davie
On 12 Aug 2008, at 11:11, Conor McBride wrote: Hi folks I thought I'd try a bit of OpenGL. Perhaps I should send this to the more specific list, but perhaps other people are, like me, trying out a variety of UI technology. I thought I'd give OpenGL a go, because I saw the name whizz by when I

Re: [Haskell-cafe] Cyclic Inclusions

2008-08-12 Thread Thomas Davie
On 12 Aug 2008, at 11:59, C.M.Brown wrote: Andrew, Thanks very much for your reponse. It was very helpful; this makes a lot of sense! And yes, some people think that this is a bug in the specification. I'm not sure that it does make a lot of sense -- we allow (mutually) recursive

Re: [Haskell-cafe] Cyclic Inclusions

2008-08-12 Thread Thomas Davie
On 12 Aug 2008, at 16:01, [EMAIL PROTECTED] wrote: G'day all. Quoting Thomas Davie [EMAIL PROTECTED]: I'm not sure that it does make a lot of sense -- we allow (mutually) recursive functions, even though they come with an efficiency penalty. Why should we not allow (mutually) recursive

Re: [Haskell-cafe] GLfloat on a Mac

2008-08-12 Thread Thomas Davie
On 12 Aug 2008, at 16:55, Conor McBride wrote: On 12 Aug 2008, at 11:27, Conor McBride wrote: On 12 Aug 2008, at 11:19, Jules Bean wrote: FWIW, I use ghc on my G4 and I got it by compiling from MacPorts. It took the best part of day, but the resulting binary works. I'm not sure

[Haskell-cafe] Lambdabot

2008-08-11 Thread Thomas Davie
I've been trying to lambdabot running properly recently, and have consistently hit an error fd:6: hClose: resource vanished (Broken pipe) whenever I try to run anything that involves executing haskell (including but not limited to evaluating arbitrary expressions, the brainfuck module,

Re: [Haskell-cafe] Analysing Haskell Program

2008-08-01 Thread Thomas Davie
On 1 Aug 2008, at 16:01, Roberto D'Aprile wrote: Hello to everybody I'm using haskell for some research work and now i need to evaluate the performance of some simple haskell programs in particular information on the like, CPU cycles, bus usage, memory access and so on; so i wish to

Re: [Haskell-cafe] Data.Derive problems

2008-07-10 Thread Thomas Davie
On 10 Jul 2008, at 21:25, Ron Alford wrote: On Thu, Jul 10, 2008 at 3:18 PM, Neil Mitchell [EMAIL PROTECTED] wrote: Hi Ron, I'm using GHC 6.8.3 with $ cabal --version cabal-install version 0.5.1 using version 1.4.0.1 of the Cabal library I installed Data.Derive from hackage, only to be

Re: [Haskell-cafe] Qualified import syntax badly designed (?)

2008-07-09 Thread Thomas Davie
I think a better design for namespacing might be: import Data.Map as M implicit (Map) import Data.Map as M explicit (lookup) Why 'implicit' and 'explicit'? Do you mean something like 'include' and 'exclude'? To me at least, implicit and explicit make more sense. I don't want to exclude

Re: [Haskell-cafe] Re: How to do this in FP way?

2008-06-16 Thread Thomas Davie
One half of all Haskell coders will tell you that mutable state isn't a good starting point to learn Haskell, the other half will tell you the same because they want to be cool kids, too. And the one left over will point out that he asked how to do this the FP way, not the imperative way?

Re: [Haskell-cafe] Re: How to do this in FP way?

2008-06-16 Thread Thomas Davie
On 16 Jun 2008, at 18:28, Achim Schneider wrote: Thomas Davie [EMAIL PROTECTED] wrote: One half of all Haskell coders will tell you that mutable state isn't a good starting point to learn Haskell, the other half will tell you the same because they want to be cool kids, too. And the one

Re: [Haskell-cafe] Re: How to do this in FP way?

2008-06-16 Thread Thomas Davie
On 16 Jun 2008, at 19:24, Achim Schneider wrote: Thomas Davie [EMAIL PROTECTED] wrote: On 16 Jun 2008, at 18:28, Achim Schneider wrote: Thomas Davie [EMAIL PROTECTED] wrote: One half of all Haskell coders will tell you that mutable state isn't a good starting point to learn Haskell

Re: [Haskell-cafe] ANN: Topkata

2008-06-15 Thread Thomas Davie
On 15 Jun 2008, at 07:41, Deborah Goldsmith wrote: On Jun 14, 2008, at 1:06 PM, Don Stewart wrote: tom.davie: In the mean time -- who knows enough to make ghc target ARM, and get this to link against the iPhone libraries? This would be quite a coup if it could be made to run there! I'd

Re: [Haskell-cafe] ANN: Topkata

2008-06-14 Thread Thomas Davie
On 14 Jun 2008, at 12:45, Christoph Bauer wrote: Hi All, Topkata is a simple OpenGL Game written in Haskell. It's not very advanced. Goal so far is to guide a ball trough an labyrinth to the opposite corner. The web page shows an screenshot. It's only tested under Linux.

Re: [Haskell-cafe] automatically deriving Map and Filter on datatypes etc.

2008-06-05 Thread Thomas Davie
Even deriving an instance of Functor seems rather implausable, what should it do for data Wierd a b = Nil | A a (Wierd a b) | B b (Wierd a b) Should fmap's function argument operate on 'a's, 'b's, or both? Bob On 5 Jun 2008, at 10:28, Miguel Mitrofanov wrote: Well, it's certainly not

Re: [Haskell-cafe] modelling C in Haskell ..

2008-05-30 Thread Thomas Davie
Yes, you must write them seperately as something like data A = A Int B data B = B1 Int | B2 Int Int one of the many wonders of Haskell -- it encourages you to split up your code into nice small chunks. Bob On 30 May 2008, at 08:46, Galchin, Vasili wrote: Hello, I don't want

Re: [Haskell-cafe] Type Coercion

2008-05-28 Thread Thomas Davie
On 28 May 2008, at 09:34, PR Stanley wrote: Hi (16 :: Float) is a perfectly legitimate statement although I'm surprised that it's allowed in a type strong language such as Haskell. It's a bit like casting in good old C. What's going on here? It's not a coercion -- it happens at compile

Re: [Haskell-cafe] inserting values in a binary tree

2008-05-09 Thread Thomas Davie
On 10 May 2008, at 00:35, PR Stanley wrote: Hi data Ord a = Tree a = Nil | Node (Tree a) a (Tree a) How would one go about inserting a value in a binary search tree of the above description? All you need to do is consider what the trees should look like in the two cases: If I try and

Re: [Haskell-cafe] IO Help

2008-05-08 Thread Thomas Davie
On 8 May 2008, at 16:31, Mark Wallsgrove wrote: Was there? I have been google'ing that problem for ages.. Just one more thing. I have to make a menu system where the user chooses what functionality they want. Because you cannot change a value once it is set I have used recursion so that

Re: [Haskell-cafe] unapplying function definitions?

2008-05-04 Thread Thomas Davie
On 4 May 2008, at 17:33, PR Stanley wrote: Hi What on earth is unapplying function definitions? The following is taken from chapter 13 of the Hutton book: ...when reasoning about programs, function definitions can be both applied from left to right and unapplied from right to left. Well,

Re: [Haskell-cafe] Fw: I have a problem

2008-04-24 Thread Thomas Davie
First, I'd refer you to this list's rules on homework, and what people will or won't answer. Secondly to that though, rather than provide a solution, I'll give you an idea that may lead to you coming up with a solution. First, try and write a function that can test if your first list is

Re: [Haskell-cafe] monadic debugging

2008-04-15 Thread Thomas Davie
On 16 Apr 2008, at 00:04, Bulat Ziganshin wrote: Hello Vasili, Wednesday, April 16, 2008, 2:53:32 AM, you wrote: I have an Linux executable of my Haskell library and test case. I see there are several debuggers, e.g. Buddha, Hat, etc. Which debugger is currently preferred for monadic

Re: [Haskell-cafe] Re: ANN: haskell-src-exts 0.3.2

2008-03-17 Thread Thomas Davie
On 17 Mar 2008, at 23:41, Niklas Broberg wrote: Could this be used to add support for refactoring of source files containing language extensions? Because if I'm correct, the current most popular refactoring solution (I forgot the name) for Haskell does not support extensions. I supppose

Re: [Haskell-cafe] Doubting Haskell

2008-02-22 Thread Thomas Davie
A quick note here. This is a *really* excellent tutorial on a variety of subjects. It shows how monad operators can be used responsibly (to clarify code, not obfuscate it), it shows how chosing a good data structure and a good algorithm can work wonders for your code, and on a simplistic

Re: [Haskell-cafe] Haskell and GUI

2008-01-14 Thread Thomas Davie
There's also the HOC (Haskell Objective-C bridge), which lets you use Apple's Cocoa APIs. Bob On 14 Jan 2008, at 22:09, Torsten Otto wrote: Seeing my woes with FranTk - what else is out there that people use if a (simple) GUI is desired for a Haskell app? Just a few textboxes and a

Re: [Haskell-cafe] [newbie question] Memoization automatic in Haskell?

2008-01-12 Thread Thomas Davie
On 12 Jan 2008, at 23:16, Hugh Perkins wrote: On Jan 12, 2008 10:54 PM, Henning Thielemann [EMAIL PROTECTED] wrote: On Sat, 12 Jan 2008, Hugh Perkins wrote: I guess that Haskell's referential transparence means the answers to the isPerfectSquare will be cached, ie automatically memoized?

Re: [Haskell-cafe] OOP'er with (hopefully) trivial questions.....

2007-12-17 Thread Thomas Davie
On 17 Dec 2007, at 10:46, Nicholls, Mark wrote: I can obviously at a later date add a new class Triangle, and not have to touch any of the above code…. Yes, and you can indeed do a similar thing in Haskell. The natural thing to do here would be to define a type Shape... data Shape =

Re: [Haskell-cafe] OOP'er with (hopefully) trivial questions.....

2007-12-17 Thread Thomas Davie
On 17 Dec 2007, at 11:14, Nicholls, Mark wrote: OK I'll have to digest this and mess about a bitbut can I make an observation at this point If I define Shape like data Shape = Circle Int | Rectangle Int Int | Square Int Isn't this now closed...i.e. the

Re: [Haskell-cafe] OOP'er with (hopefully) trivial questions.....

2007-12-17 Thread Thomas Davie
On 17 Dec 2007, at 12:22, Nicholls, Mark wrote: Ok... Thanks I need to revisit data and newtype to work out what the difference is I think. Beware in doing so -- type, and newtype are not the same either. type creates a type synonim. That is, if I were to declare type Jam = Int then

Re: [Haskell-cafe] Re: Trees

2007-12-03 Thread Thomas Davie
One could alway store a node's depth at each node -- then you must search for u and v, creating a list of what nodes you found at each depth, and finally, simply compare the lists -- O(n) in the depth of u and v. Bob On 3 Dec 2007, at 08:40, apfelmus wrote: Adrian Neumann wrote: data

Re: [Haskell-cafe] New slogan for haskell.org

2007-11-28 Thread Thomas Davie
On 28 Nov 2007, at 13:41, Ian Lynagh wrote: On Wed, Nov 28, 2007 at 09:27:39AM +0100, Thomas Schilling wrote: Sorry, but are you talking of *one* homepage? This can all go into own wiki pages that are aimed at certain audiences, but this really can't all fit on the front page. I'm

Re: [Haskell-cafe] What is the role of $!?

2007-11-28 Thread Thomas Davie
On 29 Nov 2007, at 06:32, PR Stanley wrote: Hi Thanks for the response. JCC: In most languages, if you have some expression E, and when the computer attempts to evaluate E it goes in to an infinite loop, then when the computer attempts to evaluate the expression f(E), it also goes into

Re: [Haskell-cafe] St. Petersburg Game

2007-11-27 Thread Thomas Davie
main = do let b = 0 let c = randomRIO (1,2) until (c == 1) increment b return b This is intended to print the number of consecutive heads (i.e., 2) before the first tail, but I get the following error: ERROR StPetersburg.hs:8 - Type

Re: [Haskell-cafe] New slogan for haskell.org

2007-11-27 Thread Thomas Davie
On 27 Nov 2007, at 14:44, David Menendez wrote: On Nov 26, 2007 1:44 PM, Thomas Davie [EMAIL PROTECTED] wrote: But the point is that this section of the site is the bit that's meant to be an advertisement -- we're trying to encourage people to read more, Are we? I thought Haskell.org

Re: [Haskell-cafe] New slogan for haskell.org

2007-11-26 Thread Thomas Davie
On 26 Nov 2007, at 15:50, Henning Thielemann wrote: On Mon, 26 Nov 2007, Thomas Davie wrote: On 26 Nov 2007, at 15:15, Henning Thielemann wrote: On Thu, 4 Oct 2007, Don Stewart wrote: The Haskell website has the rather strange motivational text: Haskell is a general purpose, purely

Re: [Haskell-cafe] Editor

2007-05-21 Thread Thomas Davie
On 21 May 2007, at 13:04, Rodrigo Queiro wrote: My friend read your email and remarked: How is this guy not embarrassed posting on the internet about not liking vim because he doesn't like editing config files? Two points 1) This guy doesn't like editing config files -- that's his

Re: [Haskell-cafe] The Trivial Monad

2007-05-04 Thread Thomas Davie
On 4 May 2007, at 08:43, Adrian Neumann wrote: However I don't understand the type signatures for bind and fmap. I'd say (and ghci's type inference agrees) that bind and fmap have the type bind:: (a-W b) - W a - W b fmap:: (a-b) - W a - W b They take a function f and something and return

Re: [Haskell-cafe] Usage of . and $

2007-03-07 Thread Thomas Davie
On 7 Mar 2007, at 09:44, Thomas Conway wrote: On 3/7/07, mm [EMAIL PROTECTED] wrote: f . g . h $ x Alternativly, (f . g . h) x will work, too. It always irks me that you don't actually save any horizontal space using $. That is, (e) x has the same number of characters (incl spaces)

Re: [Haskell-cafe] Win32 help please

2007-02-04 Thread Thomas Davie
On 4 Feb 2007, at 17:59, Stefan O'Rear wrote: On Sun, Feb 04, 2007 at 10:42:23PM +1100, John Ky wrote: # hsc2hs mywin32.hsc # ghc -fffi mywin32.hs C:/system/ghc/ghc-6.6/libHSrts.a(Main.o):Main.c:(.text+0x1b): undefined reference to `__stginit_ZCMain'

Re: [Haskell-cafe] Composing functions with runST

2007-01-03 Thread Thomas Davie
It's true that this is the typical way of learning Haskell, but I for one think it's a bad way of learning Haskell. Very few real world programs get by without the impure stuff, so if you give the newbie the impression that it isn't there (by postponing it) there's a chance he'll run into a

[Haskell] Classes with no data type

2006-10-09 Thread Thomas Davie
Hi, I've met an interesting problem in terms of how to type a data structure and the functions that operate upon it. The problem centres around a single data type. This data type can be constructed in multiple ways using different functions, depending on the options the user specifies.

[Haskell] Evil code

2006-10-03 Thread Thomas Davie
Hello list, I am in the process of testing a debugger, and need some examples to throw at it. It's based on hat, so the normal rules about nothing that uses glasgow extensions or ffi apply. But I'm hitting a bit of a wall. Do any of you have some examples of nasty uses of higher

Re: [Haskell] Evil code

2006-10-03 Thread Thomas Davie
On 3 Oct 2006, at 23:09, Tony Morris wrote: [Tangent] Please excuse my ignorance, but it seems there is assumption of general acceptance that CPS incorporates Evil code. Are you able to support this or refer to a document that does? Thanks for any pointers. Tony Morris http://tmorris.net/

Re: [Haskell-cafe] smallest double eps

2006-09-30 Thread Thomas Davie
On 30 Sep 2006, at 17:19, Brian Hulley wrote: Lennart Augustsson wrote: Hang on, hang on, now I'm getting confused. First you asked for the smallest (positive) x such that 1+x /= x which is around x=4.5e15. 1 + 0 /= 0 0 is smaller than 4.5e15 So I don't understand this at all... But

Re: [Haskell-cafe] Re: Exercise in point free-style

2006-09-01 Thread Thomas Davie
Shorter, although perhaps less insightful. Bob On 2 Sep 2006, at 01:36, Lennart Augustsson wrote: An easy way to solve this is to ask lambdabot. Log on to the Haskell IRC channel: lennart: @pl \ f l - l ++ map f l lambdabot: ap (++) . map Notice how it's much shorter than the Hughes'

Re: [Haskell] 2 programs VERY URGENT

2006-08-12 Thread Thomas Davie
Hi, While this is an interesting question, the haskell mailing list is not really the appropriate place to ask it. Questions here should be of the form of: • How do I work this feature of Haskell • What the hell does this error mean • Wouldn't it be cool if Haskell did this? • Is there a

Re: [Haskell] 2 programs VERY URGENT

2006-08-12 Thread Thomas Davie
Also of note, this channel is in large part made up of university lecturers, researchers, and PhD students. I really wouldn't be surprised if one of them were to notice the assignment they set cropping up here. Bob On 12 Aug 2006, at 13:58, Thomas Davie wrote: Hi, While

Re: [Haskell-cafe] Re: Editors for Haskell

2006-05-25 Thread Thomas Davie
On May 25, 2006, at 6:14 PM, Jeremy O'Donoghue wrote: Hi Walt, I'm using Haskell (GHC and Hugs) on several different platforms. Windows, OS X and Linux systems. Assuming that you want your students to be able to use any of the above platforms, the only options I know of which work well on

[Haskell] GHC on Intel Mac

2006-05-24 Thread Thomas Davie
Hi, I was just wondering what the status of porting GHC to intel mac was these days? I've finally beaten Apple into submission, and got them to replace my broken iBook with a MacBook, so a nice fast version would be nice. Bob ___ Haskell

Re: [Haskell-cafe] Porting GHC to OSX86?

2006-03-22 Thread Thomas Davie
On Mar 21, 2006, at 8:09 PM, Deling Ren wrote: Hi there, Has anyone made any attempt to port GHC to Mac OS X on x86? Wolfgang Thaller’s binary package runs over Rosetta but slow (not surprising). It can not be used to compile a native version either (I got some errors related to machine

Re: [Haskell-cafe] Lists of Lists

2006-03-08 Thread Thomas Davie
On 8 Mar 2006, at 14:21, zell_ffhut wrote: Thank you, It's working as planed now Trying to do a function now that changes the value of an element of the list. In programming languages i've used in the past, this would be done somthing like - changeValue x i [xs] = [xs] !! i = x

Representing Tuple types as products

2006-02-05 Thread Thomas Davie
Here's a random idea that popped into my head. There have been a few discussions about unicode support in Haskell'. One of the particular places this is useful would appear to be type signatures, I was considering that it would be particularly neat to be able to represent tuples as cross

Re: Unary operators [was: Re: ~ patterns]

2006-02-03 Thread Thomas Davie
On Feb 3, 2006, at 9:34 AM, Bulat Ziganshin wrote: Hello Benjamin, Friday, February 03, 2006, 2:29:47 AM, you wrote: (+ x) --- (? + x) i like this idea! but i tink that it's too late for such incompatible change :( really, unary operators can be added to language without any troubles.

Re: Comment Syntax

2006-01-30 Thread Thomas Davie
On 30 Jan 2006, at 14:49, [EMAIL PROTECTED] wrote: Quoting Thomas Davie [EMAIL PROTECTED]: On 30 Jan 2006, at 14:28, Neil Mitchell wrote: Another argument in favour of this is that most editors with syntax hilighting will show -- as a comment, which again increases the confusion factor

Re: [Haskell-cafe] Re: Can I use Haskell for web programming

2006-01-21 Thread Thomas Davie
On Jan 21, 2006, at 8:34 PM, Maurício wrote: They both look cool. Do you think I'll be able to find someone to host professional sites using those libraries? [], Maurício Try http://contextshift.co.uk/vps.html ... or I guess any other virtual server hosts, but they're cheep

[Haskell] Time Profiling Haskell

2006-01-18 Thread Thomas Davie
I have a program that I *know* can run faster... I know there's duplicated effort in there somewhere, the question is where. The heap profile reflects exactly what I would expect it to, so I want a reasonably accurate time profile. Is there any way to get such a thing? Thanks Bob

Re: [Haskell-cafe] file i/o

2006-01-03 Thread Thomas Davie
The other thing to mention, is that if you have the ability to change file formats, it may be better to make just a slight adjustment... If you make it look exactly like the haskell data structure you want: [(Foo, [1,2,3,4,5,6,7]) ,(Bar, [7,6,5,4,3,2,1]) ,...] Then your parser becomes even

Re: [Haskell] [ANNOUNCE] yhc - York Haskell Compiler

2005-11-11 Thread Thomas Davie
On 11 Nov 2005, at 23:09, David Frech wrote: On 11/11/05, Neil Mitchell [EMAIL PROTECTED] wrote: Just so that people don't get the wrong idea ... - It's just an experiment of mine with the backend that turns out to have sparked some interest. It seems to compile most of Haskell 98 (at

Re: [Haskell] [ANNOUNCE] yhc - York Haskell Compiler

2005-11-11 Thread Thomas Davie
Sorry, I could have done with answering a bit more there... On 11 Nov 2005, at 23:09, David Frech wrote: I'm curious. Can you be more specific about what you thought wanted/needed changing in nhc98's VM and/or compiler? Basically, nhc98's backend had several problems, most notably not being

[Haskell] [ANNOUNCE] yhc - York Haskell Compiler

2005-11-10 Thread Thomas Davie
Announcing the York Haskell Compiler - a Haskell 98 compiler with roots in nhc98. It's not totally finished, but is getting there quickly, and could well be of interest to Haskell developers. Webpage: http://www-users.cs.york.ac.uk/~ndm/yhc/ Project Blog: http://yhc06.blogspot.com/ Project Wiki:

Re: [Haskell-cafe] how to break foldl' ?

2005-09-30 Thread Thomas Davie
On 30 Sep 2005, at 11:33, gary ng wrote: Hi, say if I want to sum a list of numbers but only until it hits a max limit. Currently, I control it through the function and basically do nothing when the max is hit. However, if the list is very long, would this mean the same function would be

Re: [Haskell-cafe] how to break foldl' ?

2005-09-30 Thread Thomas Davie
Again, it depends how takeWhile is implemented -- if it's not tail recursive, the compiler will usually manage to run such functions in constant space. Bob On 30 Sep 2005, at 16:02, gary ng wrote: Once again, many thanks to all who taught me about this small little problem. Don't even

Re: [Haskell-cafe] newbe question

2005-09-27 Thread Thomas Davie
The reason is that you can define =- as on operator so for example, in this (obfuscated) code: (=-) x y = x * y sq y = y =- y Thus, in your code, you had an operator on the LHS of the definition, and the interpreter baulked at it. Bob On 27 Sep 2005, at 10:34, [EMAIL PROTECTED] wrote:

Re: [Haskell-cafe] newbe question

2005-09-27 Thread Thomas Davie
On 27 Sep 2005, at 16:53, [EMAIL PROTECTED] wrote: On 27 Sep, Wolfgang Jeltsch wrote: Hello, obviously, Hugs thinks that =- is a special operator. In Haskell you have the ability to define your own operators, so it would be possible to define an operator =-. I would suggest that

Re: [Haskell-cafe] Functional vs Imperative

2005-09-13 Thread Thomas Davie
On 13 Sep 2005, at 14:45, Dhaemon wrote: Hello, I'm quite interested in haskell, but there is something I don't understand(intuitively). I've been crawling the web for an answer, but nothing talks to me... So I was hoping I could find some help here: How is evaluating an expression

Re: [Haskell-cafe] Functional vs Imperative

2005-09-13 Thread Thomas Davie
On 13 Sep 2005, at 16:22, David Roundy wrote: On Tue, Sep 13, 2005 at 01:45:52PM +, Dhaemon wrote: Also, just for kicks, may I had this: I read the code of some haskell-made programs and was astonished. Yes! It was clean and all, but there were dos everywhere... Why use a function

Re: [Haskell-cafe] Monadic vs pure style (was: pros and cons of sta tic typing and side effects)

2005-08-30 Thread Thomas Davie
On Aug 30, 2005, at 12:13 PM, Bayley, Alistair wrote:From: Duncan Coutts [mailto:[EMAIL PROTECTED]] This is often a misconception, that just because you find you need to'do' something in the middle of your algorithm, that you need to convert it wholly to monadic style. Yes. However, Wadler makes a

[Haskell] Using hs-plugins

2005-07-08 Thread Thomas Davie
I've been trying to get hs-plugins working on a box, to use the Eval module, but the register script seems not to register the eval package, or the printf module, which judging by the readme: --- And to unregister (maybe as root). Note that the unistall order matters: $ ghc-pkg -r

Re: [Haskell] ANNOUNCE: GHC survey results

2005-06-28 Thread Thomas Davie
On 28 Jun 2005, at 10:58, Simon Marlow wrote: We've finally digested the results of the GHC survey, and you can find our analysis here: http://www.haskell.org/ghc/survey2005-summary.html There's a lot to take in, but it's an interesting read. Enjoy! I feel compelled to point out that for

[Haskell-cafe] Type extensions

2005-06-01 Thread Thomas Davie
Hi, I was wondering if I hat missed something and it was possible to do this within the Haskell type system or not... Essentially I would like some sort of inderritance property for Haskell types, I often find myself wanting to for example extend a tree with black/white colouring, or

Re: [Haskell-cafe] Type extensions

2005-06-01 Thread Thomas Davie
On 1 Jun 2005, at 15:54, Henning Thielemann wrote: On Wed, 1 Jun 2005, Thomas Davie wrote: Hi, I was wondering if I hat missed something and it was possible to do this within the Haskell type system or not... Essentially I would like some sort of inderritance property for Haskell types

[Haskell-cafe] Type system extension

2005-05-15 Thread Thomas Davie
Hi, I'd just been writing some code and an interesting idea for an extension to Haskell's type system sprang into my head. I have no idea if people have played with it, but it looked vaguely useful to me, so I thought I'd see what everyone else thought. Supposing you have these types:

Re: [Haskell-cafe] Type system extension

2005-05-15 Thread Thomas Davie
On May 16, 2005, at 12:46 AM, Neil Mitchell wrote: Hi, Yes, sounds like a good idea. I'm not sure the right approach is to make the user give this information though - the code will very likely be something like doSomethingToAModule (SModule a b) = f a b from which you can derive the type

[Haskell] Odd link error

2005-05-11 Thread Thomas Davie
Hi, I'm getting an odd link error trying to build with ghc 6.2.2 on OS X, and can't figure out what's going on. From it's form, I assume that the symbol is part of the runtime, but greping the files in /usr/ local/lib/ghc-6.2.2 returns no results. dhcp2934:~/Documents/hat tatd2$ make cd

Re: [Haskell-cafe] Specify array or list size?

2005-05-07 Thread Thomas Davie
No, it introduces a variable of type array of 50 ints, which can be converted to pointer to int. It matters when you make a pointer of such arrays, an array of such arrays, or sizeof such array. In C++ the size can be matched by template parameter, and you can have separate overloadings for

Re: [Haskell-cafe] Specify array or list size?

2005-05-07 Thread Thomas Davie
On May 7, 2005, at 8:07 PM, Marcin 'Qrczak' Kowalczyk wrote: Thomas Davie [EMAIL PROTECTED] writes: I'm not familiar with your C++ example (not being familiar with C++), but I think that it's a bit of a stretch of the imagination to say that C introduces a variable of type array of 50 ints

Re: [Haskell-cafe] Compiling with NHC98

2005-05-07 Thread Thomas Davie
Incidentally, if you aren't already familiar with make or some other build system, I strongly recommend looking into one. Even for a project with only two files, having a build system keep track of compilation dependencies makes things a lot less tedious. In random addition to this... hmake will

Re: [Haskell-cafe] a newbie's question

2005-04-21 Thread Thomas Davie
On Apr 21, 2005, at 3:47 PM, SCOTT J. wrote: Hi, I'm beginning to study Haskell, For the following a = [1,2,3] b = there do x - a y - b return (x , y) Winhugs cannot run it. Gives Syntax error in input (unexpected backslash ( lambda)) Your problem is that you're using monads to grab

[Haskell] Calling Haskell from (Objective-)C

2005-03-24 Thread Thomas Davie
Hi, I'm attempting to call Haskell functions from Objective-C (a required parser is gonna come out much nicer in Haskell than in Objective-C). As far as I can make out HOC is the only way to do this (damn, knew I shouldn't have upgraded to GHC 6.4). Does anyone know of any other way to

Re: [Haskell] instance Bounded Double

2005-03-13 Thread Thomas Davie
I may be barking up the wrong tree here, but I think the key to this discussion is that real numbers are not bounded, while doubles are bounded. One cannot say what the smallest or largest real number are, but one can say what the smallest or largest double are (and it is unfortunately

[Haskell-cafe] Quzzle

2004-12-04 Thread Thomas Davie
Hi, Having read an interesting, but simplistic article on the development of Quzzle in Haskell on slashdot (http://developers.slashdot.org/article.pl?sid=04/12/04/ 0116231threshold=1tid=159tid=156). I was wondering if anyone knew of any more in depth reviews of what Jim Lewis did to

Re: [Haskell-cafe] Equality of functions

2004-11-30 Thread Thomas Davie
On 1 Dec 2004, at 01:06, Bernard Pope wrote: On Tue, 2004-11-30 at 13:52 +, Jules Bean wrote: In the same sense, you could try (map f [1..]) == (map g [1..]) and it will return False quickly if they are different, but it will run forever if they are the same. For some very generous definition

Re: [Haskell-cafe] Equality of functions

2004-11-30 Thread Thomas Davie
Woops... scratch my stupitity... we could of course discover the test to be false on an extremely large integer. Bob -- God is real... Unless you define it as an integer. On 1 Dec 2004, at 01:19, Thomas Davie wrote: On 1 Dec 2004, at 01:06, Bernard Pope wrote: On Tue, 2004-11-30 at 13:52 +

Re: [Haskell] Re: About Random Integer without IO

2004-11-11 Thread Thomas Davie
This method unfortunately depends on having a seed first though. One must use a different value every time the program is started, commonly time or the first few bytes from /dev/random. Any one of these is going to require a monadic function to generate (i.e. it must come from the

[Haskell] Re: About Random Integer without IO

2004-11-11 Thread Thomas Davie
On 11 Nov 2004, at 22:02, karczma wrote: Thomas Davie writes: This method unfortunately depends on having a seed first though. Which this method? Please, quote the text you are referring to *before* your answer. One must use a different value every time the program is started, commonly time

[Haskell] Re: elementary tracing for Haskell

2004-10-12 Thread Thomas Davie
Hi, I'm glad that there's interest for a tool like hat-anim. I should warn you however that the current version is far from perfect - it has some problems with displaying infinite lists and with some lambda expressions and worst of all has a pretty nasty memory leek problem (there's what I get

Re: Help!!!!

2004-01-08 Thread Thomas Davie
htmldiv style='background-color:'PHi Guys,/P PI’m a fourth year computer science in Ireland and I’m doing my final year project on Haskell programming. What I’m doing is writing a program in Haskell for the maths department for my college. What it involves is this: There is a class of 50

Re: AW: GHC and Panther (Mac OS X 10.3)

2003-11-20 Thread Thomas Davie
Hi again, Just to let you know that the responses did set me down the right path to get hmake to make - it needed me to use sudo gcc_select 3 (to select gcc 3.1 as opposed to 3.3), there were still errors with gcc2. Just out of interest though, the step below seemed to get rid of the main

GHC and Panther (Mac OS X 10.3)

2003-11-19 Thread Thomas Davie
Hi, I've just upgraded to OS X 10.3 and have been having some problems with ghc. I'm using ghc 5.04.3 because it is compatible with hat - I'm doing a uni project on hat at the moment, so it's critical that it works. When I attempt to build hmake using ghc I get a whole load of errors

Re: Can't compile hmake

2003-07-29 Thread Thomas Davie
On Tuesday, Jul 29, 2003, at 10:19 Europe/London, Malcolm Wallace wrote: Thomas Davie [EMAIL PROTECTED] writes: I'm just trying to get started with haskell and have been having some problems getting hmake to compile. For some reason it doesn't detect libreadline. FYI, I'm running Mac OS X

Re: Can't compile hmake

2003-07-29 Thread Thomas Davie
On Tuesday, Jul 29, 2003, at 11:16 Europe/London, Keith Wansbrough wrote: I was wondering if idiocy was my problem there, I don't see the directory though: [nimbus2:project/hmake-3.08/targets] tatd100% ls -la total 0 drwxr-xr-x 3 tatd100 staff 102 Jul 29 10:42 . drwxr-xr-x 14 tatd100 staff

<    1   2   3