Re: [Haskell-cafe] Re: Implementing unionAll

2010-02-18 Thread Evan Laforge
BTW, I notice that your merges, like mine, are left-biased. This is a useful property (my callers require it), and doesn't seem to cost anything to implement, so maybe you could commit to it in the documentation? By left-biased I mean that when elements compare equal, pick the leftmost one, e.g.

[Fwd: Re: [Haskell-cafe] Category Theory woes]

2010-02-18 Thread Mike Pentney
As well as books and reading material online, nowadays you can also find video lectures...for example, the following was at the top of Googling category theory video: http://golem.ph.utexas.edu/category/2007/09/the_catsters_on_youtube.html Cheers, Mike. Nick Rudnick wrote: I haven't seen

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Sean Leather
On Thu, Feb 18, 2010 at 04:27, Nick Rudnick wrote: I haven't seen anybody mentioning «Joy of Cats» by Adámek, Herrlich Strecker: It is available online, and is very well-equipped with thorough explanations, examples, exercises funny illustrations, I would say best of university lecture

[Haskell-cafe] Re: Implementing unionAll

2010-02-18 Thread Heinrich Apfelmus
Leon Smith wrote: On Wed, Feb 17, 2010 at 6:58 AM, Heinrich Apfelmus apfel...@quantentunnel.de wrote: Ah, I meant to use the union' from your previous message, but I think that doesn't work because it doesn't have the crucial property that the case union (VIP x xs) ys = ... does not

Re: [Haskell-cafe] Linear programming in Haskell

2010-02-18 Thread Ozgur Akgun
I've no idea about the GLPK system. But, isn't it the case that you can transform any linear inequality into a linear equality and a slack (or excess) variable? That's actually what you *need to do* to turn the problem into the canonical form, so that simplex can handle it. 2010/2/17 Daniel

[Haskell-cafe] Friedberg numberings.

2010-02-18 Thread Grigory Sarnitskiy
Hello! The question is not about Haskell, but I don't know where else to ask. In the book Computable functions by Vereshchagin and Shen it is said that it is possible to invent a programming language such that each programming problem has a unique solution in it. The author claims that this

[Haskell-cafe] Re : Friedberg numberings

2010-02-18 Thread Pierre-Etienne Meunier
Hi, In fact it is not quite hard to see that such a numbering exists : just take any numbering of all Turing machines, say {\phi_i}, then remove all indices i such that there is ji such that \phi_j = \phi_i (equality is mathematically correctly defined between functions from N to N). Ah, and

[Haskell-cafe] ANN: iteratee-parsec 0.0.1

2010-02-18 Thread Maciej Piechotka
Iteratee-parsec is a library which allows to have a parsec (3) parser in IterateeG monad. It contains 2 implementations: - John Lato's on public domain. It is based on monoid and design with short parsers in mind. - Mine on MIT. It is based on single-linked mutable list. It seems to be

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Nick Rudnick
IM(H??)O, a really introductive book on category theory still is to be written -- if category theory is really that fundamental (what I believe, due to its lifting of restrictions usually implicit at 'orthodox maths'), than it should find a reflection in our every day's common sense, shouldn't

Re: [Haskell-cafe] The Related monad and constant values in type classes

