Re: [Haskell-cafe] FRP, integration and differential equations.

2009-04-21 Thread Christopher Lane Hinson
I had this conversation recently. My experience with implementing RK4 in RSAGL led me to some contrary conclusions: First, ODEs aren't necessarily useful for interpreting externally sampled events, because you don't have the ability to run, i.e. RK4 against a mouse cursor position without

[Haskell-cafe] Cabal's default install location

2009-04-21 Thread Thomas Davie
There seems to be an assumption amongst the community that a user's home directory is the most useful place for cabal to install to by default. A few people have challenged that. I wanted to find out which one most people do actually prefer, so please go and vote on this poll.

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-21 Thread Jason Dagit
On Mon, Apr 20, 2009 at 10:21 PM, Richard O'Keefe o...@cs.otago.ac.nz wrote: On 21 Apr 2009, at 5:10 pm, Jason Dagit wrote: Plus, there was a movement to ban them: And somehow this means people don't? ...see the humor. BUT, here is the real point of my reply: To end this debate as to

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-21 Thread Edward Middleton
Richard O'Keefe wrote: On 21 Apr 2009, at 2:10 pm, Edward Middleton wrote: Using non-standard installation methods makes it harder for package maintainers to package the application and suggests you haven't taken any care / don't care about making global installation safe. I'm sorry, there

[Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-21 Thread Stefan Holdermans
I'm sorry, there is no such animal as safe global installation, in the sense of download this one package and do what it says. Well I have been doing that for more then 10 years, it is one of the functions any decent package management systems is designed to do. Time to adopt another goodie

Re: [Haskell-cafe] FRP, integration and differential equations.

2009-04-21 Thread jean-christophe mincke
Paul, Thank you for your reply. Integration is a tool to solve a some ODEs but ot all of them. Suppose all we have is a paper and a pencil and we need to symbolically solve: / t de(t)/dt = f(t) - the solution is given by

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-21 Thread david48
For what it's worth, It's bothered me often enough that cabal doesn't install globally by default that I had to reinstall ghc in order to solve package issues. So I'd prefer the default to be global. But I don't care that much, I don't think arguing that point is leading anywhere.

[Haskell-cafe] Re: Cabal's default install location

2009-04-21 Thread Achim Schneider
Thomas Davie tom.da...@gmail.com wrote: There seems to be an assumption amongst the community that a user's home directory is the most useful place for cabal to install to by default. A few people have challenged that. I wanted to find out which one most people do actually prefer, so

[Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-21 Thread Achim Schneider
Richard O'Keefe o...@cs.otago.ac.nz wrote: This is good advice (/usr/local is fine though). Actually, no, it isn't. To start with, these days it's chock full of stuff which is hardly less critical for system operation than anything you'll find in /bin. More importantly, /usr/local is a

[Haskell-cafe] Building regex-tdfa-1.1.1 documentation

2009-04-21 Thread j . romildo
Hello. I want to build regex-tdfa-1.1.1 haddock documentation locally, but the procedure fails: $ ./setup haddock Preprocessing library regex-tdfa-1.1.1... Running Haddock for regex-tdfa-1.1.1... Warning: The documentation for the following packages are not installed. No links will be generated

[Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-21 Thread Achim Schneider
Edward Middleton emiddle...@bebear.net wrote: ghc 6.8.3 is /usr/bin/ghc on my office Mac, but nothing in the world prevents there being some other program called ghc that would also like to be there. Only by painstaking verification of a whole bunch of applications together can one be

Re: [Haskell-cafe] FRP, integration and differential equations.

2009-04-21 Thread Paul L
Adam-Bashford method can be easily implemented to replace Euler's. But to really get higher accuracy, one may need variable time steps and perhaps even back tracking, which is an interesting topic on its own. But my question is, is FRP really the right setting in which to explore a highly accurate

Re: [Haskell-cafe] FRP, integration and differential equations.

2009-04-21 Thread Peter Verswyvelen
Well, the current FRP systems don't accurately solve this, since they just use an Euler integrator, as do many games. As long as the time steps are tiny enough this usually works good enough. But I wouldn't use these FRPs to guide an expensive robot or spaceship at high precision :-) On Tue, Apr

[Haskell-cafe] regex-tdfa: mkRegex and matchRegex in ghci

2009-04-21 Thread j . romildo
Hello. How mkRegex and matchRegex can be used with the regex-tdfa backend in ghci? The following fails: $ ghci GHCi, version 6.10.2: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading package base ...

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-21 Thread Edward Middleton
Achim Schneider wrote: Edward Middleton emiddle...@bebear.net wrote: ghc 6.8.3 is /usr/bin/ghc on my office Mac, but nothing in the world prevents there being some other program called ghc that would also like to be there. Only by painstaking verification of a whole bunch of

Re: [Haskell-cafe] FRP, integration and differential equations.

2009-04-21 Thread Peter Verswyvelen
Hey thanks for the Adam-Bashford tip, didn't know that one yet (although I used similar techniques in the past, didn't know it had a name :-) Well, solving the ODE is usually the task of a dedicated physics engine. But IMHO with FRP we try to reuse small building blocks so we get very modular

Re: [Haskell-cafe] FRP, integration and differential equations.

2009-04-21 Thread Peter Verswyvelen
BTW, a bit of topic, your recent work on causal commutative arrows and CCA compiler seems very promising. Any news on that? Seems that it could drastically speedup Yampa. On Tue, Apr 21, 2009 at 1:32 PM, Peter Verswyvelen bugf...@gmail.comwrote: Hey thanks for the Adam-Bashford tip, didn't know

[Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-21 Thread Achim Schneider
Richard O'Keefe o...@cs.otago.ac.nz wrote: Some of the right questions are - how many potential whatever users would need to have whatever installed on _some_ machine they do NOT have administrator access to? Irrelevant. - if people find Mac and Windows installers that show you

[Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-21 Thread Achim Schneider
Edward Middleton emiddle...@bebear.net wrote: Achim Schneider wrote: Edward Middleton emiddle...@bebear.net wrote: ghc 6.8.3 is /usr/bin/ghc on my office Mac, but nothing in the world prevents there being some other program called ghc that would also like to be there. Only by

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-21 Thread Xiao-Yong Jin
Achim Schneider bars...@web.de writes: Richard O'Keefe o...@cs.otago.ac.nz wrote: This is good advice (/usr/local is fine though). Actually, no, it isn't. To start with, these days it's chock full of stuff which is hardly less critical for system operation than anything you'll find in

Re: [Haskell-cafe] ANN: Elerea, another FRP library

2009-04-21 Thread Wolfgang Jeltsch
Am Donnerstag, 16. April 2009 10:06 schrieb Patai Gergely: unsafePerformIO is apparently never inlined, i.e. each instance is executed once, so sharing works as desired But expressions that use unsafePerformIO might get inlined. CSE is no problem either, it even helps if it's performed (and

Re: [Haskell-cafe] Re: Cabal's default install location

2009-04-21 Thread Miguel Mitrofanov
$ cat .cabal/config ... root-cmd: sudo ... user-install: False ... On 21 Apr 2009, at 14:41, Achim Schneider wrote: Thomas Davie tom.da...@gmail.com wrote: There seems to be an assumption amongst the community that a user's home directory is the most useful place for cabal to install to by

Re: [Haskell-cafe] Re: Cabal's default install location

2009-04-21 Thread Xiao-Yong Jin
Achim Schneider bars...@web.de writes: Thomas Davie tom.da...@gmail.com wrote: There seems to be an assumption amongst the community that a user's home directory is the most useful place for cabal to install to by default. A few people have challenged that. I wanted to find out

Is 78 characters still a good option? Was: [Haskell-cafe] breaking too long lines

2009-04-21 Thread Dusan Kolar
Dear all, reading that according the several style guides, lines shouldn't be too long (longer than 78 characters). http://www.cs.caltech.edu/courses/cs11/material/haskell/misc/haskell_style_guide.html http://www.haskell.org/haskellwiki/Programming_guidelines I would like to know, whether

[Haskell-cafe] Re: Is 78 characters still a good option? Was: breaking too long lines

2009-04-21 Thread Achim Schneider
Dusan Kolar ko...@fit.vutbr.cz wrote: Dear all, reading that according the several style guides, lines shouldn't be too long (longer than 78 characters). http://www.cs.caltech.edu/courses/cs11/material/haskell/misc/haskell_style_guide.html

Re: Is 78 characters still a good option? Was: [Haskell-cafe] breaking too long lines

2009-04-21 Thread Xiao-Yong Jin
Dusan Kolar ko...@fit.vutbr.cz writes: Dear all, reading that according the several style guides, lines shouldn't be too long (longer than 78 characters). http://www.cs.caltech.edu/courses/cs11/material/haskell/misc/haskell_style_guide.html

Re: Is 78 characters still a good option? Was: [Haskell-cafe] breaking too long lines

2009-04-21 Thread Neil Mitchell
Hi I believe it is a good practice too keep each line short and easy to read.  The following is taken from python style guide.  Maximum Line Length    Limit all lines to a maximum of 79 characters.    There are still many devices around that are limited to 80 character    lines; plus,

Re: [Haskell-cafe] UPDATE: haskellmode for Vim now at projects.haskell.org (+screencast; -)

2009-04-21 Thread Magnus Therning
I've finally found the time to take another look at your haskell mode for vim. Two questions so far: 1. I think earlier my indentation mode would match indentation of the previous line by default, after installing your scripts I always end up in column 1 after pressing return. Is there some

[Haskell-cafe] Re: Is 78 characters still a good option? Was: breaking too long lines

2009-04-21 Thread Christian Maeder
Dusan Kolar wrote: I would like to know, whether 78 characters bound still makes a sense... Yes, but I wouldn't fight for a single character. Even if I connect to my linux box with text terminal, it is not a 80x24 characters HW text terminal, but a window emulating this in whatever else OS,

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-21 Thread S. Doaitse Swierstra
Maybe it has gone unnoticed, but the main reason we made the compiler available, was to make it possible for others to experiment with its type extensions, its Grin based back-end and to show the advantages (and disadvantages?) of generating large part of the compiler from an attribute

Re: [Haskell-cafe] FRP, integration and differential equations.

2009-04-21 Thread jean-christophe mincke
Peter, Paul, But my question is, is FRP really the right setting in which to explore a highly accurate ODE solver? Well, solving the ODE is usually the task of a dedicated physics engine. But IMHO with FRP we try to reuse small building blocks so we get very modular systems; a big physics black

Re: [Haskell-cafe] Converting IO [XmlTree] to [XmlTree]

2009-04-21 Thread Manlio Perillo
Luke Palmer ha scritto: [...] Note that it is not always possible to separate IO from pure code. As an example, consider an HTTP 1.1 server that read a request body containing a number for each line, and return a response body containing the sum of the numbers. What?

Re: [Haskell-cafe] UPDATE: haskellmode for Vim now at projects.haskell.org (+screencast; -)

2009-04-21 Thread Claus Reinke
|I've finally found the time to take another look at your haskell mode |for vim. Two questions so far: |1. I think earlier my indentation mode would match indentation of the |previous line by default, after installing your scripts I always end |up in column 1 after pressing return. Is there

Re[2]: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-21 Thread Bulat Ziganshin
Hello S., Tuesday, April 21, 2009, 5:42:15 PM, you wrote: If we had been interested in raising fierce discussions about n+k patterns or how and where cabal installs things, we could have easily achieved the same effect with much less effort. you mean that we should shoot up? :) -- Best

Re: Re[2]: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-21 Thread Stefan Holdermans
If we had been interested in raising fierce discussions about n+k patterns or how and where cabal installs things, we could have easily achieved the same effect with much less effort. you mean that we should shoot up? :) If the release of UHC contributes to whatever discussion regarding

[Haskell-cafe] Re: Is 78 characters still a good option? Was: breaking too long lines

2009-04-21 Thread Dusan Kolar
The longer a line the more difficult it is to move the focus to the beginning of the next line when reading. Hmm, then I must be doing something wrong, I do not fully fill program lines... ;-) Or my comments are too short. I do not think, this is an issue, to catch the next line, if the

