Re: [Haskell-cafe] Ease of Haskell development on OS X?

2009-03-20 Thread Thomas Davie
On 20 Mar 2009, at 16:56, Mark Spezzano wrote: Hi, I’ve been thinking of changing over to an iMac from my crappy old PC running Windows Vista. Question: Does the iMac have good support for Haskell development? As good as, if not better than other platforms I've found, you get none of

Re: [Haskell-cafe] Ease of Haskell development on OS X?

2009-03-20 Thread Thomas Davie
On 20 Mar 2009, at 18:08, Don Stewart wrote: tom.davie: Other than chose the graphics card carefully, an iMac will do you very well. Hope that helps. This is very useful. Could the Mac users add information (and screenshots?) to the OSX wiki page,

Re: [Haskell-cafe] Ease of Haskell development on OS X?

2009-03-20 Thread Thomas Davie
On 20 Mar 2009, at 18:46, Don Stewart wrote: tom.davie: On 20 Mar 2009, at 18:08, Don Stewart wrote: tom.davie: Other than chose the graphics card carefully, an iMac will do you very well. Hope that helps. This is very useful. Could the Mac users add information (and screenshots?) to

Re: [Haskell-cafe] Re: Haskell Logo Voting has started!

2009-03-19 Thread Thomas Davie
On 19 Mar 2009, at 11:39, Wolfgang Jeltsch wrote: Am Mittwoch, 18. März 2009 13:31 schrieben Sie: On Wed, Mar 18, 2009 at 04:36, Wolfgang Jeltsch wrote: Am Mittwoch, 18. März 2009 10:03 schrieb Benjamin L.Russell: Just go through the list, choose your top favorite, and assign rank 1 to

Re: [Haskell-cafe] Re: Haskell Logo Voting has started!

2009-03-17 Thread Thomas Davie
On 17 Mar 2009, at 15:24, Heinrich Apfelmus wrote: Eelco Lempsink wrote: Hi there! I updated a couple of logo versions and ungrouped and regrouped the (former) number 31. Other than that, there was nothing standing in the way of the voting to begin imho, so I started up the competition.

Re: [Haskell-cafe] monadic logo

2009-03-12 Thread Thomas Davie
On 12 Mar 2009, at 15:04, Gregg Reynolds wrote: At risk of becoming the most hated man in all Haskelldom, I'd like to suggest that the Haskell logo not use lambda symbols. Or at least not as the central element. Sorry, I know I'm late to the party, but the thing is there is nothing

Re: [Haskell-cafe] Abuse of the monad [was: monadic logo]

2009-03-12 Thread Thomas Davie
On 12 Mar 2009, at 15:16, Andrew Wagner wrote: Can you expand on this a bit? I'm curious why you think this. For two reasons: Firstly, I often find that people use the Monadic interface when one of the less powerful ones is both powerful enough and more convenient, parsec is a wonderful

Re: [Haskell-cafe] Abuse of the monad

2009-03-12 Thread Thomas Davie
On 12 Mar 2009, at 15:33, Colin Paul Adams wrote: Thomas == Thomas Davie tom.da...@gmail.com writes: Thomas On 12 Mar 2009, at 15:16, Andrew Wagner wrote: Can you expand on this a bit? I'm curious why you think this. Thomas For two reasons: Thomas Firstly, I often find

Re: [Haskell-cafe] Loading 3D points normals into OpenGL?

2009-03-11 Thread Thomas Davie
If you were to strip out all texture loading code, then yes, otherwise, no. Bob On 12 Mar 2009, at 01:36, Duane Johnson wrote: The MTL portion of that library depends on an external DevIL library ... is there a way to specify just the Obj portion which has no such dependency? Thanks,

Re: [Haskell-cafe] Status of Haskell under OsX

2009-02-27 Thread Thomas Davie
On 27 Feb 2009, at 08:17, Arne Dehli Halvorsen wrote: Manuel M T Chakravarty wrote: I'm planning to purchase a MacBookPro so I'm wondering how well Haskell is supported under this platform. At least two of the regular contributors to GHC work on Macs. That should ensure that Mac OS X is

Re: [Haskell-cafe] Status of Haskell under OsX

2009-02-27 Thread Thomas Davie
On 27 Feb 2009, at 11:21, Arne Dehli Halvorsen wrote: Thomas Davie wrote: For me, this worked: sudo port install ghc sudo port install gtk2 sudo port install cairomm curl http://downloads.sourceforge.net/gtk2hs/gtk2hs-0.10.0.tar.gz gtk2hs-0.10.0.tar.gz tar xvfz gtk2hs-0.10.0.tar.gz normal