2010-02-18 Thread Edward Kmett
I've needed something similar in the past. I used it in the reflection library, and its present on its own on hackage as 'tagged'. http://hackage.haskell.org/packages/archive/tagged/0.0/doc/html/Data-Tagged.html I talked a bit about using it here:

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Hans Aberg
On 18 Feb 2010, at 14:48, Nick Rudnick wrote: * the definition of open/closed sets in topology with the boundary elements of a closed set to considerable extent regardable as facing to an «outside» (so that reversing these terms could even appear more intuitive, or «bordered» instead of

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Daniel Fischer
Am Donnerstag 18 Februar 2010 14:48:08 schrieb Nick Rudnick: even in Germany, where the term «ring» seems to originate from, since at least a century nowbody has the least idea it once had an alternative meaning «gang,band,group», Wrong. The term Ring is still in use with that meaning in

Re: [Haskell-cafe] Re: sendfile leaking descriptors on Linux?

2010-02-18 Thread Taru Karttunen
Excerpts from Bardur Arantsson's message of Wed Feb 17 21:27:07 +0200 2010: For sendfile, a timeout of 1 second would probably be fine. The *ONLY* purpose of threadWaitWrite in the sendfile code is to avoid busy-waiting on EAGAIN from the native sendfile. Of course this will kill connections

Re: [Haskell-cafe] Re: Implementing unionAll

2010-02-18 Thread Ben Millwood
On Thu, Feb 18, 2010 at 8:07 AM, Evan Laforge qdun...@gmail.com wrote: And BTW again, here's something I've occasionally found useful: -- | Handy to merge or sort a descending list. reverse_compare :: (Ord a) = a - a - Ordering reverse_compare a b = case compare a b of    LT - GT    EQ - EQ

Re: [Haskell-cafe] The Related monad and constant values in type classes

2010-02-18 Thread Stephen Tetley
Hi Edward Does Tagged have a common synonym as its the 'opposite' of Const? I thought I'd seen the same construction used with Strafunski / StrategyLib, but if I did I can no longer find the examples. Thanks Stephen ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Nick Rudnick
Hi Daniel, ;-)) agreed, but is the word «Ring» itself in use? The same about the English language... de.wikipedia says: « Die Namensgebung /Ring/ bezieht sich nicht auf etwas anschaulich Ringförmiges, sondern auf einen organisierten Zusammenschluss von Elementen zu einem Ganzen. Diese

Re: [Haskell-cafe] CURL and threads

2010-02-18 Thread Neil Brown
Hi, Your code forks off N threads to do HTTP response checking, then waits for the reply (invokeThreads). Each thread (runHTTPThread) calls curlGetResponse and *immediately* sends the answer back down the channel to invokeThreads (checkAuthResponse) -- then waits for half a second before

Re: [Haskell-cafe] Linear programming in Haskell

2010-02-18 Thread Matthias Görgens
The trick is to use only non-negative variables for the equations. (That's considered OK in linear programming. Though you may consider it cheating.) By the way, linear programming over rational numbers is in P. ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Linear programming in Haskell

2010-02-18 Thread Matthias Görgens
But, isn't it the case that you can transform any linear inequality into a linear equality and a slack (or excess) variable? That's actually what you *need to do* to turn the problem into the canonical form, so that simplex can handle it. Yes. The simplex is usually implemented in this form.

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Daniel Fischer
Am Donnerstag 18 Februar 2010 17:10:08 schrieb Nick Rudnick: Hi Daniel, ;-)) agreed, but is the word «Ring» itself in use? Of course, many people wear rings on their fingers. Oh - you meant in the sense of gang/group? It still appears as part of the name of some groups as a word of its own,

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Gregg Reynolds
On Thu, Feb 18, 2010 at 7:48 AM, Nick Rudnick joerg.rudn...@t-online.dewrote: IM(H??)O, a really introductive book on category theory still is to be written -- if category theory is really that fundamental (what I believe, due to its lifting of restrictions usually implicit at 'orthodox

Re: [Haskell-cafe] How can i run darcs in ghci?

2010-02-18 Thread Jason Dagit
On Tue, Feb 16, 2010 at 12:17 AM, Marc Weber marco-owe...@gmx.de wrote: Any help on how to load the .h is greatly appreciated. I tried -i with path to the src directory but it didn't work (should it?). Try -I -i is used for .hs files only (?). This seems like a missing feature in

Re: [Haskell-cafe] The Related monad and constant values in type classes

2010-02-18 Thread Jonas Almström Duregård
Hi Edward, Nothing new under the sun it would seem :). Perhaps these functions could be useful in the Tagged library? on1 :: Tagged a v - Tagged (x a) v on1 = retag on2 :: Tagged a v - Tagged (x a x0) v on2 = retag on3 :: Tagged a v - Tagged (x a x0 x1) v on3 = retag on4 :: Tagged a v -

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Nick Rudnick
Hi Hans, agreed, but, in my eyes, you directly point to the problem: * doesn't this just delegate the problem to the topic of limit operations, i.e., in how far is the term «closed» here more perspicuous? * that's (for a very simple concept) the way that maths prescribes: + historical

[Haskell-cafe] Re: Heterogeneous Data Structures - Nested Pairs and functional references

2010-02-18 Thread Günther Schmidt
Hi Alexander, sry for being a bit thick, but how would this code be used? I'm unable to figure out the application yet. Could you give some examples how you use it? Günther ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Nick Rudnick
Gregg Reynolds wrote: On Thu, Feb 18, 2010 at 7:48 AM, Nick Rudnick joerg.rudn...@t-online.de mailto:joerg.rudn...@t-online.de wrote: IM(H??)O, a really introductive book on category theory still is to be written -- if category theory is really that fundamental (what I believe, due

Fwd: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Michael Matsko
- Forwarded Message - From: Michael Matsko msmat...@comcast.net To: Nick Rudnick joerg.rudn...@t-online.de Sent: Thursday, February 18, 2010 2:16:18 PM GMT -05:00 US/Canada Eastern Subject: Re: [Haskell-cafe] Category Theory woes Gregg,    Topologically speaking, the border

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Daniel Fischer
Am Donnerstag 18 Februar 2010 19:19:36 schrieb Nick Rudnick: Hi Hans, agreed, but, in my eyes, you directly point to the problem: * doesn't this just delegate the problem to the topic of limit operations, i.e., in how far is the term «closed» here more perspicuous? It's fairly natural in

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Daniel Fischer
Am Donnerstag 18 Februar 2010 19:55:31 schrieb Nick Rudnick: Gregg Reynolds wrote: On Thu, Feb 18, 2010 at 7:48 AM, Nick Rudnick joerg.rudn...@t-online.de mailto:joerg.rudn...@t-online.de wrote: IM(H??)O, a really introductive book on category theory still is to be written -- if

Re: [Haskell-cafe] Re: Heterogeneous Data Structures - Nested Pairs and functional references

2010-02-18 Thread Alexander Solla
sry for being a bit thick, but how would this code be used? I'm unable to figure out the application yet. Could you give some examples how you use it? Günther So, the type (View view) -- ignoring class instances -- is basically isomorphic to this (slightly simpler) type: data View

Re: Fwd: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Nick Rudnick
Hi Mike, so an open set does not contain elements constituting a border/boundary of it, does it? But a closed set does, doesn't it? Cheers, Nick Michael Matsko wrote: - Forwarded Message - From: Michael Matsko msmat...@comcast.net To: Nick Rudnick joerg.rudn...@t-online.de

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Alexander Solla
On Feb 18, 2010, at 10:19 AM, Nick Rudnick wrote: Back to the case of open/closed, given we have an idea about sets -- we in most cases are able to derive the concept of two disjunct sets facing each other ourselves, don't we? The only lore missing is just a Bool: Which term fits which

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Hans Aberg
On 18 Feb 2010, at 20:20, Daniel Fischer wrote: + definition backtracking: «A closure operation c is defined by the property c(c(x)) = c(x). Actually, that's incomplete, ... That's right, it is just the idempotency relation. ...missing are - c(x) contains x - c(x) is minimal among the

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Hans Aberg
On 18 Feb 2010, at 19:19, Nick Rudnick wrote: agreed, but, in my eyes, you directly point to the problem: * doesn't this just delegate the problem to the topic of limit operations, i.e., in how far is the term «closed» here more perspicuous? * that's (for a very simple concept) the way

[Haskell-cafe] Re: Re[2]: Threading and FFI

2010-02-18 Thread Ben Franksen
Yves Parès wrote: But there are two things that remain obscure: First, there is my situation: int the main thread, I call to some C functions binded through FFI. All of them are marked 'unsafe', except one, which is internally supposed to make pauses with 'usleep'. I then execute in another

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Daniel Fischer
Am Donnerstag 18 Februar 2010 21:47:02 schrieb Hans Aberg: On 18 Feb 2010, at 20:20, Daniel Fischer wrote: + definition backtracking: «A closure operation c is defined by the property c(c(x)) = c(x). Actually, that's incomplete, ... That's right, it is just the idempotency relation.

Re: [Haskell-cafe] Pointfree composition for higher arity

2010-02-18 Thread Bas van Dijk
On Wed, Feb 17, 2010 at 10:23 PM, Sean Leather leat...@cs.uu.nl wrote: -- oo :: (c - d) - (a - b - c) - a - b - d oo :: (Category cat) = cat c d - (a - cat b c) - a - cat b d oo = (.) . (.) I think at NL-FP day 2008 at Utrecht somebody called '(.) . (.)' the 'boob' operator... it was late and

[Haskell-cafe] darcs 2.4 release candidate 2

2010-02-18 Thread Reinier Lamers
Hi all, The darcs team would like to announce the immediate availability of darcs 2.4 release candidate 2. darcs 2.4 will contain many improvements and bugfixes compared to darcs 2.3.1. Highlights are the faster operation of record, revert and related commands, and the experimental interactive

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Gregg Reynolds
On Thu, Feb 18, 2010 at 1:31 PM, Daniel Fischer daniel.is.fisc...@web.dewrote: Am Donnerstag 18 Februar 2010 19:55:31 schrieb Nick Rudnick: Gregg Reynolds wrote: -- you agree with me it's far away from every day's common sense, even for a hobby coder?? I mean, this is not «Head first

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Michael Matsko
Nick,    That is correct.  An open set contains no point on its boundary.     A closed set contains its boundary, i.e. for a closed set c, Closure(c) = c.     Note that for a general set, which is neither closed or open (say the half closed interval (0,1]), may contain points on

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Hans Aberg
On 18 Feb 2010, at 22:06, Daniel Fischer wrote: ...missing are - c(x) contains x - c(x) is minimal among the sets containing x with y = c(y). It suffices*) with a lattice L with relation = (inclusion in the case of sets) satifying i. x = y implies c(x) = c(y) ii. x = c(x) for all x in

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Nick Rudnick
Hi Mike, of course... But in the same spirit, one could introduce a straightforward extension, «partially bordered», which would be as least as good as «clopen»... ;-) I must admit we've come a little off the topic -- how to introduce to category theory. The intent was to present some

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Alexander Solla
On Feb 18, 2010, at 1:28 PM, Hans Aberg wrote: It is a powerful concept. I think of a function closure as what one gets when adding all an expression binds to, though I'm not sure that is why it is called a closure. Its because a monadic morphism into the same type carrying around data

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Nick Rudnick
Hans Aberg wrote: On 18 Feb 2010, at 19:19, Nick Rudnick wrote: agreed, but, in my eyes, you directly point to the problem: * doesn't this just delegate the problem to the topic of limit operations, i.e., in how far is the term «closed» here more perspicuous? * that's (for a very simple

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Nick Rudnick
Hi Alexander, my actual posting was about rename refactoring category theory; closed/open was just presented as an example for suboptimal terminology in maths. But of course, bordered/unbordered would be extended by e.g. «partially bordered» and the same holds. Cheers, Nick Alexander

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Hans Aberg
On 18 Feb 2010, at 23:02, Nick Rudnick wrote: 418 bytes in my file system... how many in my brain...? Is it efficient, inevitable? Yes, it is efficient conceptually. The idea of closed sets let to topology, and in combination with abstractions of differential geometry led to cohomology

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Nick Rudnick
Gregg Reynolds wrote: On Thu, Feb 18, 2010 at 1:31 PM, Daniel Fischer daniel.is.fisc...@web.de mailto:daniel.is.fisc...@web.de wrote: Am Donnerstag 18 Februar 2010 19:55:31 schrieb Nick Rudnick: Gregg Reynolds wrote: -- you agree with me it's far away from every day's common

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Alexander Solla
On Feb 18, 2010, at 2:08 PM, Nick Rudnick wrote: my actual posting was about rename refactoring category theory; closed/open was just presented as an example for suboptimal terminology in maths. But of course, bordered/unbordered would be extended by e.g. «partially bordered» and the same

Re: Re[Haskell-cafe] [2]: Threading and FFI

2010-02-18 Thread Yves Parès
Ben Franksen wrote: You can leave them unsafe if you are sure that 1) they do not call (back) any function in your program 2) they do not block (or not long enough that it bothers you) Otherwise they are no less safe that the safe calls. If (1) is not fulfilled bad things might (that is,

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Michael Matsko
Nick, Actually, clopen is a set that is both closed and open. Not one that is neither. Except in the case of half-open intervals, I can't remember talking much in topology about sets with a partial boundary. Category theory-wise. No one seems to have mentioned MacLane's Categories for the

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Nick Rudnick
Hans Aberg wrote: On 18 Feb 2010, at 23:02, Nick Rudnick wrote: 418 bytes in my file system... how many in my brain...? Is it efficient, inevitable? Yes, it is efficient conceptually. The idea of closed sets let to topology, and in combination with abstractions of differential geometry led

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Richard O'Keefe
On Feb 19, 2010, at 3:55 AM, Daniel Fischer wrote: Am Donnerstag 18 Februar 2010 14:48:08 schrieb Nick Rudnick: even in Germany, where the term «ring» seems to originate from, since at least a century nowbody has the least idea it once had an alternative meaning «gang,band,group», Wrong.

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Nick Rudnick
Alexander Solla wrote: On Feb 18, 2010, at 2:08 PM, Nick Rudnick wrote: my actual posting was about rename refactoring category theory; closed/open was just presented as an example for suboptimal terminology in maths. But of course, bordered/unbordered would be extended by e.g. «partially

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Richard O'Keefe
On Feb 19, 2010, at 11:22 AM, Hans Aberg wrote: As for the naming problem, it is more of a linguistic problem: the names were somehow handed by tradition, and it may be difficult to change them. For example, there is a rumor that kangaroo means I do not understand in a native language;

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Daniel Fischer
Am Freitag 19 Februar 2010 00:24:23 schrieb Richard O'Keefe: On Feb 19, 2010, at 3:55 AM, Daniel Fischer wrote: Am Donnerstag 18 Februar 2010 14:48:08 schrieb Nick Rudnick: even in Germany, where the term «ring» seems to originate from, since at least a century nowbody has the least idea

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Nick Rudnick
Daniel Fischer wrote: Am Donnerstag 18 Februar 2010 19:19:36 schrieb Nick Rudnick: Hi Hans, agreed, but, in my eyes, you directly point to the problem: * doesn't this just delegate the problem to the topic of limit operations, i.e., in how far is the term «closed» here more perspicuous?

Re: [Haskell-cafe] Re: Implementing unionAll

2010-02-18 Thread Leon Smith
On Thu, Feb 18, 2010 at 2:32 AM, Evan Laforge qdun...@gmail.com wrote: By purest coincidence I just wrote the exact same function (the simple mergeAll', not the VIP one).  Well, extensionally the same... intensionally mine is 32 complicated lines and equivalent to the 3 line mergeAll'.  I even

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Alexander Solla
On Feb 18, 2010, at 4:49 PM, Nick Rudnick wrote: Why does the opposite work well for computing science? Does it? I remember a peer trying to convince me to use the factory pattern in a language that supports functors. I told him I would do my task my way, and he could change it later

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Nick Rudnick
Hi Alexander, please be more specific -- what is your proposal? Seems as if you had more to say... Nick Alexander Solla wrote: On Feb 18, 2010, at 4:49 PM, Nick Rudnick wrote: Why does the opposite work well for computing science? Does it? I remember a peer trying to convince me to

Re: [Haskell-cafe] Re: Implementing unionAll

2010-02-18 Thread Leon Smith
On Thu, Feb 18, 2010 at 3:07 AM, Evan Laforge qdun...@gmail.com wrote: BTW, I notice that your merges, like mine, are left-biased.  This is a useful property (my callers require it), and doesn't seem to cost anything to implement, so maybe you could commit to it in the documentation? Also, I

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Nick Rudnick
Hi, wow, a topic specific response, at last... But I wish you would be more specific... ;-) A *referrer* (object) refers to a *referee* (object) by a *reference* (arrow). Doesn't work for me. Not in Ens (sets, maps), Grp (groups, homomorphisms), Top (topological spaces, continuous

Re: [Haskell-cafe] Re: Implementing unionAll

2010-02-18 Thread Evan Laforge
On Thu, Feb 18, 2010 at 5:22 PM, Leon Smith leon.p.sm...@gmail.com wrote: On Thu, Feb 18, 2010 at 3:07 AM, Evan Laforge qdun...@gmail.com wrote: BTW, I notice that your merges, like mine, are left-biased.  This is a useful property (my callers require it), and doesn't seem to cost anything to

Re: [Haskell-cafe] Category Theory woes

2010-02-18 Thread Richard O'Keefe
On Feb 19, 2010, at 2:48 PM, Nick Rudnick wrote: Please tell me the aspect you feel uneasy with, and please give me your opinion, whether (in case of accepting this) you would rather choose to consider Human as referrer and Int as referee of the opposite -- for I think this is a deep

[Haskell-cafe] ANNOUNCE: vty-ui 0.3

2010-02-18 Thread Jonathan Daugherty
I'm happy to announce the release of vty-ui 0.3. Get it from Hackage: http://hackage.haskell.org/package/vty-ui Or get the source with darcs: http://repos.codevine.org/vty-ui Project homepage: http://codevine.org/vty-ui/ This version of vty-ui features a richer rendering engine,