Re: Re[2]: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-21 Thread Lennart Augustsson
I think the only way your release is going to get significant feedback is when it's ready to compile substantial existing Haskell programs unaltered. I might try UHC on some toy example for a few minuts, but if it falls over when I give it code that I've already written I'll soon give up using it.

Re: [Haskell-cafe] ANNOUNCE: Runge-Kutta library -- solve ODEs

2009-04-21 Thread Uwe Hollerbach
That sounds fine... I think I'll pick Numeric. RungeKutta. I'll change it when I've cabalized hackage-ized this puppy... Uwe On 4/20/09, Alexander Dunlap alexander.dun...@gmail.com wrote: It would also be nice if you could plug it into the hierarchical module system somewhere, perhaps

Re: Is 78 characters still a good option? Was: [Haskell-cafe] breaking too long lines

2009-04-21 Thread Richard Kelsall
Dusan Kolar wrote: ... Or is the reason much deeper? Or, is the bound set to 78 characters just because it is as good number as any other? ... As a little historical detour I think the 80 character limit goes back to 1928 when IBM designed their punched card format

[Haskell-cafe] Comments from two weeks of using Leksah

2009-04-21 Thread Jeff Heard
I've been using the latest and greatest version of leksah for the last couple of weeks and I wanted to give a short report on the things I've found. First of all, it's crashed only once, and the error was an actual segfault, so I'm not sure what went wrong there. All in all, I like the eyecandy

Re: [Haskell-cafe] UPDATE: haskellmode for Vim now at projects.haskell.org (+screencast; -)

2009-04-21 Thread Magnus Therning
On Tue, Apr 21, 2009 at 2:51 PM, Claus Reinke claus.rei...@talk21.com wrote: |I've finally found the time to take another look at your haskell mode |for vim.  Two questions so far: |1. I think earlier my indentation mode would match indentation of the |previous line by default, after

Re: [Haskell-cafe] Comments from two weeks of using Leksah

2009-04-21 Thread Peter Verswyvelen
I've seen it on the Hackaton and was really impressed. Were you using it on Windows? I haven't tried it yet since I heard it has major problems on Windows. On Tue, Apr 21, 2009 at 5:06 PM, Jeff Heard jefferson.r.he...@gmail.comwrote: I've been using the latest and greatest version of leksah for

Re: [Haskell-cafe] Comments from two weeks of using Leksah

2009-04-21 Thread Jeff Heard
I'm using it on Ubuntu Linux 8.10 and on Mac OS X 10.5.x -- Jeff On Tue, Apr 21, 2009 at 11:12 AM, Peter Verswyvelen bugf...@gmail.com wrote: I've seen it on the Hackaton and was really impressed. Were you using it on Windows? I haven't tried it yet since I heard it has major problems on

Re: [Haskell-cafe] ANN: Elerea, another FRP library

2009-04-21 Thread Patai Gergely
But expressions that use unsafePerformIO might get inlined. That's true, but given the way this interface is used, this doesn't seem to be an issue, since there are typically no unsafePerformIO's hidden deep inside an expression without a chain of Elerea primitives leading to it. What about

Re: Is 78 characters still a good option? Was: [Haskell-cafe] breaking too long lines

2009-04-21 Thread Edward Kmett
I find a hard 80 character line length limit to be somewhat ridiculous in this day and age. I've long since revised my personal rule of thumb upwards towards 132, if only because I can still show two windows of that side by side with no worries, along with all the IDE browsing baggage, even on a

Re: Is 78 characters still a good option? Was: [Haskell-cafe] breaking too long lines

2009-04-21 Thread Xiao-Yong Jin
Edward Kmett ekm...@gmail.com writes: I find a hard 80 character line length limit to be somewhat ridiculous in this day and age. I've long since revised my personal rule of thumb upwards towards 132, if only because I can still show two windows of that side by side with no worries, along

Re: Is 78 characters still a good option? Was: [Haskell-cafe] breaking too long lines

2009-04-21 Thread Robert Greayer
Xiao-Yong Jin xj2...@columbia.edu wrote: Edward Kmett ekm...@gmail.com writes: I find a hard 80 character line length limit to be somewhat ridiculous in this day and age. I've long since revised my personal rule of thumb upwards towards 132, if only because I can still show two

Re: [Haskell-cafe] UPDATE: haskellmode for Vim now at projects.haskell.org (+screencast; -)

2009-04-21 Thread Claus Reinke
|Yes, I found that one myself. My old ftplugin/haskell.vim used to |have autoindent set, but importing your haskell mode overwrote that |(slightly irritating behaviour if you ask me ;-). Putting my old |config into ftplugin/haskell_mine.vim restored the behaviour. Yes, one cannot have two

Re: Is 78 characters still a good option? Was: [Haskell-cafe] breaking too long lines

2009-04-21 Thread Xiao-Yong Jin
Robert Greayer robgrea...@yahoo.com writes: Xiao-Yong Jin xj2...@columbia.edu wrote: Edward Kmett ekm...@gmail.com writes: I find a hard 80 character line length limit to be somewhat ridiculous in this day and age. I've long since revised my personal rule of thumb upwards towards

Re: [Haskell-cafe] Comments from two weeks of using Leksah

2009-04-21 Thread Martijn van Steenbergen
Jeff Heard wrote: First of all, it's crashed only once, and the error was an actual segfault, so I'm not sure what went wrong there. All in all, I like the eyecandy and have left it on for everything I do, but I've noticed that arrows have an extra space after them, no matter which arrow. Also,

[Haskell-cafe] A haskell error message

2009-04-21 Thread siso dagbovie
Hi, I have been trying to specify the depth-first numbering algorithm as follow: _dfNum :: Int - [Tree a] - [Tree Int] _dfNum i ((Node n ts):us) = (Node i vs):(_dfNum (i+1+(length ts)) us) where vs=_dfNum (i+1) ts But when I test it, I receive the message: Non-exhaustive

Re: [Haskell-cafe] A haskell error message

2009-04-21 Thread Daniel Fischer
Am Dienstag 21 April 2009 20:52:40 schrieb siso dagbovie: Hi, I have been trying to specify the depth-first numbering algorithm as follow: _dfNum :: Int - [Tree a] - [Tree Int] _dfNum i ((Node n ts):us) = (Node i vs):(_dfNum (i+1+(length ts)) us) where vs=_dfNum (i+1) ts But

Re: [Haskell-cafe] ANN: list-tries-0.0 - first release

2009-04-21 Thread Martijn van Steenbergen
Matti Niemenmaa wrote: In order to run properly, list-tries needs a version of 'containers' that hasn't yet been released. I incorporated a little hack which makes it compile even with 0.2, but some calls will fail by calling 'error': 30 of my 1014 test cases do so. 1014 test cases?! Wow. :-)

[Haskell-cafe] ANN: list-tries-0.0 - first release

2009-04-21 Thread Matti Niemenmaa
Announcing the first public release of list-tries! Version 0.0, woo! list-tries is a library providing implementations of finite sets and maps for list keys using tries, both simple and of the Patricia kind. The data types are parametrized over the map type they use internally to store the child

[Haskell-cafe] Re: ANN: list-tries-0.0 - first release

2009-04-21 Thread Matti Niemenmaa
Martijn van Steenbergen wrote: Matti Niemenmaa wrote: In order to run properly, list-tries needs a version of 'containers' that hasn't yet been released. I incorporated a little hack which makes it compile even with 0.2, but some calls will fail by calling 'error': 30 of my 1014 test cases do

Re: [Haskell-cafe] Re: ANN: list-tries-0.0 - first release

2009-04-21 Thread Felipe Lessa
On Wed, Apr 22, 2009 at 12:29:05AM +0300, Matti Niemenmaa wrote: Good to hear that it works for someone else, too. (I don't have a new enough version of containers installed myself, after upgrading to 6.10.2.) Just bear in mind that some functions won't work. What exactly don't work? What is

Re: Is 78 characters still a good option? Was: [Haskell-cafe] breaking too long lines

2009-04-21 Thread Michael Mossey
Robert Greayer wrote: But the discussion is about a coding standard -- surely if I claimed to like to have 4 windows side by side, that wouldn't be a good reason to reduce the standard to 40 columns? Being able to read one line 'at a glance' seems to me to be improved if that line contains

Re: [Haskell-cafe] Cabal's default install location

2009-04-21 Thread Duncan Coutts
On Tue, 2009-04-21 at 09:20 +0200, Thomas Davie wrote: There seems to be an assumption amongst the community that a user's home directory is the most useful place for cabal to install to by default. A few people have challenged that. I wanted to find out which one most people do

Re: [Haskell-cafe] Converting IO [XmlTree] to [XmlTree]

2009-04-21 Thread Henning Thielemann
On Sun, 19 Apr 2009, Manlio Perillo wrote: Note that it is not always possible to separate IO from pure code. As an example, consider an HTTP 1.1 server that read a request body containing a number for each line, and return a response body containing the sum of the numbers. Here, you can not

Re: [Haskell-cafe] Comments from two weeks of using Leksah

2009-04-21 Thread jutaro
Hello Jeff Jeff Heard wrote: I've been using the latest and greatest version of leksah for the last couple of weeks and I wanted to give a short report on the things I've found. Thanks for taking the time to write this report. Jeff Heard wrote: First of all, it's crashed only once,

[Haskell-cafe] Re: breaking too long lines

2009-04-21 Thread Maurí­cio
according the several style guides, lines shouldn't be too long (longer than 78 characters). Since Haskell is usually nice to parse, wouldn't it be interesting to replace a pretty printer program for layout manuals? I saw in your first link that the teacher provided a tool to check for

Re: Is 78 characters still a good option? Was: [Haskell-cafe] breaking too long lines

2009-04-21 Thread Henning Thielemann
Xiao-Yong Jin schrieb: P.S. We really need such a well written style guide for haskell. Python has this nice PEP (Python Enhancement Proposals). Should we start making our own HEP? http://www.haskell.org/haskellwiki/Category:Proposals

Re: [Haskell-cafe] Re: Cabal's default install location

2009-04-21 Thread Duncan Coutts
On Tue, 2009-04-21 at 12:41 +0200, Achim Schneider wrote: alias cabal='cabal --global' We do have a config file you know. It's exactly to let you persistently set command line flags like this. Duncan ___ Haskell-Cafe mailing list

Re: Is 78 characters still a good option? Was: [Haskell-cafe] breaking too long lines

2009-04-21 Thread Duncan Coutts
On Tue, 2009-04-21 at 13:52 +0100, Neil Mitchell wrote: P.S. We really need such a well written style guide for haskell. Python has this nice PEP (Python Enhancement Proposals). Should we start making our own HEP? We have one: urchin.earth.li/~ian/style/haskell.html Yes,

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-21 Thread Duncan Coutts
On Tue, 2009-04-21 at 12:31 +0200, david48 wrote: For what it's worth, It's bothered me often enough that cabal doesn't install globally by default that I had to reinstall ghc in order to solve package issues. Do you know what the problem was exactly? It's possible to get problems with overlap

[Haskell-cafe] Functor and Haskell

2009-04-21 Thread Daryoush Mehrtash
In category theory functors are defined between two category of C and D where every object and morphism from C is mapped to D. I am trying to make sense of the above definition with functor class in Haskell. Let say I am dealing with List type. When I define List to be a instance of a functor

Re: [Haskell-cafe] Functor and Haskell

2009-04-21 Thread Dan Weston
You are on the right track. The usual construction is that Hask is the category (with types as objects and functions as morphisms). Functor F is then an endofunctor taking Hask to itself: a - F a f - fmap f So, for F = []: a - [a] f - map f Natural transformations are then any fully

Re: Is 78 characters still a good option? Was: [Haskell-cafe] breaking too long lines

2009-04-21 Thread Haroldo Stenger
Hi, i hate those html forms that show you [haskell,python] code in a narrow box that is suposed to make the code clear, but it darkens the code by cutting it. Maybe having all lines shorter helps, but the narrow window effect is chasing us nonsensely.- haroldo 2009/4/21 Richard Kelsall

[Haskell-cafe] Re: Functor and Haskell

2009-04-21 Thread Ertugrul Soeylemez
Daryoush Mehrtash dmehrt...@gmail.com wrote: In category theory functors are defined between two category of C and D where every object and morphism from C is mapped to D. I am trying to make sense of the above definition with functor class in Haskell. Let say I am dealing with List type.

Re: [Haskell-cafe] Functor and Haskell

2009-04-21 Thread Daryoush Mehrtash
I am not sure I follow how the endofunctor gave me the 2nd functor. As I read the transformation there are two catagories C and D and two functors F and G between the same two catagories. My problem is that I only have one functor between the Hask and List catagories. So where does the 2nd

[Haskell-cafe] Getting the x out

2009-04-21 Thread michael rice
How do I get the x out of Just x? Michael = safeDivision :: Float - Float - Maybe Float safeDivision x y = if y == 0 then Nothing else Just (x/y) *Main Data.List safeDivision 10 5 Just 2.0 *Main Data.List 3 + (safeDivision 10 5) interactive:1:0:     No instance for (Num (Maybe

Re: [Haskell-cafe] Getting the x out

2009-04-21 Thread Ross Mellgren
If you want to just get the value out, meaning you'll get a program error if it happens to be Nothing, then you can use Data.Maybe.fromJust. But usually, you'd want to preserve the Nothing. Applicative or Monad is pretty good for this: import Control.Applicative (3+) $ safeDivision 10 5

Re: [Haskell-cafe] Getting the x out

2009-04-21 Thread Tony Morris
You mean, the x out of *Maybe* x even. In the very literal sense, the assumption that there is an x in Maybe x is false -- there may not be one since it is maybe, but not necessarily, x. IT's a bit like the use of null that you might have seen in other languages where you might have a value or you

Re: [Haskell-cafe] Getting the x out

2009-04-21 Thread Mattias Bengtsson
On Tue, 2009-04-21 at 17:49 -0700, michael rice wrote: How do I get the x out of Just x? Michael = safeDivision :: Float - Float - Maybe Float safeDivision x y = if y == 0 then Nothing else Just (x/y) *Main Data.List safeDivision 10 5 Just 2.0 *Main Data.List 3 +

Re: [Haskell-cafe] Getting the x out

2009-04-21 Thread michael rice
Got it! I figured there must be some way to unpack it. My goodness, there are so many functions I'm not even aware of. Has anyone ever counted them all? Thanks. Michael --- On Tue, 4/21/09, Tony Morris tonymor...@gmail.com wrote: From: Tony Morris tonymor...@gmail.com Subject: Re:

Re: [Haskell-cafe] Functor and Haskell

2009-04-21 Thread Dan Weston
List is not a full subcategory of Hask, so it's a bad choice. Namely, types of functions on a list (e.g. [a] - [a]) are not themselves lists of type [b] for some b, and so are not objects of List (though they are morphisms in it). In Hask, ([a] - [a]) is both an object and a morphism (in fact,

Re: [Haskell-cafe] Getting the x out

2009-04-21 Thread michael rice
There's a lot of well thought out stuff in Haskell, but getting familiar with it all seems like a huge task. Thanks for the help. Michael --- On Tue, 4/21/09, Ross Mellgren rmm-hask...@z.odi.ac wrote: From: Ross Mellgren rmm-hask...@z.odi.ac Subject: Re: [Haskell-cafe] Getting the x out To:

[Haskell-cafe] ANN: HTTP-4000.0.6

2009-04-21 Thread Sigbjorn Finne
Hi, a refresh release of the HTTP package has been uploaded to Hackage, http://hackage.haskell.org/cgi-bin/hackage-scripts/package/HTTP Robust handling of ill-formed cookies + squash a bug in normalization of certain proxy-bound requests would be the (minor) headlines of this release. enjoy

Re: Is 78 characters still a good option? Was: [Haskell-cafe] breaking too long lines

2009-04-21 Thread wren ng thornton
Dusan Kolar wrote: Dear all, reading that according the several style guides, lines shouldn't be too long (longer than 78 characters). http://www.cs.caltech.edu/courses/cs11/material/haskell/misc/haskell_style_guide.html http://www.haskell.org/haskellwiki/Programming_guidelines I

Re: [Haskell-cafe] Functor and Haskell

2009-04-21 Thread wren ng thornton
Daryoush Mehrtash wrote: I am not sure I follow how the endofunctor gave me the 2nd functor. As I read the transformation there are two catagories C and D and two functors F and G between the same two catagories. My problem is that I only have one functor between the Hask and List catagories.

[Haskell-cafe] Can't find space leak in external sort with tournament trees (test case attached)

2009-04-21 Thread Denis Bueno
Hello haskell-cafe, I'm running into what I think is a space leak. I've modified external-sort-0.2 [0] to use tournament trees for merging, and although the block sorting works in constant space, merging seems to produce a space leak. The external sort works by lazily consuming an input list,

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-21 Thread Richard O'Keefe
On 21 Apr 2009, at 7:39 pm, Jason Dagit wrote: Not really. Obviously some programs use the feature, but let us restrict to interesting programs that have been shared with the world and have some potential to receive maintenance. Why? You are, in effect, saying that my code has no value at

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-21 Thread Richard O'Keefe
On 21 Apr 2009, at 8:20 pm, Edward Middleton wrote: ghc 6.8.3 is /usr/bin/ghc on my office Mac, but nothing in the world prevents there being some other program called ghc that would also like to be there. Only by painstaking verification of a whole bunch of applications together can one be

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-21 Thread Richard O'Keefe
On 21 Apr 2009, at 11:36 pm, Achim Schneider wrote: Richard O'Keefe o...@cs.otago.ac.nz wrote: Some of the right questions are - how many potential whatever users would need to have whatever installed on _some_ machine they do NOT have administrator access to? Irrelevant. How van

Re: Is 78 characters still a good option? Was: [Haskell-cafe] breaking too long lines

2009-04-21 Thread Robert Greayer
wren ng thornton w...@freegeek.org wrote: There is a deeper reason. Much work in typography has shown that humans read text best when it's around 76 characters wide; if things get narrower than that then cohesion is lost, if things get wider then it takes a long time to acquire the

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-21 Thread Alexander Dunlap
On Tue, Apr 21, 2009 at 8:34 PM, Richard O'Keefe o...@cs.otago.ac.nz wrote: On 21 Apr 2009, at 7:39 pm, Jason Dagit wrote: Not really.  Obviously some programs use the feature, but let us restrict to interesting programs that have been shared with the world and have some potential to receive

Re: Is 78 characters still a good option? Was: [Haskell-cafe] breaking too long lines

2009-04-21 Thread Richard O'Keefe
On 22 Apr 2009, at 2:53 am, Richard Kelsall wrote: Dusan Kolar wrote: ... Or is the reason much deeper? Or, is the bound set to 78 characters just because it is as good number as any other? ... As a little historical detour I think the 80 character limit goes back to 1928 when IBM designed

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-21 Thread Jason Dagit
On Tue, Apr 21, 2009 at 8:34 PM, Richard O'Keefe o...@cs.otago.ac.nz wrote: On 21 Apr 2009, at 7:39 pm, Jason Dagit wrote: Not really.  Obviously some programs use the feature, but let us restrict to interesting programs that have been shared with the world and have some potential to receive

[Haskell-cafe] Books recommendation for LINQ?

2009-04-21 Thread GüŸnther Schmidt
Hi, I'll be trying Sigbjorns haskell-dotnet package together with LINQ. What's a good book for LINQ? Günther ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Getting the x out

2009-04-21 Thread Neil Mitchell
Hi It's not too hard. You wanted a function that converted Maybe a - a, you just Hoogle for it: http://haskell.org/hoogle/?hoogle=Maybe+a+-+a Thanks Neil On Wed, Apr 22, 2009 at 2:07 AM, michael rice nowg...@yahoo.com wrote: Got it! I figured there must be some way to unpack it. My