Re: Re[2]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Thomas Davie
On 20 Feb 2009, at 22:57, Bulat Ziganshin wrote: Hello Don, Saturday, February 21, 2009, 12:43:46 AM, you wrote: gcc -O3 -funroll-loops 0.318 ghc -funroll-loops -D64 0.088 So what did we learn here? nothing new: what you are not interested

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Thomas Davie
On 20 Feb 2009, at 23:33, Bulat Ziganshin wrote: Hello Achim, Saturday, February 21, 2009, 1:17:08 AM, you wrote: nothing new: what you are not interested in real compilers comparison, preferring to demonstrate artificial results ...that we have a path to get better results than gcc -O3

Re: Re[4]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Thomas Davie
On 20 Feb 2009, at 23:41, Bulat Ziganshin wrote: Hello Thomas, Saturday, February 21, 2009, 1:19:47 AM, you wrote: I'm not sure what you're getting at Bulat √ it's been demonstrated that ghc is slower than gcc for most cases at the moment (many benchmarks will back this up), *however*, it's

Re: Re[2]: [Haskell-cafe] speed: ghc vs gcc vs jhc

2009-02-20 Thread Thomas Davie
On 20 Feb 2009, at 23:44, Bulat Ziganshin wrote: Hello John, Saturday, February 21, 2009, 1:33:12 AM, you wrote: Don't forget jhc: i was pretty sure that jhc will be as fast as gcc :) unfortunately, jhc isn't our production compiler Why not? There's nothing stopping you from choosing

Re: Re[2]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Thomas Davie
On 20 Feb 2009, at 23:52, Bulat Ziganshin wrote: Hello Thomas, Saturday, February 21, 2009, 1:41:24 AM, you wrote: You need look no further than the debian language shootout that things really aren't as bad as you're making out √ Haskell comes in in general less than 3x slower than gcc

Re: Re[4]: [Haskell-cafe] speed: ghc vs gcc vs jhc

2009-02-20 Thread Thomas Davie
On 21 Feb 2009, at 00:01, Bulat Ziganshin wrote: Hello Thomas, Saturday, February 21, 2009, 1:52:27 AM, you wrote: i was pretty sure that jhc will be as fast as gcc :) unfortunately, jhc isn't our production compiler Why not? There's nothing stopping you from choosing any Haskell

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Thomas Davie
On 21 Feb 2009, at 00:10, Ahn, Ki Yung wrote: Thomas Davie wrote: You need look no further than the debian language shootout that things really aren't as bad as you're making out – Haskell comes in in general less than 3x slower than gcc compiled C. Of note, of all the managed languages

Re: [Haskell-cafe] Another point-free question (=, join, ap)

2009-02-13 Thread Thomas Davie
Hey, Thanks for all the suggestions. I was hoping that there was some uniform pattern that would extend to n arguments (rather than having to use liftM2, litM3, etc. or have different 'application' operators in between the different arguments); perhaps not. Oh well :) Sure you can!

Re: [Haskell-cafe] lazy evaluation is not complete

2009-02-09 Thread Thomas Davie
On 10 Feb 2009, at 07:57, Max Rabkin wrote: On Mon, Feb 9, 2009 at 10:50 PM, Iavor Diatchki iavor.diatc...@gmail.com wrote: I 0 * _ = I 0 I x * I y = I (x * y) Note that (*) is now non-commutative (w.r.t. _|_). Of course, that's what we need here, but it means that the obviously

Re: [Haskell-cafe] Re: Switching from Mercurial to Darcs

2009-02-07 Thread Thomas Davie
On 6 Feb 2009, at 10:12, Paolo Losi wrote: Henning Thielemann wrote: 4) hg commit -m message this commits my changes locally. I always do this before pulling since then I'm sure my changes are saved in the case a merge goes wrong. In old darcs its precisely the other way round. Since it

[Haskell-cafe] Re: [Haskell-beginners] Just how unsafe is unsafe

2009-02-05 Thread Thomas Davie
On 5 Feb 2009, at 22:11, Andrew Wagner wrote: So we all know the age-old rule of thumb, that unsafeXXX is simply evil and anybody that uses it should be shot (except when it's ok). I understand that unsafeXXX allows impurity, which defiles our ability to reason logically about haskell

Re: [Haskell] Re: HOC

2009-02-04 Thread Thomas Davie
On 4 Feb 2009, at 13:33, Benjamin L.Russell wrote: On Sat, 31 Jan 2009 21:34:34 +0100, Thomas Davie tom.da...@gmail.com wrote: I noticed recently that HOC has moved over to google code, and seems a little more active than it was before. Is there a mailing list where I can talk to other

Re: [Haskell-cafe] Elegant powerful replacement for CSS

2009-02-03 Thread Thomas Davie
On 3 Feb 2009, at 20:39, Conal Elliott wrote: [Spin-off from the haskell-cafe discussion on functional/ denotational GUI toolkits] I've been wondering for a while now what a well-designed alternative to CSS could be, where well-designed would mean consistent, composable, orthogonal,

Re: [Haskell-cafe] Purely funcional LU decomposition

2009-02-03 Thread Thomas Davie
On 3 Feb 2009, at 22:37, Rafael Gustavo da Cunha Pereira Pinto wrote: Hello folks After a discussion on whether is possible to compile hmatrix in Windows, I decided to go crazy and do a LU decomposition entirely in Haskell... At first I thought it would be

Re: [Haskell-cafe] Re: Why binding to existing widget toolkits doesn't make any sense

2009-02-02 Thread Thomas Davie
On 3 Feb 2009, at 08:12, Achim Schneider wrote: John A. De Goes j...@n-brain.net wrote: Perhaps I should have been more precise: How do you define layout and interaction semantics in such a way that the former has a *necessarily* direct, enormous impact on the latter? HTML/CSS is a

Re: [Haskell-cafe] Haskeline, pcre-light, iconv and Cabal on OSX

2009-02-01 Thread Thomas Davie
This is caused by OS X's libiconv being entirely CPP macros, the FFI has nothing to get hold of. IIRC there's a ghc bug report open for it. Bob On 1 Feb 2009, at 18:57, Antoine Latter wrote: Funny story, If I do the following three things, I get errors on my Intel Mac OS 10.5: * Build

Re: [Haskell-cafe] Haskeline, pcre-light, iconv and Cabal on OSX

2009-02-01 Thread Thomas Davie
On 1 Feb 2009, at 19:43, Antoine Latter wrote: On Sun, Feb 1, 2009 at 12:04 PM, Antoine Latter aslat...@gmail.com wrote: On Sun, Feb 1, 2009 at 12:01 PM, Thomas Davie tom.da...@gmail.com wrote: This is caused by OS X's libiconv being entirely CPP macros, the FFI has nothing to get hold

[Haskell] HOC

2009-01-31 Thread Thomas Davie
I noticed recently that HOC has moved over to google code, and seems a little more active than it was before. Is there a mailing list where I can talk to other users and get myself kick started, or is it a case of just using the standard Haskell ones? Bob

Re: [Haskell-cafe] Re: Laws and partial values

2009-01-26 Thread Thomas Davie
sure about that anymore. If Thomas Davie (Bob) was here discussing an alternative theory in which () is unlifted, the sorry, I completely misunderstood. My argument is that in Haskell as it is, as far as I know, _|_ *is* defined to denote a nonterminating computation, while on the other hand

Re: [Haskell-cafe] ANN: filestore 0.1

2009-01-26 Thread Thomas Davie
On 26 Jan 2009, at 06:17, carmen wrote: back to the original topic of the thread.. cool project, id be interested ina pure-FS backend as well, Indeed, very cool! Can I make another feature request – generalize how diffs are created, so that I could in theory parse the file contents, and

Re: [Haskell-cafe] Re: Laws and partial values

2009-01-25 Thread Thomas Davie
On 25 Jan 2009, at 10:08, Daniel Fischer wrote: Am Sonntag, 25. Januar 2009 00:55 schrieb Conal Elliott: It's obvious because () is a defined value, while bottom is not - per definitionem. I wonder if this argument is circular. I'm not aware of defined and not defined as more than

Re: Laws and partial values (was: [Haskell-cafe] mapM_ - Monoid.Monad.map)

2009-01-24 Thread Thomas Davie
On 24 Jan 2009, at 10:40, Ryan Ingram wrote: On Fri, Jan 23, 2009 at 10:49 PM, Thomas Davie tom.da...@gmail.com wrote: Isn't the point of bottom that it's the least defined value. Someone above made the assertion that for left identity to hold, _|_ `mappend` () must

[Haskell-cafe] Re: Laws and partial values

2009-01-24 Thread Thomas Davie
On 24 Jan 2009, at 20:28, Jake McArthur wrote: Thomas Davie wrote: But, as there is only one value in the Unit type, all values we have no information about must surely be that value The flaw in your logic is your assumption that the Unit type has only one value. Consider bottom

Re: [Haskell-cafe] Re: Laws and partial values

2009-01-24 Thread Thomas Davie
On 24 Jan 2009, at 21:31, Dan Doel wrote: On Saturday 24 January 2009 3:12:30 pm Thomas Davie wrote: On 24 Jan 2009, at 20:28, Jake McArthur wrote: Thomas Davie wrote: But, as there is only one value in the Unit type, all values we have no information about must surely be that value

[Haskell-cafe] Re: Laws and partial values

2009-01-24 Thread Thomas Davie
On 24 Jan 2009, at 22:19, Henning Thielemann wrote: On Sat, 24 Jan 2009, Thomas Davie wrote: On 24 Jan 2009, at 21:31, Dan Doel wrote: For integers, is _|_ equal to 0? 1? 2? ... Hypothetically (as it's already been pointed out that this is not the case in Haskell), _|_ in the integers

Re: [Haskell-cafe] Re: Laws and partial values

2009-01-24 Thread Thomas Davie
On 24 Jan 2009, at 22:47, Lennart Augustsson wrote: You can dream up any semantics you like about bottom, like it has to be () for the unit type. But it's simply not true. I suggest you do some cursory study of denotational semantics and domain theory. Ordinary programming languages include

Re: [Haskell-cafe] Re: Laws and partial values

2009-01-24 Thread Thomas Davie
On 25 Jan 2009, at 00:01, Benja Fallenstein wrote: Hi Lennart, On Sat, Jan 24, 2009 at 10:47 PM, Lennart Augustsson lenn...@augustsson.net wrote: You can dream up any semantics you like about bottom, like it has to be () for the unit type. But it's simply not true. I suggest you do some

Re: [Haskell-cafe] mapM_ - Monoid.Monad.map

2009-01-23 Thread Thomas Davie
On 23 Jan 2009, at 21:50, Henning Thielemann wrote: I always considered the monad functions with names ending on '_' a concession to the IO monad. Would you need them for any other monad than IO? For self-written monads you would certainly use a monoid instead of monadic action, all

Re: Laws and partial values (was: [Haskell-cafe] mapM_ - Monoid.Monad.map)

2009-01-23 Thread Thomas Davie
On 24 Jan 2009, at 02:33, Luke Palmer wrote: On Fri, Jan 23, 2009 at 6:10 PM, rocon...@theorem.ca wrote: On Fri, 23 Jan 2009, Derek Elkins wrote: mempty `mappend` undefined = undefined (left identity monoid law) The above definition doesn't meet this, similarly for the right identity monoid

Re: [Haskell-cafe] Re: How to make code least strict?

2009-01-21 Thread Thomas Davie
Further to all the playing with unamb to get some very cool behaviors, you might want to look at Olaf Chitil's paper here: http://www.cs.kent.ac.uk/pubs/2006/2477/index.html It outlines a tool for checking if your programs are as non-strict as they can be. Bob On 21 Jan 2009, at 02:08,

Re: [Haskell-cafe] How to simplify this code?

2009-01-16 Thread Thomas Davie
add2 :: JSON a = MyData - String - a - MyData add2 m k v = fromJust $ (\js - m { json = js }) `liftM` (showJSON `liftM` (toJSObject `liftM` (((k, showJSON v):) `liftM` (fromJSObject `liftM` (jsObj $ json m) setJSON m js = m {json = js} add2 m k v = fromJust $ setJSON m $ showJSON $

Re: [Haskell-cafe] Re: How to simplify this code?

2009-01-16 Thread Thomas Davie
On 16 Jan 2009, at 02:30, eyal.lo...@gmail.com wrote: Very nice series of refactorings! I'd like to add that it might be a better argument order to replace: JSON a = MyData - String - a - MyData with: JSON a = String - a - MyData - MyData Just so you can get a (MyData - MyData)

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-15 Thread Thomas Davie
On 15 Jan 2009, at 16:34, John Goerzen wrote: Hi folks, Don Stewart noticed this blog post on Haskell by Brian Hurt, an OCaml hacker: http://enfranchisedmind.com/blog/2009/01/15/random-thoughts-on- haskell/ It's a great post, and I encourage people to read it. I'd like to highlight one

Re: [Haskell-cafe] How to check object's identity?

2009-01-04 Thread Thomas Davie
On 4 Jan 2009, at 18:08, Aaron Tomb wrote: On Jan 3, 2009, at 7:28 AM, Xie Hanjian wrote: Hi, I tried this in ghci: Prelude 1:2:[] == 1:2:[] True Does this mean (:) return the same object on same input, or (==) is not for identity checking? If the later is true, how can I check two

[Haskell-cafe] Re: [Haskell-beginners] pattern matching on date type

2009-01-01 Thread Thomas Davie
On 1 Jan 2009, at 09:36, Max.cs wrote: thanks! suppose we have data Tree a = Leaf a | Branch (Tree a) (Tree a) deriving Show and how I could define a function foo :: a - Tree a that foo a = Leaf a where a is not a type of Tree foo b = b where b is one of the type

[Haskell-cafe] Re: [Haskell-beginners] about the concatenation on a tree

2008-12-31 Thread Thomas Davie
On 31 Dec 2008, at 16:02, Max cs wrote: hi all, not sure if there is someone still working during holiday like me : ) I got a little problem in implementing some operations on tree. suppose we have a tree date type defined: data Tree a = Leaf a | Branch (Tree a) (Tree a) I want to do a

Re: [Haskell-cafe] about the concatenation on a tree

2008-12-31 Thread Thomas Davie
On 31 Dec 2008, at 21:18, Henk-Jan van Tuyl wrote: On Wed, 31 Dec 2008 17:19:09 +0100, Max cs max.cs. 2...@googlemail.com wrote: Hi Henk-Jan van Tuyl, Thank you very much for your reply! I think the concatenation should be different to thhe treeConcat :: Tree a - Tree a - Tree a the

Re: [Haskell-cafe] instance Enum [Char] where ...

2008-12-30 Thread Thomas Davie
Am 30.12.2008 um 04:25 schrieb JustinGoguen: I am having difficulty making [Char] an instance of Enum. fromEnum is easy enough: map fromEnum to each char in the string and take the sum. However, toEnum has no way of knowing what the original string was. The problem you're having is that

Re: [Haskell-cafe] Re: Time for a new logo?

2008-12-24 Thread Thomas Davie
On 24 Dec 2008, at 08:13, Colin Paul Adams wrote: There are a lot of nice designs on the new_logo_ideas page. My favourite by far is Conal's. One thing I noticed - everyone seems to include lower-case lambda in the design, but no-one seems to have replaced the terminal double ell in Haskell

Re: [Haskell-cafe] Yampa vs. Reactive

2008-12-22 Thread Thomas Davie
On 21 Dec 2008, at 13:10, Henrik Nilsson wrote: Hi Tom, In reactive, one doesn't. All behaviors and events have the same absolute 0 value for time. Right. I believe the possibility of starting behaviors later is quite important. And from what Conal wrote in a related mail, I take it that

Re: [Haskell-cafe] Defining a containing function on polymorphic list

2008-12-22 Thread Thomas Davie
On 22 Dec 2008, at 15:18, Andrew Wagner wrote: Yes, of course, sorry for the typo. On Mon, Dec 22, 2008 at 9:17 AM, Denis Bueno dbu...@gmail.com wrote: 2008/12/22 Andrew Wagner wagner.and...@gmail.com: The problem here is even slightly deeper than you might realize. For example, what if you

Re: [Haskell] ANN: Hoogle with more libraries

2008-12-21 Thread Thomas Davie
Hi Neil, This is a great addition! There's several packages up there that I want to search. A couple of small bug reports though: 1. Searching using a package name that isn't all lower case results in nothing (e.g. (a - b) - f a - f b +InfixApplicative gives no results, while (a - b)

Re: [Haskell-cafe] Re: [reactive] problem with unamb -- doesn't kill enough threads

2008-12-20 Thread Thomas Davie
On 20 Dec 2008, at 12:00, Peter Verswyvelen wrote: I see. Of course, how silly of me, killThread is asynchronous, it only waits until the exception is raised in the receiving thread, but it does not wait until the thread is really killed. The documentation does not seem to mention this

Re: [Haskell-cafe] Yampa vs. Reactive

2008-12-19 Thread Thomas Davie
Hi Henrik, On 19 Dec 2008, at 02:05, Henrik Nilsson wrote: Hi Tom, I'm not sure why mapping the function is not satisfactory -- It would create a new Behavior, who's internals contain only the two elements from the list -- that would expose to the garbage collector that the second

Re: [Haskell-cafe] Yampa vs. Reactive

2008-12-18 Thread Thomas Davie
Hi Henrik, On 18 Dec 2008, at 14:26, Henrik Nilsson wrote: Hi Tom, I'll have an attempt at addressing the questions, although I freely admit that I'm not as into Reactive as Conal is yet, so he may come and correct me in a minute. [...] Reactive has explicitly parameterized inputs.

Re: [Haskell-cafe] Yampa vs. Reactive

2008-12-18 Thread Thomas Davie
Hi Henrik, On 18 Dec 2008, at 19:06, Henrik Nilsson wrote: Hi Tom, I don't think this is really true. Behaviors and Events do not reveal in their type definitions any relation to any system that they may or may not exist in. OK. So how does e.g. mousePoint :: Behavior Point get

Re: [Haskell-cafe] Yampa vs. Reactive

2008-12-17 Thread Thomas Davie
On 17 Dec 2008, at 03:14, Tony Hannan wrote: Hello, Can someone describe the advantages and disadvantages of the Yampa library versus the Reactive library for functional reactive programming, or point me to a link. Thanks, Tony P.S. It is hard to google for Yampa and Reactive together

Re: [Haskell-cafe] Time for a new logo?

2008-12-17 Thread Thomas Davie
On 16 Dec 2008, at 18:40, Darrin Thompson wrote: \\ \\ \\ \\ \| \\ \\ --- \\ \\ // / \ // / \ \| // / /\\ --- // / / \\

Re: [Haskell-cafe] Time for a new logo?

2008-12-17 Thread Thomas Davie
On 17 Dec 2008, at 09:26, Luke Palmer wrote: On Wed, Dec 17, 2008 at 1:10 AM, Thomas Davie tom.da...@gmail.com wrote: On 16 Dec 2008, at 18:40, Darrin Thompson wrote

Re: [Haskell-cafe] Yampa vs. Reactive

2008-12-17 Thread Thomas Davie
I'll have an attempt at addressing the questions, although I freely admit that I'm not as into Reactive as Conal is yet, so he may come and correct me in a minute. On 17 Dec 2008, at 15:29, Henrik Nilsson wrote: I have not used Reactive as such, but I did use Classic FRP extensively, and

Re: [Haskell-cafe] Time for a new logo?

2008-12-15 Thread Thomas Davie
On 15 Dec 2008, at 03:27, Don Stewart wrote: Could you attach it to the web page, http://haskell.org/haskellwiki/Haskell_logos/New_logo_ideas I've stuck a contender up there too. Bob ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Time for a new logo?

2008-12-15 Thread Thomas Davie
On 15 Dec 2008, at 12:43, Henning Thielemann wrote: On Sun, 14 Dec 2008, Don Stewart wrote: I noticed a new haskell logo idea on a tshirt today, http://image.spreadshirt.net/image-server/image/configuration/13215127/producttypecolor/2/type/png Simple, clean and *pure*. Instead of the

Re: [Haskell-cafe] Is unsafePerformIO safe here?

2008-12-07 Thread Thomas Davie
On 8 Dec 2008, at 01:28, John Ky wrote: Hi, Is the following safe? moo :: TVar Int moo = unsafePerformIO $ newTVarIO 1 I'm interested in writing a stateful application, and I wanted to start with writing some IO functions that did stuff on some state and then test them over long periods

Re: [Haskell-cafe] Re: Haskell haikus

2008-12-07 Thread Thomas Davie
On 8 Dec 2008, at 03:02, Richard O'Keefe wrote: It's proving remarkably hard to pin down just what a Haiku is supposed to be in English. Taking the 3-5-3 syllable pattern, how about Soft rain falls while Haskell infers all my types. I always thought that Haikus had a seven five seven

Re: [Haskell-cafe] Functional version of this OO snippet

2008-12-05 Thread Thomas Davie
On 5 Dec 2008, at 13:40, Andrew Wagner wrote: Hi all, public interface IEngine { void foo(); void bar(string bah); ... } public class Program { public void Run(IEngine engine){ while(true){ string command = GetLine(); if (command.startsWith(foo)){ engine.foo(); } else if

Re: [Haskell-cafe] Functional version of this OO snippet

2008-12-05 Thread Thomas Davie
In other words, I want to provide the same UI across multiple implementations of the engine that actually processes the commands. You can ofc make my reply somewhat more functional by removing the interact from run, and just making it have type IEngine a = a - String - String. That way

Re: [Haskell-cafe] Re: Functional version of this OO snippet

2008-12-05 Thread Thomas Davie
You don't even need a type class, a simple data type is enough. Very true, but I disagree that you've made it functional in any way, IO is all about sequencing things, it's very much not a functional style data Engine = Engine { foo :: IO (), bar :: String - IO () } run e =

Re: [Haskell-cafe] Re: Functional version of this OO snippet

2008-12-05 Thread Thomas Davie
On 5 Dec 2008, at 16:42, Apfelmus, Heinrich wrote: Thomas Davie wrote: You don't even need a type class, a simple data type is enough. Very true, but I disagree that you've made it functional in any way, IO is all about sequencing things, it's very much not a functional style data

Re: [Haskell-cafe] instance Applicative f = Applicative (StateT s f)

2008-12-05 Thread Thomas Davie
On 5 Dec 2008, at 16:54, Ross Paterson wrote: On Fri, Dec 05, 2008 at 04:35:51PM +0100, Martijn van Steenbergen wrote: How do I implement the following? instance Applicative f = Applicative (StateT s f) The implementation of pure is trivial, but I can't figure out an implementation for *.

Re: [Haskell-cafe] Re: Functional version of this OO snippet

2008-12-05 Thread Thomas Davie
On 5 Dec 2008, at 17:00, Duncan Coutts wrote: On Fri, 2008-12-05 at 16:50 +0100, Thomas Davie wrote: Sure, and he could then use a fold instead of a map. Reading files is problematic, but as long as you're only doing it once (the most common situation) is entirely fine wrapped up

Re: [Haskell-cafe] Re: Functional version of this OO snippet

2008-12-05 Thread Thomas Davie
On 5 Dec 2008, at 17:46, Duncan Coutts wrote: On Fri, 2008-12-05 at 17:06 +0100, Thomas Davie wrote: On 5 Dec 2008, at 17:00, Duncan Coutts wrote: On Fri, 2008-12-05 at 16:50 +0100, Thomas Davie wrote: Sure, and he could then use a fold instead of a map. Reading files is problematic

Re: [Haskell-cafe] instance Applicative f = Applicative (StateT s f)

2008-12-05 Thread Thomas Davie
That would be incompatible with the ap of the monad where it exists, but it's worse than that. Which state will you return? If you return one of the states output by one or other of the arguments, you'll break one of the laws: pure id * v = v u * pure y = pure ($ y) * u

Re: Suggestion: Syntactic sugar for Maps!

2008-11-27 Thread Thomas Davie
On 27 Nov 2008, at 19:59, circ ular wrote: I suggest Haskell introduce some syntactic sugar for Maps. Python uses {this: 2, is: 1, a: 1, Map: 1} Clojure also use braces: {:k1 1 :k2 3} where whitespace is comma but commas are also allowed. I find the import Data.Map and then fromList

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Thomas Davie
On 12 Nov 2008, at 11:11, Andrew Birkett wrote: Hi, Is a formal proof that the Haskell language is referentially transparent? Many people state haskell is RT without backing up that claim. I know that, in practice, I can't write any counter- examples but that's a bit handy-wavy. Is

Re: [Haskell-cafe] Proof that Haskell is RT

2008-11-12 Thread Thomas Davie
On 12 Nov 2008, at 14:47, Mitchell, Neil wrote: It's possible that there's some more direct approach that represents types as some kind of runtime values, but nobody (to my knowledge) has done that. It don't think its possible - I tried it and failed. Consider: show (f []) Where f has

[Haskell-cafe] announce [(InfixApplicative, 1.0), (OpenGLCheck, 1.0), (obj, 0.1)]

2008-11-04 Thread Thomas Davie
Dear Haskellers, I've just uploaded a few packages to Hackage which I have produced while working at Anygma. I thought that people might be interested in knowing about these: obj-0.1: A library for loading and writing obj 3D models. This is still an early version and rather limited,

Re: [Haskell-cafe] Why 'round' does not just round numbers ?

2008-10-27 Thread Thomas Davie
[1] The Haskell 98 Report: Predefined Types and Classes http://haskell.org/onlinereport/basic.html This behaviour is not what I expect after reading the description at http://haskell.org/ghc/docs/latest/html/libraries/base/ Prelude.html#v:round . Given that this behaviour has caused a bit

Re: [Haskell-cafe] Red-Blue Stack

2008-09-27 Thread Thomas Davie
On 25 Sep 2008, at 06:11, Matthew Eastman wrote: Hey guys, This is probably more of a question about functional programming than it is about Haskell, but hopefully you can help me out. I'm new to thinking about things in a functional way so I'm not sure what the best way to do some

Re: [Haskell-cafe] Red-Blue Stack

2008-09-27 Thread Thomas Davie
Thomas Davie wrote: In this interprettation, here's what I think is an O(1) implementation: ... rbPop :: Colour - RBStack a - RBStack a rbPop c Empty = error Empty Stack, can't pop rbPop c (More c' v asCs nextNonC) | c == c' = asCs | otherwise = rbPop c nextNonC ... Your pop doesn't

Re: [Haskell-cafe] Re: Red-Blue Stack

2008-09-27 Thread Thomas Davie
On 27 Sep 2008, at 20:16, apfelmus wrote: Thomas Davie wrote: Matthew Eastman wrote: The part of the assignment I'm working on is to implement a RedBlueStack, a stack where you can push items in as either Red or Blue. You can pop Red and Blue items individually, but the stack has to keep

Re: [Haskell-cafe] Hmm, what license to use?

2008-09-26 Thread Thomas Davie
Now I have fairly strong feelings about freedom of code and I everything I release is either under GPL or LGPL. What I like about those licenses is it protects freedom in a way that I think it should and it forces a sort of reciprocity which resonates very well with my selfishness. Re-licensing

Re: [Haskell-cafe] Hmm, what license to use?

2008-09-26 Thread Thomas Davie
On 26 Sep 2008, at 12:12, Janis Voigtlaender wrote: Manlio Perillo wrote: When I compare GPL and MIT/BSD licenses, I do a simple reasoning. Suppose a doctor in a battle field meet a badly injuried enemy. Should he help the enemy? I'm so glad I don't understand this ;-) Should you decide

Re: [Haskell-cafe] Hmm, what license to use?

2008-09-26 Thread Thomas Davie
On 26 Sep 2008, at 12:28, Dougal Stanton wrote: On Fri, Sep 26, 2008 at 11:17 AM, Thomas Davie [EMAIL PROTECTED] wrote: Should you decide not to give someone something based on the fact that you either don't like them, or don't like what they'll do with the thing you give them

Re: [Haskell-cafe] Hmm, what license to use?

2008-09-26 Thread Thomas Davie
On 26 Sep 2008, at 17:51, Jonathan Cast wrote: On Fri, 2008-09-26 at 12:17 +0200, Thomas Davie wrote: On 26 Sep 2008, at 12:12, Janis Voigtlaender wrote: Manlio Perillo wrote: When I compare GPL and MIT/BSD licenses, I do a simple reasoning. Suppose a doctor in a battle field meet a badly

Re: [Haskell-cafe] Re: Red-Blue Stack

2008-09-26 Thread Thomas Davie
On 26 Sep 2008, at 19:18, Stephan Friedrichs wrote: apfelmus wrote: [..] Persistent data structures are harder to come up with than ephemeral ones, [...] Yes, in some cases it's quite hard to find a persistent solution for a data structure that is rather trivial compared to its ephemeral

Re: [Haskell-cafe] Climbing up the shootout...

2008-09-22 Thread Thomas Davie
On 22 Sep 2008, at 11:46, Manlio Perillo wrote: Don Stewart ha scritto: Thanks to those guys who've submitted parallel programs to the language benchmarks game, we're climbing up the rankings, now in 3rd, and ahead of C :) This is cheating, IMHO. Some test comparisons are unfair. The

Re: [Haskell-cafe] Predicativity?

2008-09-17 Thread Thomas Davie
On 17 Sep 2008, at 07:05, Wei Hu wrote: Hello, I only have a vague understanding of predicativity/impredicativity, but cannot map this concept to practice. We know the type of id is forall a. a - a. I thought id could not be applied to itself under predicative polymorphism. But Haksell

Re: [Haskell-cafe] Unicode and Haskell

2008-09-09 Thread Thomas Davie
On 10 Sep 2008, at 00:01, Mattias Bengtsson wrote: Today i wrote some sample code after a Logic lecture at my university. The idea is to represent the AST of propositional logic as an ADT with some convenience functions (like read-/show instances) and then later perhaps try to make some

Re: Re[2]: [Haskell-cafe] Pure hashtable library

2008-08-27 Thread Thomas Davie
On 27 Aug 2008, at 10:09, Bulat Ziganshin wrote: Hello Jason, Wednesday, August 27, 2008, 11:55:31 AM, you wrote: given these constraints, it should be just a 10-20 lines of code, and provide much better efficiency than any tree/trie implementations Much better efficiency in what way?

Re: Re[2]: [Haskell-cafe] Pure hashtable library

2008-08-27 Thread Thomas Davie
On 27 Aug 2008, at 10:39, Bayley, Alistair wrote: From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Thomas Davie Much better efficiency in what way? instead of going through many levels of tree/trie, lookup function will just select array element by hash value

Re: [Haskell-cafe] Haskell Propeganda

2008-08-24 Thread Thomas Davie
On 24 Aug 2008, at 05:04, Albert Y. C. Lai wrote: Dear friends, Haskell prevents more errors and earlier. This is honest, relevant, good advocacy. Dear friends, segfaults are type errors, not logical errors. Why would you indulge in this? It's even less relevant than bikeshed colours.

Re: [Haskell-cafe] Haskell Speed Myth

2008-08-24 Thread Thomas Davie
On 24 Aug 2008, at 01:26, Brandon S. Allbery KF8NH wrote: On 2008 Aug 23, at 18:34, Krzysztof Skrzętnicki wrote: Recently I wrote computation intensive program that could easily utilize both cores. However, there was overhead just from compiling with -threaded and making some forkIO's. Still,

Re: [Haskell-cafe] Haskell Speed Myth

2008-08-24 Thread Thomas Davie
On 24 Aug 2008, at 06:31, Thomas M. DuBuisson wrote: That's really interesting -- I just tried this. Compiling not using -threaded: 1.289 seconds Compiling using -threaded, but not running with -N2: 3.403 seconds Compiling using -threaded, and using -N2: 55.072 seconds I was hoping to

Re: [Haskell-cafe] String to Double conversion in Haskell

2008-08-24 Thread Thomas Davie
On 24 Aug 2008, at 23:23, Don Stewart wrote: dmehrtash: I am trying to convert a string to a float. It seems that Data.ByteString library only supports readInt.After some googling I came accross a possibloe implementation: [1]http://sequence.svcs.cs.pdx.edu/node/373 Use the

[Haskell-cafe] Haskell Speed Myth

2008-08-23 Thread Thomas Davie
Lo guys, I thought you'd like to know about this result. I've been playing with the debian language shootout programs under OS X, looking at how fast Haskell code is compared to C on OS X, rather than linux. Interestingly, Haskell comes out rather better on OS X than it did on Linux.

Re: [Haskell-cafe] Haskell Speed Myth

2008-08-23 Thread Thomas Davie
On 23 Aug 2008, at 20:01, Luke Palmer wrote: 2008/8/23 Thomas Davie [EMAIL PROTECTED]: Finally, that threading example... WOW! 65 times faster, and the code is *really* simple. The C on the other hand is a massive mess. I've been wondering about this, but I can't check because I don't

[Haskell-cafe] Haskell Propeganda

2008-08-23 Thread Thomas Davie
Today I made an interesting discovery. We all know the benefits of a strong type system, and often tout it as a major advantage of using Haskell. The discovery I made, was that C programmer don't realise the implications of that, as this comment highlights:

Re: [Haskell-cafe] Haskell Propeganda

2008-08-23 Thread Thomas Davie
On 23 Aug 2008, at 22:36, Matus Tejiscak wrote: On So, 2008-08-23 at 22:16 +0200, Thomas Davie wrote: Today I made an interesting discovery. We all know the benefits of a strong type system, and often tout it as a major advantage of using Haskell. The discovery I made, was that C

Re: [Haskell-cafe] Haskell Propeganda

2008-08-23 Thread Thomas Davie
On 23 Aug 2008, at 23:10, Tim Newsham wrote: I guess I didn't express my point very clearly... That C programmers apparently don't realise that a type system that's sound will give them something -- i.e. their programmer won't ever segfault. I wonder when we try to advertise Haskell if

<    1   2   3   >