Re: [Haskell-cafe] Could not find module `Text.Regex'

2010-01-29 Thread zaxis
`cabal install regex-compat` fixes my problem. thanks! Lee Houghton-3 wrote: On 29/01/2010 03:51, zaxis wrote: import Text.Regex date_by_ntday dateStr ntday = do let [y,m,d] = map (\x - read x::Int) $ splitRegex (mkRegex -) dateStr %ghc --version The Glorious

[Haskell-cafe] Re: OT: Literature on translation of lambda calculus to combinators

2010-01-29 Thread Nick Smallbone
Job Vranish jvran...@gmail.com writes: Ideally we'd like the type of convert to be something like: convert :: LambdaExpr - SKIExpr but this breaks in several places, such as the nested converts in the RHS of the rule: convert (Lambda x (Lambda y e)) | occursFree x e = convert (Lambda x

Re: [Haskell-cafe] Non-termination of type-checking

2010-01-29 Thread Nicolas Pouillard
On Thu, 28 Jan 2010 18:32:02 -0800, Ryan Ingram ryani.s...@gmail.com wrote: But your example uses a recursive type; the interesting bit about this example is that there is no recursive types or function, and yet we can encode this loop. The point is that you get the Fix type by (infintely)

RE: [Haskell-cafe] big problems with MS Access backends

2010-01-29 Thread Bayley, Alistair
From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Günther Schmidt I need to use MS Access as a DB-backend. To make it not too easy there are tables with Umlaut Strings in some of the columns. And Takusen crashes outright. Can you try

Re: [Haskell-cafe] Very imperfect hash function

2010-01-29 Thread John Lato
From: Hans Aberg hab...@math.su.se On 28 Jan 2010, at 20:07, Steve Schafer wrote: The data are currently in a large lookup table. To save space, I'd like to convert that into a sort of hash function: hash :: key - value My question is this: Is there any kind of generic approach that can

[Haskell-cafe] Input request: which interface for Web Application Interface

2010-01-29 Thread Michael Snoyman
I've made a few more changes to WAI since my last update. Namely, request and response headers are now their own datatype. As with Method, HttpVersion and Status, they both provide constructors for everything else and have functions to convert to/from bytestrings. This makes the package a bit more

Re: [Haskell-cafe] Re: Non-termination of type-checking

2010-01-29 Thread Dan Doel
On Friday 29 January 2010 2:56:31 am o...@okmij.org wrote: Here is a bit more simplified version of the example. The example has no value level recursion and no overt recursive types, and no impredicative polymorphism. The key is the observation, made earlier, that two types c (c ()) and

[Haskell-cafe] Include creation date in Haddock documentation

2010-01-29 Thread Dennis Walter
Hi all, I wonder if it is possible to have Haddock include the date and time at which the documentation was generated. Ideally this should only occur on index.html, but to have it in any file (e.g. in the footer) would be OK, too. I couldn't find any information about dates in the documentation.

Re: [Haskell-cafe] Very imperfect hash function

2010-01-29 Thread Hans Aberg
On 29 Jan 2010, at 12:52, John Lato wrote: There are minimal perfect hash functions; there are some libraries mentioned here, though they are not in Haskell code: http://en.wikipedia.org/wiki/Perfect_hash_function This is suitable when you do a lot of lookups with few key updates. An

Re: [Haskell-cafe] Very imperfect hash function

2010-01-29 Thread John Lato
On Fri, Jan 29, 2010 at 12:46 PM, Hans Aberg hab...@math.su.se wrote: On 29 Jan 2010, at 12:52, John Lato wrote: There are minimal perfect hash functions; there are some libraries mentioned here, though they are not in Haskell code:  http://en.wikipedia.org/wiki/Perfect_hash_function This

Re: [Haskell-cafe] Very imperfect hash function

2010-01-29 Thread Hans Aberg
On 29 Jan 2010, at 15:57, John Lato wrote: That looks interesting too. Yet another idea: use arrays http://haskell.org/haskellwiki/Arrays Then build a hash table, say just taking mod k n, and have values in some lookup map. If n set of keys, average time complexity is O(1), and arrays

Re: [Haskell-cafe] imaging textbooks?

2010-01-29 Thread Håkon Lorentzen
2010/1/26 Dan Mead d.w.m...@gmail.com: Hey all Can anyone recommend a good textbook on computer vision or image processing? I don't care if it favors Haskell or not, I'm just trying to find a good text. We used Digital Image Processing, Gonzales Woods

Re: [Haskell-cafe] Re: OT: Literature on translation of lambda calculus to combinators

2010-01-29 Thread Job Vranish
Cool, Thanks :D also quickcheck says the two algorithms are equivalent :) On Fri, Jan 29, 2010 at 4:33 AM, Nick Smallbone nick.smallb...@gmail.comwrote: Job Vranish jvran...@gmail.com writes: Ideally we'd like the type of convert to be something like: convert :: LambdaExpr - SKIExpr

Re: [Haskell-cafe] Could not find module `Text.Regex'

