Re: [Haskell-cafe] Higher-order algorithms

2010-08-24 Thread Stephen Tetley
On 23 August 2010 14:03, Eugene Kirpichov ekirpic...@gmail.com wrote: Do there exist other nontrivial higher-order algorithms and datastructures? Is the field of higher-order algorithms indeed as unexplored as it seems? Aren't higher order algorithms functional pearls? :-) You might find

Re: [Haskell-cafe] Hackage on Linux

2010-08-24 Thread David Virebayre
2010/8/24 Ivan Lazar Miljenovic ivan.miljeno...@gmail.com: What do you mean by metapackages? Metapackage are packages of packages, they don't provide something by themselves, but they have a dependency list so that a set of package can be installed together. For example, on ubuntu, installing

Re: [Haskell-cafe] Hackage on Linux

2010-08-24 Thread Ivan Lazar Miljenovic
On 24 August 2010 16:15, David Virebayre dav.vire+hask...@gmail.com wrote: 2010/8/24 Ivan Lazar Miljenovic ivan.miljeno...@gmail.com: What do you mean by metapackages? Metapackage are packages of packages, they don't provide something by themselves, but they have a dependency list so that a

Re: [Haskell-cafe] Re: Fwd: Semantics of iteratees, enumerators, enumeratees?

2010-08-24 Thread Conal Elliott
Here's a way I've been tinkering with to think about iteratees clearly. For simplicity, I'll stick with pure, error-free iteratees for now, and take chunks to be strings. Define a function that runs the iteratee: runIter :: Iteratee a - [String] - (a, [String]) Note that chunking is explicit

Re: [Haskell-cafe] Changing my Profile

2010-08-24 Thread David Virebayre
2010/8/23 Christopher Done chrisd...@googlemail.com: Any suggestions would be appreciated. Isn't there the possibility to mute a thread in gmail ? You need to activate keyboard shortcuts, then ? gives you a list of keys. m seems to be used to mute a thread, but I didn't try it so I don't know

Re: [Haskell-cafe] Fast Integer Input

2010-08-24 Thread 200901104
From: Daniel Fischer daniel.is.fisc...@web.de To: 200901...@daiict.ac.in Sent: Monday, August 23, 2010 11:14:55 PM Subject: Re: [Haskell-cafe] Fast Integer Input On Monday 23 August 2010 17:06:02 you wrote: Does the length of those numbers happen to be fixed? It they are all exactly

Re: [Haskell-cafe] Higher-order algorithms

2010-08-24 Thread wren ng thornton
On 8/24/10 12:29 AM, wren ng thornton wrote: All of these are the same algorithm, just with different (augmented) semirings. In order to prevent underflow for very small probabilities, we usually run these algorithms with probabilities in the log-domain. Those variants are also the same

[Haskell-cafe] Re: Fwd: Semantics of iteratees, enumerators, enumeratees?

2010-08-24 Thread Heinrich Apfelmus
Conal Elliott wrote: Is there a simpler model of Enumerator? My intuition is that it's simply a stream: [[Enumerator a]] = String Oddly, 'a' doesn't show up on the RHS. Maybe the representation ought to be type Enumerator = forall a. Iteratee a - Iteratee a so [[Enumerator]] = String

Re: [Haskell-cafe] Hackage on Linux

2010-08-24 Thread Mathew de Detrich
On Tue, Aug 24, 2010 at 5:55 AM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: On 24 August 2010 15:50, Mathew de Detrich dete...@gmail.com wrote: I used to use archlinux packages however it became a pain for the following reasons - packages on archlinux don't auto update when

[Haskell-cafe] Re: Fwd: Semantics of iteratees, enumerators, enumeratees?

2010-08-24 Thread Heinrich Apfelmus
Jason Dagit wrote: From a purely practical viewpoint I feel that treating the chunking as an abstraction leak might be missing the point. If you said, you wanted the semantics to acknowledge the chunking but be invariant under the size or number of the chunks then I would be happier. I use

Re: [Haskell-cafe] Fwd: Semantics of iteratees, enumerators, enumeratees?

