[Haskell-cafe] Graham-Scan Algorithm exercise from Chapter 3 Real World Haskell

2009-01-19 Thread Michael Litchard
I have started the Graham Scan Algorithm exercise. I'm getting tripped up by the sortByCotangent* function. Here's what I have so far data Direction = DStraight | DLeft | DRight deriving (Eq,Show) type PointXY = (Double,Double) calcTurn :: PointXY -

[Haskell-cafe] Expect module?

2009-01-19 Thread Erik de Castro Lopo
Hi all, Is there a Haskell-Expect module? Something that would allow me to control an external Unix program via its stdin/stdout/stderr? Cheers, Erik -- - Erik de Castro Lopo

Re: [Haskell-cafe] Expect module?

2009-01-19 Thread Neil Mitchell
Hi Erik, Is there a Haskell-Expect module? Something that would allow me to control an external Unix program via its stdin/stdout/stderr? System.Process does what you want, I think: http://hackage.haskell.org/packages/archive/process/1.0.1.1/doc/html/System-Process.html Thanks Neil

[Haskell-cafe] Re: walking a directory tree efficiently

2009-01-19 Thread Paolo Losi
Massimiliano Gubinelli wrote: Hi, what about avoid the use of the unfold over the tree and construct it directly (e.g. see http://hpaste.org/13919#a3)? Nice solution! I wonder if there is (an easy) possibility to construct the tree lazily so that output start immediately for large trees.

Re: [Haskell-cafe] Graham-Scan Algorithm exercise from Chapter 3 Real World Haskell

2009-01-19 Thread Daniel Fischer
Am Montag, 19. Januar 2009 09:32 schrieb Michael Litchard: I have started the Graham Scan Algorithm exercise. I'm getting tripped up by the sortByCotangent* function. Here's what I have so far data Direction = DStraight | DLeft | DRight

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

2009-01-19 Thread Heinrich Apfelmus
david48 wrote: Apfelmus, Heinrich wrote: Hm, what about the option of opening Bird's Introduction on Functional Programming using Haskell in the section about fold? Monoid is on page 62 in the translated copy I've got here. I don't think that I would try to learn a programming language, for

Re: [Haskell-cafe] Graham-Scan Algorithm exercise from Chapter 3 Real World Haskell

2009-01-19 Thread Daniel Fischer
Am Montag, 19. Januar 2009 10:17 schrieb Daniel Fischer: Am Montag, 19. Januar 2009 09:32 schrieb Michael Litchard: I have started the Graham Scan Algorithm exercise. I'm getting tripped up by the sortByCotangent* function. Here's what I have so far data Direction = DStraight

[Haskell-cafe] Factoring into type classes

2009-01-19 Thread Patai Gergely
Hi everyone, I have a general program design question, but I can't really think of good examples so it will be a bit vague. There was a discussion on Show not long ago which brought up the problem that there are several ways to show a data structure, and it depends on the context (or should I

Re: [Haskell-cafe] Factoring into type classes

2009-01-19 Thread Eugene Kirpichov
As for multiple Monoid or Functor instances, simply define a newtype, as it is done in Data.Monoid. What part of your question does that answer and what part doesn't it? 2009/1/19 Patai Gergely patai_gerg...@fastmail.fm: Hi everyone, I have a general program design question, but I can't really

Re: [Haskell-cafe] Different return type?

2009-01-19 Thread Miran Lipovaca
Hello! I wouldn't use either. It seems like it complicates things quite a lot and it looks like this could be solved more simply by setting up the data types or organizing functions differently. Is there a specific problem that you're solving or are you just curious about different return

[Haskell-cafe] Re: Different return type?

2009-01-19 Thread Jon Fairbairn
John Ky newho...@gmail.com writes: Hi, Possibly a silly question but is it possible to have a function that has a different return type based on it's first argument? Are you sure that's what you really want? For instance data Person = Person { name :: String, ... } data Business =

[Haskell-cafe] Re: ANNOUNCE: Coadjute 0.0.1, generic build tool

2009-01-19 Thread Matti Niemenmaa
Brandon S. Allbery KF8NH wrote: On 2009 Jan 18, at 13:47, Matti Niemenmaa wrote: 3. Coadjute keeps track of command line arguments (see docs for details): for me this is really a killer feature, I don't know of anything else which does this. It's been done many times before; it never

Re: [Haskell-cafe] ANNOUNCE: Coadjute 0.0.1, generic build tool

2009-01-19 Thread Paul Moore
2009/1/18 Matti Niemenmaa matti.niemenmaa+n...@iki.fi: Announcing the release of Coadjute, version 0.0.1! [...] Portability is striven towards in two ways: Is it intended to work on Windows? (I don't want to spend time downloading and trying to set it up if it was never intended to be

Re: [Haskell-cafe] Factoring into type classes

2009-01-19 Thread Luke Palmer
On Mon, Jan 19, 2009 at 3:58 AM, Patai Gergely patai_gerg...@fastmail.fmwrote: However, there are other type classes that are too general to assign such concrete uses to. For instance, if a data structure can have more than one meaningful (and useful) Functor or Monoid instance, As a side

[Haskell-cafe] Re: Different return type?

2009-01-19 Thread Chung-chieh Shan
John Ky newho...@gmail.com wrote in article bd4fcb030901181744i2b26172bv2328974ff911f...@mail.gmail.com in gmane.comp.lang.haskell.cafe: data Person = Person { name :: String, ... } data Business = Business { business_number :: Int, ...} key person = name person key business =

[Haskell-cafe] Re: ANNOUNCE: Coadjute 0.0.1, generic build tool

2009-01-19 Thread Matti Niemenmaa
Paul Moore wrote: 2009/1/18 Matti Niemenmaa matti.niemenmaa+n...@iki.fi: Announcing the release of Coadjute, version 0.0.1! [...] Portability is striven towards in two ways: Is it intended to work on Windows? (I don't want to spend time downloading and trying to set it up if it was never

[Haskell-cafe] Re: Bug in Text.Regex.PCRE - do not accept national symbol in pattern

2009-01-19 Thread ChrisK
Alexandr, Thanks for sending me this question about unicode and regex-pcre. I will share with the mailing list. This is an encoding issue. From the haddock documentation for regex-pcre: http://hackage.haskell.org/packages/archive/regex-pcre/0.94.1/doc/html/Text-Regex-PCRE.html Using the

Re: [Haskell-cafe] Factoring into type classes

2009-01-19 Thread Antoine Latter
2009/1/19 Luke Palmer lrpal...@gmail.com: As a side curiosity, I would love to see an example of any data structure which has more than one Functor instance. Especially those which have more than one useful functor instance. (,) ? -Antoine ___

Re: [Haskell-cafe] Factoring into type classes

2009-01-19 Thread Thomas DuBuisson
2009/1/19 Luke Palmer lrpal...@gmail.com: On Mon, Jan 19, 2009 at 3:58 AM, Patai Gergely patai_gerg...@fastmail.fm wrote: However, there are other type classes that are too general to assign such concrete uses to. For instance, if a data structure can have more than one meaningful (and

Re: [Haskell-cafe] Factoring into type classes

2009-01-19 Thread Daniel Fischer
Am Montag, 19. Januar 2009 14:31 schrieb Antoine Latter: 2009/1/19 Luke Palmer lrpal...@gmail.com: As a side curiosity, I would love to see an example of any data structure which has more than one Functor instance. Especially those which have more than one useful functor instance. (,) ?

Re: [Haskell-cafe] Factoring into type classes

2009-01-19 Thread Holger Siegel
Am Montag, den 19.01.2009, 14:47 +0100 schrieb Daniel Fischer: Am Montag, 19. Januar 2009 14:31 schrieb Antoine Latter: 2009/1/19 Luke Palmer lrpal...@gmail.com: As a side curiosity, I would love to see an example of any data structure which has more than one Functor instance. Especially

Re: [Haskell-cafe] Re: ANNOUNCE: Coadjute 0.0.1, generic build tool

2009-01-19 Thread Nicolas Pouillard
Excerpts from Matti Niemenmaa's message of Sun Jan 18 19:47:46 +0100 2009: Henning Thielemann wrote: Matti Niemenmaa schrieb: Announcing the release of Coadjute, version 0.0.1! Web site: http://iki.fi/matti.niemenmaa/coadjute/ Hackage:

Fwd: [Haskell-cafe] runghc Setup.hs doitall

2009-01-19 Thread Alberto G. Corona
I finally installed cabal-install in windows.. I had a copy of sh.exe for windows time ago so I could use bootstrap. The only additional thing needed is wget(http://users.ugent.be/~bpuype/wget/). finally I moved the resulting cabal.exe to ghc/bin 2009/1/19 Duncan Coutts

[Haskell-cafe] Re: ANNOUNCE: Coadjute 0.0.1, generic build tool

2009-01-19 Thread Matti Niemenmaa
Nicolas Pouillard wrote: Excerpts from Matti Niemenmaa's message of Sun Jan 18 19:47:46 +0100 2009: 3. Coadjute keeps track of command line arguments (see docs for details): for me this is really a killer feature, I don't know of anything else which does this. ocamlbuild does

Re: [Haskell-cafe] Factoring into type classes

2009-01-19 Thread Lennart Augustsson
The desugaring of (, a) would involve some type level lambda, and that's not something that is available (yet). -- Lennart On Mon, Jan 19, 2009 at 1:49 PM, Holger Siegel holgersiege...@yahoo.de wrote: Am Montag, den 19.01.2009, 14:47 +0100 schrieb Daniel Fischer: Am Montag, 19. Januar 2009

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

2009-01-19 Thread Robin Green
What guidelines should one follow to make Haskell code least-strict? -- Robin ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

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

2009-01-19 Thread ChrisK
Robin Green wrote: What guidelines should one follow to make Haskell code least-strict? Obviously the use of seq and bang-patterns make code more strict. Code is strict when it evaluates values to determine a pattern match. So avoiding that makes code lazier. Values are evaluated when

Re: [Haskell-cafe] runghc Setup.hs doitall

2009-01-19 Thread Alberto G. Corona
C:\Documents and Settings\Administratorcabal install plugins Resolving dependencies... cabal: dependencies conflict: ghc-6.10.1 requires Cabal ==1.6.0.1 however Cabal-1.6.0.1 was excluded because plugins-1.3.1 requires Cabal ==1.4.* 2009/1/19 Alberto G. Corona agocor...@gmail.com I finally

[Haskell-cafe] plugins can not be installed in ghc 6.10.1

2009-01-19 Thread Alberto G. Corona
Do really pluigins needs Cabal (=1.4 1.5) ??? C:\Documents and Settings\Administratorcabal install plugins Resolving dependencies... cabal: dependencies conflict: ghc-6.10.1 requires Cabal ==1.6.0.1 however Cabal-1.6.0.1 was excluded because plugins-1.3.1 requires Cabal ==1.4.*

Re: [Haskell-cafe] plugins can not be installed in ghc 6.10.1

2009-01-19 Thread Gwern Branwen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 2009/1/19 Alberto G. Corona : -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) iEYEAREKAAYFAkl0uKYACgkQvpDo5Pfl1oJ30wCfQzX80TulZxyyLLyaAcU/LPVc PPMAoJl8tjhfrlWwoQ9yVGXlXStMDs+O =lf6T -END PGP SIGNATURE- Do really pluigins

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

2009-01-19 Thread Thomas DuBuisson
On Mon, Jan 19, 2009 at 4:48 PM, Robin Green gree...@greenrd.org wrote: What guidelines should one follow to make Haskell code least-strict? There was a great Cafe discussion started by Henning on just this. He provided this link: http://www.haskell.org/haskellwiki/Maintaining_laziness

Re: [Haskell-cafe] Factoring into type classes

2009-01-19 Thread Patai Gergely
As a side curiosity, I would love to see an example of any data structure which has more than one Functor instance. Especially those which have more than one useful functor instance. data Record a b = R { field1 :: a, field2 :: b } If I want to use fmap to transform either field, I have to

Re: [Haskell-cafe] Expect module?

2009-01-19 Thread Donn Cave
Quoth Neil Mitchell ndmitch...@gmail.com: Is there a Haskell-Expect module? Something that would allow me to control an external Unix program via its stdin/stdout/stderr? System.Process does what you want, I think: It might not. Expect uses pseudottys (cf. openpty()), and select().

[Haskell-cafe] Re: ANN: hledger 0.3 released

2009-01-19 Thread Sebastian Sylvan
The cabal file still includes the vty dependency, but simply removing it made it compile. -- From: Simon Michael si...@joyful.com Sent: Sunday, January 18, 2009 7:04 PM To: Sebastian Sylvan sebastian.syl...@gmail.com Cc: hled...@googlegroups.com;

Re: [Haskell-cafe] plugins can not be installed in ghc 6.10.1

2009-01-19 Thread Don Stewart
agocorona: Do really pluigins needs Cabal (=1.4 1.5) ??? C:\Documents and Settings\Administratorcabal install plugins Resolving dependencies... cabal: dependencies conflict: ghc-6.10.1 requires Cabal ==1.6.0.1 however Cabal-1.6.0.1 was excluded because plugins-1.3.1 requires

Re: [Haskell-cafe] Expect module?

2009-01-19 Thread Brandon S. Allbery KF8NH
On 2009 Jan 19, at 3:47, Neil Mitchell wrote: Is there a Haskell-Expect module? Something that would allow me to control an external Unix program via its stdin/stdout/stderr? System.Process does what you want, I think:

[Haskell-cafe] Haskell WikiProject

2009-01-19 Thread Robin Green
Is anyone else interested in forming a Haskell WikiProject on Wikipedia, to collaborate on improving and maintaining the coverage and quality of articles on Haskell-related software and topics (broadly defined)? Not just programming topics specific to Haskell, but also ones of interest to the

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

2009-01-19 Thread Robin Green
On Mon, 19 Jan 2009 17:36:30 + Thomas DuBuisson thomas.dubuis...@gmail.com wrote: On Mon, Jan 19, 2009 at 4:48 PM, Robin Green gree...@greenrd.org wrote: What guidelines should one follow to make Haskell code least-strict? There was a great Cafe discussion started by Henning on just

Re: [Haskell-cafe] Haskell WikiProject

2009-01-19 Thread Don Stewart
greenrd: Is anyone else interested in forming a Haskell WikiProject on Wikipedia, to collaborate on improving and maintaining the coverage and quality of articles on Haskell-related software and topics (broadly defined)? Not just programming topics specific to Haskell, but also ones of

Re: [Haskell-cafe] Factoring into type classes

2009-01-19 Thread Iavor Diatchki
Hello, The multitude of newtypes in the Monoid module are a good indication that the Monoid class is not a good fit for the class system (it is ironic that discussing it resulted in such a huge thread recently :-). How I'd approach the situation that you describe would depend on the context

[Haskell-cafe] Re: some ideas for Haskell', from Python

2009-01-19 Thread ChrisK
Manlio Perillo wrote: Brandon S. Allbery KF8NH ha scritto: ...in theory. In practice GHC needs help with circular imports, and some cycles might be impossible to resolve. This is interesting. Where can I find some examples? Is this explained in the Real World Haskell book? I have no

Re: [Haskell-cafe] Haskell WikiProject

2009-01-19 Thread Roman Cheplyaka
* Robin Green gree...@greenrd.org [2009-01-19 18:46:43+] Here's a good example to start with. The article on Eager evaluation could do with some improvement - and possibly should be merged into the Lazy evaluation article, I'm not sure: http://en.wikipedia.org/wiki/Eager_evaluation I

Re: [Haskell-cafe] Factoring into type classes

2009-01-19 Thread Jonathan Cast
On Mon, 2009-01-19 at 10:59 -0800, Iavor Diatchki wrote: Hello, The multitude of newtypes in the Monoid module are a good indication that the Monoid class is not a good fit for the class system I would say rather that the class system is not a good fit for Monoid. Proposals for local

Re: [Haskell-cafe] Open unqualified imports

2009-01-19 Thread Ian Lynagh
On Fri, Jan 16, 2009 at 06:42:46AM -0800, eyal.lo...@gmail.com wrote: Closed-unqualified import: import Data.Map(Map, lookup) One problem with this style is that you can get lots of conflicts from your VCS if you have multiple people working on the same module. Thanks Ian

Re: [Haskell-cafe] Expect module?

2009-01-19 Thread Erik de Castro Lopo
Donn Cave wrote: Quoth Neil Mitchell ndmitch...@gmail.com: Is there a Haskell-Expect module? Something that would allow me to control an external Unix program via its stdin/stdout/stderr? System.Process does what you want, I think: It might not. Expect uses pseudottys (cf.

[Haskell-cafe] Re: Improved documentation for Bool

2009-01-19 Thread Andrew Coppin
rocon...@theorem.ca wrote: I noticed the Bool datatype isn't well documented. Since Bool is not a common English word, I figured it could use some haddock to help clarify it for newcomers. My only problem with it is that it's called Bool, while every other programming language on Earth

[Haskell-cafe] Employment

2009-01-19 Thread Andrew Coppin
Is it possible to earn money using Haskell? Does anybody here actually do this? Inquiring minds want to know... ;-) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Employment

2009-01-19 Thread Andrew Wagner
http://www.haskell.org/haskellwiki/Haskell_in_industry could be of interest to you On Mon, Jan 19, 2009 at 2:34 PM, Andrew Coppin andrewcop...@btinternet.comwrote: Is it possible to earn money using Haskell? Does anybody here actually do this? Inquiring minds want to know... ;-)

Re: [Haskell-cafe] Re: Improved documentation for Bool

2009-01-19 Thread Jonathan Cast
On Mon, 2009-01-19 at 19:33 +, Andrew Coppin wrote: rocon...@theorem.ca wrote: I noticed the Bool datatype isn't well documented. Since Bool is not a common English word, I figured it could use some haddock to help clarify it for newcomers. My only problem with it is that it's

Re: [Haskell-cafe] Employment

2009-01-19 Thread David Leimbach
On Mon, Jan 19, 2009 at 11:34 AM, Andrew Coppin andrewcop...@btinternet.com wrote: Is it possible to earn money using Haskell? Does anybody here actually do this? Inquiring minds want to know... ;-) I'm using it at work in simulations... not shipping anything with it yet, but we do ship

Re: [Haskell-cafe] Haskell WikiProject

2009-01-19 Thread Gwern Branwen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Mon, Jan 19, 2009 at 1:46 PM, Robin Green wrote: Is anyone else interested in forming a Haskell WikiProject on Wikipedia, to collaborate on improving and maintaining the coverage and quality of articles on Haskell-related software and topics

Re: [Haskell-cafe] Employment

2009-01-19 Thread Phil
Barclays Capital use it for Equity Derivative modeling and pricing - it's a small team at the moment, but the whole project is in Haskell. I don't work on it myself so I couldn't give you any details (plus I would get fired for blabbing!), I work in an adjacent group. Haskell certainly lends

Re: [Haskell-cafe] Employment

2009-01-19 Thread Don Stewart
And of course, there's at least half a dozen people on this list at working at Galois. And all documented on the wiki, http://haskell.org/haskellwiki/Haskell_in_industry See you guys at CUFP 09! http://cufp.galois.com/ -- Don pbeadling: Barclays Capital use it for Equity

Re: [Haskell-cafe] Factoring into type classes

2009-01-19 Thread Iavor Diatchki
Hi, On Mon, Jan 19, 2009 at 11:06 AM, Jonathan Cast jonathancc...@fastmail.fm wrote: On Mon, 2009-01-19 at 10:59 -0800, Iavor Diatchki wrote: Hello, The multitude of newtypes in the Monoid module are a good indication that the Monoid class is not a good fit for the class system I would say

Re: [Haskell-cafe] Factoring into type classes

2009-01-19 Thread Alberto G. Corona
This is one of the shortcomings of haskell not to mention other programming languages. Mathemathicist would find it very annoying. Instead of instance Monoid Integer where mappend = (+) mempty = 0 instance Monoid Integer where mappend = (*) mempty = 1 which is not legal and the

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

2009-01-19 Thread Ryan Ingram
On Mon, Jan 19, 2009 at 9:10 AM, ChrisK hask...@list.mightyreason.com wrote: Consider that the order of pattern matching can matter as well, the simplest common case being zip: zip xs [] = [] zip [] ys = [] zip (x:xs) (y:ys) = (x,y) : zip xs ys If you are obsessive about least-strictness

Re: [Haskell-cafe] Re: Improved documentation for Bool

2009-01-19 Thread Dan Piponi
On Mon, Jan 19, 2009 at 11:33 AM, Andrew Coppin andrewcop...@btinternet.com wrote: My only problem with it is that it's called Bool, while every other programming language on Earth calls it Boolean. (Or at least, the languages that *have* a name for it...) Python: bool ocaml: bool C++: bool

Re: [Haskell-cafe] Factoring into type classes

2009-01-19 Thread Jonathan Cast
On Mon, 2009-01-19 at 12:10 -0800, Iavor Diatchki wrote: I usually avoid using the newtype trick as I find it inconvenient: usually the newtype does not have the same operations as the underlying type and so it cannot be used directly, and if you are going to wrap thing just when you

Re: [Haskell-cafe] Factoring into type classes

2009-01-19 Thread Derek Elkins
On Mon, 2009-01-19 at 21:18 +0100, Alberto G. Corona wrote: This is one of the shortcomings of haskell not to mention other programming languages. Mathemathicist would find it very annoying. Instead of instance Monoid Integer where mappend = (+) mempty = 0 instance Monoid

[Haskell-cafe] Haskell Weekly News: Issue 101 - January 19, 2009

2009-01-19 Thread Brent Yorgey
--- Haskell Weekly News http://sequence.complete.org/hwn/20090119 Issue 101 - January 19, 2009 --- Welcome to issue 101 of HWN, a newsletter covering

Re: [Haskell-cafe] Employment

2009-01-19 Thread Jeff Heard
Haskell's all I use at work, although no-one requires it. I know that Ravi Nanavati's company uses Haskell pretty exclusively, and there's also Galois and a couple of financial houses. I was pretty impressed with the professional turnout for ICFP 2008. -- Jeff On Mon, Jan 19, 2009 at 2:34 PM,

Re: [Haskell-cafe] Factoring into type classes

2009-01-19 Thread Miguel Mitrofanov
I'd prefer something like Sum :: Monoid Integer Sum = Monoid {mappend = (+), mempty = 0} Prod :: Monoid Integer Prod = Monoid {mappend = (*), mempty = 1} instance Sum in [some code using mempty and mappend] On 19 Jan 2009, at 23:18, Alberto G. Corona wrote: This is one of the shortcomings of

Re: [Haskell-cafe] Employment

2009-01-19 Thread John Goerzen
Andrew Coppin wrote: Is it possible to earn money using Haskell? Does anybody here actually do this? Inquiring minds want to know... ;-) I work for a company that designs, builds, and sells lawn mowers (hustlerturf.com). We use quite a bit of Haskell, especially as a glue language for

[Haskell-cafe] MonadTrans lift implementation

2009-01-19 Thread Daryoush Mehrtash
Is there a reason why the lift function in ReaderT's MonadTrans instance is implemented as: instance MonadTrans (ReaderT r) where lift m = ReaderT $ \_ - m Instead of just using the monad's return function? Could lift m be implemented as return m? instance (Monad m) = Monad (ReaderT

Re: [Haskell-cafe] MonadTrans lift implementation

2009-01-19 Thread Brent Yorgey
On Mon, Jan 19, 2009 at 01:03:55PM -0800, Daryoush Mehrtash wrote: lift m = ReaderT $ \_ - m return a = ReaderT $ \_ - return a If you look carefully you will see that these are not the same. -Brent ___ Haskell-Cafe mailing list

[Haskell-cafe] LinuxFest Northwest 2009

2009-01-19 Thread Shachaf Ben-Kiki
LFNW 2009 (http://linuxfestnorthwest.org/) is going to be at the end of April, and I was wondering if anyone here is going to be there, or possibly a Haskell-related presentation. Last year I met ac from #haskell there, but it would be nice if more people came, especially with the (relatively)

Re: [Haskell-cafe] MonadTrans lift implementation

2009-01-19 Thread Ross Paterson
On Mon, Jan 19, 2009 at 01:13:37PM -0800, Jonathan Cast wrote: (On the other hand, your hunch that lift = return is correct --- so you get a cookie for that; it's just that return here is neither the return of the monad for m nor the return of the monad for ReaderT m. It is, instead, the

[Haskell-cafe] GLUT (glutGet undefined reference)

2009-01-19 Thread Paul Keir
Hi all, I was hoping to introduce my old pal OpenGL with my new chum, Haskell. I used cabal to install GLUT on my 64-bit Ubuntu machine with GHC 6.8.2 (installed via apt-get/synaptic). I followed the wiki OpenGLTutorial1 until: ghc -package GLUT HelloWorld.hs -o HelloWorld at which point my

Re: [Haskell-cafe] GLUT (glutGet undefined reference)

2009-01-19 Thread Eugene Kirpichov
Have you tried http://netsuperbrain.com/blog/posts/freeglut-windows-hopengl-hglut/ ? 2009/1/20 Paul Keir pk...@dcs.gla.ac.uk: Hi all, I was hoping to introduce my old pal OpenGL with my new chum, Haskell. I used cabal to install GLUT on my 64-bit Ubuntu machine with GHC 6.8.2 (installed

Re: [Haskell-cafe] GLUT (glutGet undefined reference)

2009-01-19 Thread Eugene Kirpichov
Ouch. Sorry, I misread your post: I thought you were having troubles on Windows. 2009/1/20 Eugene Kirpichov ekirpic...@gmail.com: Have you tried http://netsuperbrain.com/blog/posts/freeglut-windows-hopengl-hglut/ ? 2009/1/20 Paul Keir pk...@dcs.gla.ac.uk: Hi all, I was hoping to

Re: [Haskell-cafe] MonadTrans lift implementation

2009-01-19 Thread Jonathan Cast
On Mon, 2009-01-19 at 21:31 +, Ross Paterson wrote: On Mon, Jan 19, 2009 at 01:13:37PM -0800, Jonathan Cast wrote: (On the other hand, your hunch that lift = return is correct --- so you get a cookie for that; it's just that return here is neither the return of the monad for m nor the

Re: [Haskell-cafe] Factoring into type classes

2009-01-19 Thread Derek Elkins
On Mon, 2009-01-19 at 12:10 -0800, Iavor Diatchki wrote: Hi, On Mon, Jan 19, 2009 at 11:06 AM, Jonathan Cast jonathancc...@fastmail.fm wrote: On Mon, 2009-01-19 at 10:59 -0800, Iavor Diatchki wrote: Hello, The multitude of newtypes in the Monoid module are a good indication that the

[Haskell-cafe] xhtml + bytestring

2009-01-19 Thread Joachim Breitner
Hi Bjorn, hi list, the darcswatch instance I’m running is getting quite big, and it periodically slows down my server. I managed to get quite an improvement with this simple patch to my parsing:

Re: [Haskell-cafe] Employment

2009-01-19 Thread Andrew Coppin
Erik de Castro Lopo wrote: Its proabably a little harder to find a company that wants a Haskell hacker than it is to find a company where Haskell and other sane languages can be worked in over time. I think you're probably right about that. ;-) I mean, heck, *I* use Haskell at work - and

Re: [Haskell-cafe] Employment

2009-01-19 Thread Andrew Coppin
Andrew Wagner wrote: http://www.haskell.org/haskellwiki/Haskell_in_industry could be of interest to you Hmm, interesting... So lots happening in Portland, Oregon. Lots in Cambridge, MA. A few things in Europe. And nothing at all in the UK... ___

Re: [Haskell-cafe] GLUT (glutGet undefined reference)

2009-01-19 Thread Felipe Lessa
2009/1/19 Paul Keir pk...@dcs.gla.ac.uk: I was hoping to introduce my old pal OpenGL with my new chum, Haskell. I used cabal to install GLUT on my 64-bit Ubuntu machine with GHC 6.8.2 (installed via apt-get/synaptic). I'm sorry, I can't help you with your problem. But I'd recommend you using

RE: [Haskell-cafe] Employment

2009-01-19 Thread Sittampalam, Ganesh
Andrew Coppin wrote: Andrew Wagner wrote: http://www.haskell.org/haskellwiki/Haskell_in_industry could be of interest to you Hmm, interesting... So lots happening in Portland, Oregon. Lots in Cambridge, MA. A few things in Europe. And nothing at all in the UK... We (Credit Suisse) have

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

2009-01-19 Thread Conal Elliott
I second Ryan's recommendation of using unamb [1,2,3] to give you unbiased (symmetric) laziness. The zip definition could also be written as zip xs@(x:xs') ys@(y:ys') = assuming (xs == []) [] `unamb` assuming (ys == []) [] `unamb` (x,y) : zip xs' ys' The 'assuming'

Re: [Haskell-cafe] Employment

2009-01-19 Thread Jonathan Cast
On Mon, 2009-01-19 at 21:04 +, Andrew Coppin wrote: Erik de Castro Lopo wrote: Its proabably a little harder to find a company that wants a Haskell hacker than it is to find a company where Haskell and other sane languages can be worked in over time. I think you're probably

Re: [Haskell-cafe] Re: Improved documentation for Bool

2009-01-19 Thread Jonathan Cast
On Mon, 2009-01-19 at 20:55 +, Andrew Coppin wrote: Dan Piponi wrote: On Mon, Jan 19, 2009 at 11:33 AM, Andrew Coppin andrewcop...@btinternet.com wrote: My only problem with it is that it's called Bool, while every other programming language on Earth calls it Boolean. (Or at

Re: [Haskell-cafe] xhtml + bytestring

2009-01-19 Thread Eugene Kirpichov
I think that your instance is too specific, although useful for the particular case of escaping. I've done my own implementation for fun: concatMap' :: (Word8 - L.ByteString) - L.ByteString - L.ByteString concatMap' f s = L.unfoldr p x0 where x0 = (LI.Empty, s, 0, 0) p (LI.Empty,

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

2009-01-19 Thread Ryan Ingram
Actually, I see a nice pattern here for unamb + pattern matching: zip xs ys = foldr unamb undefined [p1 xs ys, p2 xs ys, p3 xs ys] where p1 [] _ = [] p2 _ [] = [] p3 (x:xs) (y:ys) = (x,y) : zip xs ys Basically, split each pattern out into a separate function (which by definition

[Haskell-cafe] Current research on overlapping/closed type families?

2009-01-19 Thread Ryan Ingram
What's the status of overlapping/closed type families? I'm interested in something like the following, which can currently be implemented in GHC with Oleg-magic using functional dependencies, but cannot, to my knowledge, be implemented with type families: data HTrue = HTrue data HFalse = HFalse

Re: [Haskell-cafe] MonadTrans lift implementation

2009-01-19 Thread ajb
G'day all. Quoting Jonathan Cast jonathancc...@fastmail.fm: (By the way, you *do* have the equations lift (return x) = return x [...] Right. And you could, at least in principle, implement return this way in all monad transformers. Cheers, Andrew Bromage

Re: [Haskell-cafe] Employment

2009-01-19 Thread Thomas DuBuisson
Hmm, interesting... So lots happening in Portland, Oregon. Lots in Cambridge, MA. A few things in Europe. And nothing at all in the UK... Nothing in the UK? Lets not forget MSR and Well-Typed! ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Re: Improved documentation for Bool

2009-01-19 Thread ajb
G'day all. On Mon, 2009-01-19 at 19:33 +, Andrew Coppin wrote: My only problem with it is that it's called Bool, while every other programming language on Earth calls it Boolean. (Or at least, the languages that *have* a name for it...) Jonathan Cast commented: Except C++? And

Re: [Haskell-cafe] LinuxFest Northwest 2009

2009-01-19 Thread Thomas DuBuisson
I might go - I'll certainly keep an eye on the page. It would be more likely if I could find a group driving from Portland. Tom On Mon, Jan 19, 2009 at 9:25 PM, Shachaf Ben-Kiki shac...@gmail.com wrote: LFNW 2009 (http://linuxfestnorthwest.org/) is going to be at the end of April, and I was

Re: [Haskell-cafe] know a workaround for greedy context reduction?

2009-01-19 Thread Nicolas Frisby
I revisited the Strongly typed Heterogeneous Lists paper and read about the import hierarchy technique. The basic idea is to delay importing the instances until as late as possible, which prevents the context simplification. The instances are effectively imported in the top, Main module. I'm

[Haskell-cafe] GHCi Memory Leak in Windows Vista

2009-01-19 Thread spam . andir
Hi all! Environment: Windows Vista + SP1, GHC 6.10.1. Description: If use ghci.exe and run separate ghc.exe compiler process, memory leak in ghci occurred. After exhausting available memory Vista has no responding. Steps for reproduce: 1) After run GHCi, process list has 2 processes:

Re: [Haskell-cafe] Employment

2009-01-19 Thread Tom Hawkins
On Mon, Jan 19, 2009 at 3:04 PM, Andrew Coppin andrewcop...@btinternet.com wrote: Like many people I'm sure, I'd like to get paid to code stuff in Haskell. But I can't begin to imagine how you go about doing that... At Eaton, we're using Haskell to design automotive control systems (see

Re: [Haskell-cafe] Re: Improved documentation for Bool

2009-01-19 Thread David Menendez
On Mon, Jan 19, 2009 at 7:22 PM, a...@spamcop.net wrote: And perhaps more to the point, Boolean is an adjective, not a noun. Therefore, it would be better reserved for a typeclass. There's also John Meacham's Boolean package. http://repetae.net/recent/out/Boolean.html class (Heyting a) =

Re: [Haskell-cafe] Employment

2009-01-19 Thread Andrew Wagner
Such a database would help me counter by boss's argument that it's impossible to find and hire Haskell programmers. Err, people actually say such things? And they say _we're_ out of touch with the real world? ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Re: Improved documentation for Bool

2009-01-19 Thread Dan Piponi
On Mon, Jan 19, 2009 at 6:25 PM, David Menendez d...@zednenem.com wrote: Are there any instances of Boolean that aren't isomorphic to Bool? a-Bool for any a. I think. Though I think it should be called GeorgeBoolean otherwise we might confuse it for something his father might have invented. --

Re: [Haskell-cafe] Re: Improved documentation for Bool

2009-01-19 Thread ajb
G'day all. Quoting David Menendez d...@zednenem.com: Are there any instances of Boolean that aren't isomorphic to Bool? Sure. Two obvious examples: - The lattice of subsets of a universe set, where or is union and is intersection and not is complement with respect to the universe. -

Re: [Haskell-cafe] Re: Improved documentation for Bool

2009-01-19 Thread ajb
G'day all. I wrote: - Intuitionistic logic systems. - The truth values of an arbitrary topos (i.e. the points of the subobject classifier). Sorry, I misread the question. These are _not_ instances of Boolean (or at least the latter isn't an instance in general). Cheers, Andrew Bromage

Re: [Haskell-cafe] Re: Haskell and C++ program

2009-01-19 Thread S. Doaitse Swierstra
On 17 jan 2009, at 22:22, Derek Elkins wrote: On Thu, 2009-01-15 at 13:40 +0100, Apfelmus, Heinrich wrote: Eugene Kirpichov wrote: Well, your program is not equivalent to the C++ version, since it doesn't bail on incorrect input. Oops. That's because my assertion show . read = id is

Re: [Haskell-cafe] Re: Haskell and C++ program

2009-01-19 Thread Derek Elkins
On Mon, 2009-01-19 at 22:12 -0500, S. Doaitse Swierstra wrote: On 17 jan 2009, at 22:22, Derek Elkins wrote: On Thu, 2009-01-15 at 13:40 +0100, Apfelmus, Heinrich wrote: Eugene Kirpichov wrote: Well, your program is not equivalent to the C++ version, since it doesn't bail on incorrect

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

2009-01-19 Thread George Pollard
On Thu, 2009-01-15 at 18:10 -0500, Cale Gibbard wrote: My personal preference would be: class Monoid m where zero :: m (++) :: m - m - m (in the Prelude of course) - Cale I've tried doing this (and making more widespread use of typeclassed operations) by writing my own