2010-01-29 Thread Jason Dagit
On Fri, Jan 29, 2010 at 1:09 AM, zaxis z_a...@163.com wrote: `cabal install regex-compat` fixes my problem. thanks! For what it's worth, according to the documentation the -compat package is for easing a transition in the api (which has now been completed). You may want to upgrade to a

[Haskell-cafe] Community.haskell.org is down

2010-01-29 Thread Neil Mitchell
http://downforeveryoneorjustme.com/community.haskell.org/ Thanks, Neil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] C functional programming techniques?

2010-01-29 Thread Maurí­cio CA
Hi, all, Sorry if this looks weird, but do you know of experiences with functional programming, or type programming, with C? Using macro tricks or just good specifications? I know this is not absurd to a small extent. I've heard of proof tool certificated C code on the net (although I don't

Re: [Haskell-cafe] Include creation date in Haddock documentation

2010-01-29 Thread David Waern
2010/1/29 Dennis Walter dennis.wal...@gmail.com: Hi all, I wonder if it is possible to have Haddock include the date and time at which the documentation was generated. Ideally this should only occur on index.html, but to have it in any file (e.g. in the footer) would be OK, too. I couldn't

Re: [Haskell-cafe] Hierachical abstraction

2010-01-29 Thread Nils Anders Danielsson
On 2010-01-29 01:09, Edward Kmett wrote: Luke pretty much nailed the summary of what you can parse using Applicative means. I tend to consider them codata CFGs, because they can have infinite breadth and depth. However, a 'codata CFG' can handle a much larger class of languages than CFGs. To

[Haskell-cafe] problems installing cabal on windows

2010-01-29 Thread Han Joosten
I recently upgraded to GHC 6.12.1 on my windows system. Now I have trouble getting cabal right. I read the forums, and I got the cabal.exe for windows. I think I followed the upgrade instructions. However I do not get it all to work. THis is my version of Cabal: C:cabal --version

Re: [Haskell-cafe] Hierachical abstraction

2010-01-29 Thread Andrew Coppin
Luke Palmer wrote: On Thu, Jan 28, 2010 at 12:42 PM, Andrew Coppin andrewcop...@btinternet.com wrote: I wonder if you can make a parser combinator library which is *not* monadic? And, if you could, in what way would that limit the kinds of things you can parse? Absolutely! I believe

Re: [Haskell-cafe] problems installing cabal on windows

2010-01-29 Thread Neil Mitchell
Hi, Try a: cabal update cabal install cabal-install That will set you up with a newer version of Cabal, that should be GHC 6.12 compatible. Make sure you do all this while GHC 6.10 is on the path, so it knows how to install cabal-install. Thanks, Neil On Fri, Jan 29, 2010 at 6:36 PM, Han

Re: [Haskell-cafe] Hierachical abstraction

2010-01-29 Thread Andrew Coppin
Edward Kmett wrote: Luke pretty much nailed the summary of what you can parse using Applicative means. I tend to consider them codata CFGs, because they can have infinite breadth and depth. However, a 'codata CFG' can handle a much larger class of languages than CFGs. Aren't CFGs banned in

Re: [Haskell-cafe] problems installing cabal on windows

2010-01-29 Thread Daniel Fischer
Am Freitag 29 Januar 2010 19:36:12 schrieb Han Joosten: I recently upgraded to GHC 6.12.1 on my windows system. Now I have trouble getting cabal right. I read the forums, and I got the cabal.exe for windows. I think I followed the upgrade instructions. However I do not get it all to work.

Re: [Haskell-cafe] Hierachical abstraction

2010-01-29 Thread Luke Palmer
On Fri, Jan 29, 2010 at 11:45 AM, Andrew Coppin andrewcop...@btinternet.com wrote: But now suppose that I want not just circles, but *anything* that can possibly be reduced to line segments. If all you know about it is that it can be reduced to line segments, there is no loss of generality in

Re: [Haskell-cafe] Determining application directory

2010-01-29 Thread Scott A. Waterman
'FindBin' is also useful. http://hackage.haskell.org/package/FindBin While System.Directory is quite useful, it doesn't contain a function to obtain the directory in which the running program lives. You can get the current (working) directory (e.g. unix's 'getpwd'), and you can try to