2010-08-24 Thread C. McCann
On Mon, Aug 23, 2010 at 11:41 PM, wren ng thornton w...@freegeek.org wrote: I believe the denotation of an iteratee is the transition function for an automaton (or rather a transducer). I hesitate to speculate on the specific kind of automaton without thinking about it, so maybe finite, maybe

Re: [Haskell-cafe] Re: Fwd: Semantics of iteratees, enumerators, enumeratees?

2010-08-24 Thread Jason Dagit
On Tue, Aug 24, 2010 at 12:49 AM, Heinrich Apfelmus apfel...@quantentunnel.de wrote: Jason Dagit wrote: From a purely practical viewpoint I feel that treating the chunking as an abstraction leak might be missing the point. If you said, you wanted the semantics to acknowledge the chunking

Re: [Haskell-cafe] Hackage on Linux

2010-08-24 Thread Magnus Therning
On Tue, Aug 24, 2010 at 06:50, Mathew de Detrich dete...@gmail.com wrote: I used to use archlinux packages however it became a pain for the following reasons - packages on archlinux don't auto update when cabal does. This becomes really annoying when package X gets updated on cabal but not on

Re: [Haskell-cafe] Changing my Profile

2010-08-24 Thread Gwern Branwen
On Tue, Aug 24, 2010 at 2:48 AM, David Virebayre dav.vire+hask...@gmail.com wrote: 2010/8/23 Christopher Done chrisd...@googlemail.com: Any suggestions would be appreciated. Isn't there the possibility to mute a thread in gmail ? You need to activate keyboard shortcuts, then ? gives you a

Re: [haskell-cafe] How to substitute FD like a - b c by type families?

2010-08-24 Thread Vladimir Matveev
Thanks, that was helpful :) here is the working code if someone interested: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=29406#a29406 2010/8/24 wren ng thornton w...@freegeek.org: Vladimir Matveev wrote: I'm trying to implement the Advanced Example : Type-Level Quicksort from HaskellWiki

Re: [Haskell-cafe] Higher-order algorithms

2010-08-24 Thread Josef Svenningsson
On Mon, Aug 23, 2010 at 6:10 PM, Max Rabkin max.rab...@gmail.com wrote: (Accidentally sent off-list, resending) On Mon, Aug 23, 2010 at 15:03, Eugene Kirpichov ekirpic...@gmail.com wrote: * Difference lists I mean that not only higher-order facilities are used, but the essence of the

Re: [Haskell-cafe] Hackage on Linux

2010-08-24 Thread Joachim Breitner
Hi, Am Dienstag, den 24.08.2010, 09:30 +0100 schrieb Magnus Therning: On Tue, Aug 24, 2010 at 06:50, Mathew de Detrich dete...@gmail.com wrote: - in some situations doing a general update with arch (through clyde or packer) breaks ghc (last time it happened packer tried to uninstall/update

[Haskell-cafe] Re: Crypto-API is stabilizing

2010-08-24 Thread Marcel Fourné
Thomas DuBuisson wrote: [1] http://tommd.wordpress.com/2010/08/23/a-haskell-api-for-cryptographic-algorithms/ class (Binary p, Serialize p) = AsymCipher p where generateKeypair :: RandomGen g = g - BitLength - Maybe ((p,p),g) encryptAsym :: p - B.ByteString - B.ByteString

Re: [Haskell-cafe] Fwd: Semantics of iteratees, enumerators, enumeratees?

2010-08-24 Thread John Lato
From: C. McCann c...@uptoisomorphism.net What sets an iteratee-style design apart from something conventional based on a State monad is that the iteratee conceals its internal state completely (in fact, there's no reason an iteratee even has to be the same function step-to-step, or have a

[Haskell-cafe] Re: ANNOUNCE: enumerator, an alternative iteratee package

2010-08-24 Thread John Lato
From: Magnus Therning mag...@therning.org On 24/08/10 03:47, John Millikin wrote: [...] I would like to avoid hard-coding the error type to SomeException, because it forces libraries to use unsafe/unportable language features (dynamic typing and casting). However, given the apparent

[Haskell-cafe] Content Centric Networking

2010-08-24 Thread Tom Hawkins
Anyone in the Haskell community interested in content-centric networking? Van Jacobson has done a couple of great presentations to introduce CCN [1, 2]. Personally, I find it fascinating what kind of doors could open if we got away from TCP/IP, especially for wireless ad-hoc networking. Parc

Re: [Haskell-cafe] Re: Fwd: Semantics of iteratees, enumerators, enumeratees?

2010-08-24 Thread John Lato
I think the big problem with chunking is that many useful iteratees need to be able to inspect the length of the chunk. The most obvious is drop, but there are many others. Or if not inspect the length, have a new function on the stream dropReport :: Int - s - (s, Int) which reports how much was

Re: [Haskell-cafe] Re: Fwd: Semantics of iteratees, enumerators, enumeratees?

2010-08-24 Thread Conal Elliott
Hi John, Please note that I'm suggesting eliminating chunks from the semantics only -- not from the implementation. For precise simple chunk-less semantics, it's only important that the iteratees map equivalent input streams to equivalent output streams, where equivalent means equal after

Re: [Haskell-cafe] Fwd: Semantics of iteratees, enumerators, enumeratees?

2010-08-24 Thread Stephen Tetley
On 24 August 2010 13:00, John Lato jwl...@gmail.com wrote: This is how I think of them.  I particularly your description of them as a foldl with a pause button. Maybe it would be helpful to consider iteratees along with delimited continuations? Aren't they closer - in implementation and by

Re: [Haskell-cafe] Hackage on Linux

2010-08-24 Thread Magnus Therning
On Tue, Aug 24, 2010 at 12:18, Joachim Breitner m...@joachim-breitner.de wrote: Hi, Am Dienstag, den 24.08.2010, 09:30 +0100 schrieb Magnus Therning: On Tue, Aug 24, 2010 at 06:50, Mathew de Detrich dete...@gmail.com wrote: - in some situations doing a general update with arch (through clyde

[Haskell-cafe] bitmap examples

2010-08-24 Thread Raluca-Elena Podiuc
Hi, I am trying to build a mini framework for image processing but I can find any examples about that (bitmap processing ). Does anybody know were can I find some tutorials or samples about that ? Regards, Raluca-Elena ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Higher-order algorithms

2010-08-24 Thread Daniel Peebles
Interesting. I've come across this general idea/algorithm the factor graph / sum-product algorithm papers[1] but I was wondering if you knew of any implementations of it in haskell? I wrote one a while back but it was fairly ugly and not as general as I'd have liked, so I never released it.

Re: [Haskell-cafe] Re: Fwd: Semantics of iteratees, enumerators, enumeratees?

2010-08-24 Thread John Lato
Hi Conal, I'm aware of one case that violates semantic referential transparency, but it's a bug. Which pretty much proves your point as I understand it. John On Tue, Aug 24, 2010 at 2:01 PM, Conal Elliott co...@conal.net wrote: Hi John, Please note that I'm suggesting eliminating chunks

Re: [Haskell-cafe] Fwd: Semantics of iteratees, enumerators, enumeratees?

2010-08-24 Thread John Lato
From: Stephen Tetley stephen.tet...@gmail.com On 24 August 2010 13:00, John Lato jwl...@gmail.com wrote: This is how I think of them. I particularly your description of them as a foldl with a pause button. Maybe it would be helpful to consider iteratees along with delimited

Re: [Haskell-cafe] Higher-order algorithms

2010-08-24 Thread Dan Piponi
Automatic differentiation can also bee seen this way. In a sense it transforms a function to compute f(x) into a function to compute f'(x), where f' is the derivative of f. -- Dan On Mon, Aug 23, 2010 at 6:03 AM, Eugene Kirpichov ekirpic...@gmail.com wrote: Most of the well-known algorithms are

Re: [Haskell-cafe] Re: ANNOUNCE: enumerator, an alternative iteratee package

2010-08-24 Thread Gregory Collins
John Lato jwl...@gmail.com writes: Oleg included the error state to enable short-circuiting of computation, and I guess everyone just left it in.  Recently I've been wondering if it should be removed, though, in favor requiring explicit (i.e. explicit in the type sig) exceptions for

[Haskell-cafe] Re: Higher-order algorithms

2010-08-24 Thread Heinrich Apfelmus
Eugene Kirpichov wrote: Most of the well-known algorithms are first-order, in the sense that their input and output are plain data. Some are second-order in a trivial way, for example sorting, hashtables or the map and fold functions: they are parameterized by a function, but they don't really

Re: [Haskell-cafe] and from standard Prelude

2010-08-24 Thread Jan-Willem Maessen
On Wed, Aug 18, 2010 at 9:56 PM, wren ng thornton w...@freegeek.org wrote: Oleg Lobachev wrote: #ifdef USE_REPORT_PRELUDE and                     =  foldr () True or                      =  foldr (||) False #else and []          =  True and (x:xs)      =  x and xs or []           =  

Re: [Haskell-cafe] Re: Higher-order algorithms

2010-08-24 Thread Stephen Tetley
The function image style always described as from Point to ... [insert Picture, Bitmap, Texture...] is also inherently higher order. Examples are Conal Elliott's Pan, Jerzy Karczmarczuk's Clastic and Peter Henderson's images. In Clastic and Pan, the higher order image seems like a characteristic

Re: [Haskell-cafe] Re: ANNOUNCE: enumerator, an alternative iteratee package

2010-08-24 Thread Michael Snoyman
On Tue, Aug 24, 2010 at 7:16 PM, Gregory Collins g...@gregorycollins.netwrote: John Lato jwl...@gmail.com writes: Oleg included the error state to enable short-circuiting of computation, and I guess everyone just left it in. Recently I've been wondering if it should be removed, though,

Re: [Haskell-cafe] bitmap examples

2010-08-24 Thread Anthony Cowley
On Tue, Aug 24, 2010 at 11:02 AM, Raluca-Elena Podiuc ralucaelena1...@gmail.com wrote: Hi, I am trying to build a mini framework for image processing but I can find any examples about that (bitmap processing ). Does anybody know were can I find some tutorials or samples about that ? Noam

Re: [Haskell-cafe] Re: ANNOUNCE: enumerator, an alternative iteratee package

2010-08-24 Thread John Millikin
On Tue, Aug 24, 2010 at 05:12, John Lato jwl...@gmail.com wrote: Oleg included the error state to enable short-circuiting of computation, and I guess everyone just left it in.  Recently I've been wondering if it should be removed, though, in favor requiring explicit (i.e. explicit in the type

Re: [Haskell-cafe] Fwd: Semantics of iteratees, enumerators, enumeratees?

2010-08-24 Thread C. McCann
On Tue, Aug 24, 2010 at 11:44 AM, John Lato jwl...@gmail.com wrote: Aren't they closer - in implementation and by supported operations - to resumptions monads? See many papers by William Harrison here: http://www.cs.missouri.edu/~harrisonwl/abstracts.html I'm not familiar with resumption

[Haskell-cafe] ANNOUNCE: Sifflet visual programming language, release 1.1

2010-08-24 Thread gdweber
Sifflet-lib 1.1 and sifflet 1.1 are now available on Hackage. Sifflet is a visual, functional programming language and support system for students learning about recursion. Sifflet programmers define functions by drawing diagrams, and the Sifflet interpreter uses diagrams to show how the function

Re: [Haskell-cafe] Fwd: Semantics of iteratees, enumerators, enumeratees?

2010-08-24 Thread John Millikin
Here's my (uneducated, half-baked) two cents: There's really no need for an Iteratee type at all, aside from the utility of defining Functor/Monad/etc instances for it. The core type is step, which one can define (ignoring errors) as: data Step a b = Continue (a - Step a b)

Re: [Haskell-cafe] Fwd: Semantics of iteratees, enumerators, enumeratees?

2010-08-24 Thread Stephen Tetley
Thanks for taking a look - I've never got round to investigating the connection properly but have noticed the strong similarity between the data type defintions of the ResT and Iteratee. William Harrison makes the interesting point in the Cheap Threads papers that by itself the resumption monad

[Haskell-cafe] the overlapping instance that wasn't?

2010-08-24 Thread Michael Vanier
Hi everyone, Here's some code that's giving me an error message I don't understand: {-# LANGUAGE EmptyDataDecls, MultiParamTypeClasses, UndecidableInstances, FlexibleInstances #-} data Z data S n class Nat n where toInt :: n - Int instance Nat Z

Re: [Haskell-cafe] the overlapping instance that wasn't?

2010-08-24 Thread Michael Vanier
On 8/24/10 1:54 PM, Bartek Æwik³owski wrote: Hello Michael, This is because instance selection is solely based on instance heads, it doesn't consider contexts. There's a nice explanation available here: http://www.haskell.org/haskellwiki/GHC/AdvancedOverlap The fix in this case is very easy

Re: [Haskell-cafe] the overlapping instance that wasn't?

2010-08-24 Thread C. McCann
On Tue, Aug 24, 2010 at 4:42 PM, Michael Vanier mvanie...@gmail.com wrote: Adding OverlappingInstances to the language pragmas fixes the problem.  My question is: why is this an overlapping instance?  It would make sense if Int was an instance of Nat, but it isn't.  Is this just a limitation in

Re: [Haskell-cafe] Code that writes code

2010-08-24 Thread Richard O'Keefe
On Aug 22, 2010, at 7:34 PM, Jesse Schalken wrote: I would also like to strongly discourage code generators. I've used ad hoc code generators a lot, and never had reason to regret it. The key point is that ALL maintenance of the generated code must be done by maintaining the generator and its

Re: [Haskell-cafe] lazy skip list?

2010-08-24 Thread Michael D. Adams
In that case do you also need fast insert and delete? I think both a pure functional cons list and a pure functional skip list take O(N) to insert an element or remove an element at position N (because you have to re-cons the elements in front of it). Also do suffixes need to also be lists?

Re: [Haskell-cafe] Code that writes code

2010-08-24 Thread Antoine Latter
In the past I've taken a hybrid approach - ad-hoc fixes are done to the generated code, but it is done via 'patch' as an automated step, and the diff is stored in source control with everything else. You'll need extra tool support to build the diff, as well. It's still really brittle, and I

Re: [Haskell-cafe] Code that writes code

2010-08-24 Thread Donn Cave
Quoth Richard O'Keefe o...@cs.otago.ac.nz, ... Of course code generation is perfectly fine when the output is not intended to be read and maintained by a human. Read and maintained are two different issues. Depending on the tool-chain, it may be necessary for people to read the generated

Re: [Haskell-cafe] Hackage on Linux

2010-08-24 Thread Ivan Lazar Miljenovic
On 24 August 2010 17:45, Mathew de Detrich dete...@gmail.com wrote: On Tue, Aug 24, 2010 at 5:55 AM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: On 24 August 2010 15:50, Mathew de Detrich dete...@gmail.com wrote: - packages on archlinux don't auto update when cabal does. This

Re: [Haskell-cafe] Hackage on Linux

2010-08-24 Thread Ivan Lazar Miljenovic
On 24 August 2010 21:18, Joachim Breitner m...@joachim-breitner.de wrote: Hi, Am Dienstag, den 24.08.2010, 09:30 +0100 schrieb Magnus Therning: On Tue, Aug 24, 2010 at 06:50, Mathew de Detrich dete...@gmail.com wrote: - in some situations doing a general update with arch (through clyde or

Re: [Haskell-cafe] Code that writes code

2010-08-24 Thread Ivan Lazar Miljenovic
On 25 August 2010 07:51, Richard O'Keefe o...@cs.otago.ac.nz wrote: On Aug 22, 2010, at 7:34 PM, Jesse Schalken wrote: Every software project which I've worked on that used a code generator turned into a nightmare, because when we find we need to change something about the generator's

Re: [Haskell-cafe] Hackage on Linux

2010-08-24 Thread Alexander Solla
On Aug 22, 2010, at 3:41 AM, Andrew Coppin wrote: It looks as if it's automated for Arch, however. Either that or somebody is spending an absurd amount of time keeping it manually up to date. It probably is automated. There's a tool out there called cabal2arch, which turns a cabal file

Re: [Haskell-cafe] Hackage on Linux

2010-08-24 Thread Mathew de Detrich
On Wed, Aug 25, 2010 at 12:07 PM, Alexander Solla a...@2piix.com wrote: On Aug 22, 2010, at 3:41 AM, Andrew Coppin wrote: It looks as if it's automated for Arch, however. Either that or somebody is spending an absurd amount of time keeping it manually up to date. It probably is

Re: [Haskell-cafe] Higher-order algorithms

2010-08-24 Thread wren ng thornton
On 8/24/10 11:10 AM, Daniel Peebles wrote: Interesting. I've come across this general idea/algorithm the factor graph / sum-product algorithm papers[1] but I was wondering if you knew of any implementations of it in haskell? I wrote one a while back but it was fairly ugly and not as general as

Re: [Haskell-cafe] Hackage on Linux

2010-08-24 Thread Ivan Lazar Miljenovic
On 25 August 2010 14:36, Mathew de Detrich dete...@gmail.com wrote: On Wed, Aug 25, 2010 at 1:59 PM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: Consider these scenarios: 1) You upgrade package foo; this breaks a large number of other packages.  How do you deal with it? Thats

Re: [Haskell-cafe] Fwd: Semantics of iteratees, enumerators, enumeratees?

2010-08-24 Thread wren ng thornton
On 8/24/10 3:54 AM, C. McCann wrote: What sets an iteratee-style design apart from something conventional based on a State monad is that the iteratee conceals its internal state completely (in fact, there's no reason an iteratee even has to be the same function step-to-step, or have a single

Re: [Haskell-cafe] and from standard Prelude

2010-08-24 Thread wren ng thornton
On 8/24/10 1:55 PM, Jan-Willem Maessen wrote: On Wed, Aug 18, 2010 at 9:56 PM, wren ng thorntonw...@freegeek.org wrote: The thing I find puzzling is that the foldr is inlined. The (regular) clever optimizations for build/foldr seem like they should already handle this without the need for the

Re: [Haskell-cafe] Hackage on Linux

2010-08-24 Thread Mathew de Detrich
In all honesty I think the issue is that archlinux AUR packages are being generated in a very naive way (and not a Archlinux philosophy in general). The whole point of AUR is that its supposed to make it very easy for people to upload packages/libraries. In my opinion putting such packages in AUR

Re: [Haskell-cafe] Hackage on Linux

2010-08-24 Thread Magnus Therning
On 25/08/10 06:18, Mathew de Detrich wrote: [...] If people just wanted an auto udpate version of cabal that works through arch's package management, then there should have just been a pacman wrapper which when you install/update haskell libraries/packages, it creates a local package through

Re: [Haskell-cafe] the overlapping instance that wasn't?

2010-08-24 Thread wren ng thornton
On 8/24/10 5:12 PM, C. McCann wrote: The problem is that instance selection doesn't work the (obvious, seemingly-sensible) way you thought it did. In short, instance contexts are only examined after the fact; [...] The reason it works this way has to do with the nature of type classes being

Re: [Haskell-cafe] Hackage on Linux

2010-08-24 Thread Mathew de Detrich
Oh thanks 3 On Wed, Aug 25, 2010 at 3:21 PM, Magnus Therning mag...@therning.orgwrote: On 25/08/10 06:18, Mathew de Detrich wrote: [...] If people just wanted an auto udpate version of cabal that works through arch's package management, then there should have just been a pacman wrapper

Re: [Haskell-cafe] Hackage on Linux

2010-08-24 Thread Don Stewart
deteego: If people just wanted an auto udpate version of cabal that works through arch's package management, then there should have just been a pacman wrapper which when you install/update haskell libraries/packages, it creates a local package through cabal2arch instead of using AUR.

Re: [Haskell-cafe] bitmap examples

2010-08-24 Thread C K Kashyap
I am looking for an example of dealing with a 2dim mem region with O1 access time in pure haskell (pure as in whatever comes with haskell platform). On Tue, Aug 24, 2010 at 11:59 PM, Anthony Cowley acow...@seas.upenn.edu wrote: On Tue, Aug 24, 2010 at 11:02 AM, Raluca-Elena Podiuc

Re: [Haskell-cafe] bitmap examples

2010-08-24 Thread Eugene Kirpichov
You just need to use STUArray . 2010/8/25 C K Kashyap ckkash...@gmail.com: I am looking for an example of dealing with a 2dim mem region with O1 access time in pure haskell (pure as in whatever comes with haskell platform). On Tue, Aug 24, 2010 at 11:59 PM, Anthony Cowley