Re: [Haskell-cafe] Re: Non-termination of type-checking

2010-01-29 Thread Martin Sulzmann
On Fri, Jan 29, 2010 at 8:56 AM, o...@okmij.org wrote: Here is a bit more simplified version of the example. The example has no value level recursion and no overt recursive types, and no impredicative polymorphism. The key is the observation, made earlier, that two types c (c ()) and

Re: [Haskell-cafe] problems installing cabal on windows

2010-01-29 Thread Han Joosten
Tanks for replying. I now see what went wrong: I went to http://www.haskell.org/cabal/release/cabal-install-0.8.0/ http://www.haskell.org/cabal/release/cabal-install-0.8.0/ , because I had read that I needed the 0.8.0 version. I read the page, and grabbed the cabal.exe binary, assuming that

Re: [Haskell-cafe] C functional programming techniques?

2010-01-29 Thread Erik de Castro Lopo
Maurí­cio CA wrote: Hi, all, Sorry if this looks weird, but do you know of experiences with functional programming, or type programming, with C? Using macro tricks or just good specifications? I know there is some type level programming (not strictly functional) in CCAN:

Re: [Haskell-cafe] begginers' questions

2010-01-29 Thread Han Joosten
knyttr wrote: 1. suppose I have a function like this fun x y z = ... fun x y [] = ... fun x [] [] = ... where ... the where term will be applied just to the last definition. is it possible to force it to all fun definitions? The last two parts of your definition of fun will

Re: [Haskell-cafe] begginers' questions

2010-01-29 Thread Daniel Fischer
Am Freitag 29 Januar 2010 22:38:11 schrieb Han Joosten: knyttr wrote: snip fun x [] [] = ... fun x y [] = ... fun x y z = ... would make more sence. however, there still is overlap. (ghc could generate a warning for this) now the where part: there are several options: fun x y z

[Haskell-cafe] Re: Non-termination of type-checking

2010-01-29 Thread Matthieu Sozeau
Le 29 janv. 10 à 02:56, o...@okmij.org a écrit : Here is a bit more simplified version of the example. The example has no value level recursion and no overt recursive types, and no impredicative polymorphism. The key is the observation, made earlier, that two types c (c ()) and R

Re: [Haskell-cafe] Re: Non-termination of type-checking

2010-01-29 Thread Dan Doel
On Friday 29 January 2010 5:26:28 pm Matthieu Sozeau wrote: data R (c :: *) where R :: forall c' :: * - *, (c' (c' ()) - False) - R (c' ()). This is what the data declaration is. The c on the first line and the c on the second line are unrelated. It's sort of an oddity of GADT declarations;

Re: [Haskell-cafe] Re: Non-termination of type-checking

2010-01-29 Thread Daniel Fischer
Am Freitag 29 Januar 2010 23:26:28 schrieb Matthieu Sozeau: Le 29 janv. 10 à 02:56, o...@okmij.org a écrit : Here is a bit more simplified version of the example. The example has no value level recursion and no overt recursive types, and no impredicative polymorphism. The key is the

Re: [Haskell-cafe] Linguistic hair-splitting

2010-01-29 Thread Conal Elliott
I call it an m or (more specifically) an Int m or a list of Int. For instance, a list or an Int list or a list of Int. - Conal On Wed, Jan 27, 2010 at 12:14 PM, Luke Palmer lrpal...@gmail.com wrote: On Wed, Jan 27, 2010 at 11:39 AM, Jochem Berndsen joc...@functor.nl wrote: Now, here's the

Re: [Haskell-cafe] Linguistic hair-splitting

2010-01-29 Thread Conal Elliott
I don't like this bias toward singling out Monad among all of the type classes, thereby perpetuating the misleading mystique surrounding Monad. If you're going to call [3,5,8] a monadic value, then please give equal time to other type classes by also calling [3,5,8] a functorial value

[Haskell-cafe] Re: where is the eros distribution

2010-01-29 Thread Conal Elliott
Odd. Looks like most of the packages on d.h.o evaporated. I'll push the repo to a new location. - Conal On Sat, Jan 23, 2010 at 10:38 AM, Thomas Hartman tphya...@gmail.com wrote: I was inspired by the google tech talk and would like to install and play with eros, but the

[Haskell-cafe] Why cannot i add the `let` declaration ?

2010-01-29 Thread zaxis
find_the_day sDay 0 = sDay find_the_day sDay nDay = if (is_trade_day $ nextDay sDay) then find_the_day (nextDay sDay) (nDay - 1) else find_the_day (nextDay sDay) nDay nextDay sDay = addDays 1 sDay The above code works fine. But the following always reports `compiling error`: