Re: [Haskell-cafe] Inverse of HaskellDB

2010-09-29 Thread Chris Eidhof
On 28 sep 2010, at 17:33, Ozgur Akgun wrote: How do you define relationships between data types? Well, why is it any different from other fields? From one of your examples [1], I'd expect you to have a list of questions in the Quiz data type, and if necessary, a quiz field in the Question

Re: [Haskell-cafe] Inverse of HaskellDB

2010-09-28 Thread Chris Eidhof
Hey Jonathan, I've done some work on this. The hard part is defining relationships between datatypes: how do you model this in Haskell? I've some code on github: http://github.com/chriseidhof/persist, you might be interested in that. -chris On 25 sep 2010, at 21:31, Jonathan Geddes wrote:

Re: [Haskell-cafe] record update

2010-09-13 Thread Chris Eidhof
For completeness, using fclabels (yet another record package) you can write it like this: {-# LANGUAGE TemplateHaskell #-} module Records where import Data.Record.Label data MyRecord = MyRecord { _field1 :: String, _field2 :: Int, _field3 :: Bool } $(mkLabels [''MyRecord])

Re: [Haskell-cafe] help me evangelize haskell.

2010-09-05 Thread Chris Eidhof
On 5 sep 2010, at 09:28, Ben Lippmeier wrote: On 05/09/2010, at 2:38 AM, Michael Litchard wrote: I'll be starting a new job soon as systems tool guy. The shop is a perl shop as far as internal automation tasks go. But I am fortunate to not be working with bigots. If they see a better way,

Re: [Haskell-cafe] Statically tracking validity - suggestions?

2010-08-31 Thread Chris Eidhof
On 31 aug 2010, at 08:24, strejon wrote: Hello. I'm using Haskell to write a specification for some software. The software uses certificates (standard X.509 certificates) and stores user name information in the Subject's CommonName field. The X.509 standard doesn't actually require the

Re: [Haskell-cafe] ANNOUNCE: DSTM 0.1.1

2010-08-04 Thread Chris Eidhof
This looks very cool! It would be nice to put the pdf online somewhere, and add a link from the package documentation. Also, the chat client seems to have some problems with output buffering on my system (OS X, GHC 6.12). -chris On 3 aug 2010, at 10:35, Frank Kupke wrote: Hi, DSTM is an

Re: [Haskell-cafe] Software architecture

2010-08-04 Thread Chris Eidhof
I think the general process is the same. You define your components, try to decouple them as much as possible and implement them. One thing that is different from other languages: try to write as much pure code as possible. This is great for creating composable components. There are several

Re: [Haskell-cafe] [C Binding] Turning the mutable to immutable?

2010-07-07 Thread Chris Eidhof
On 5 jul 2010, at 23:48, Yves Parès wrote: Hello, I don't know if some of you are familiar with the SFML library (stands for Simple and Fast Multimedia Library) -- http://sfml-dev.org As SDL, SFML is a 2D graphics library, but conversely to SDL it provides a hardware-accelerated drawing,

Re: [Haskell-cafe] [C Binding] Turning the mutable to immutable?

2010-07-07 Thread Chris Eidhof
]. But wouldn't it damage the performances, since code will have to go through an extra layer? [1] http://blog.ezyang.com/2010/06/principles-of-ffi-api-design 2010/7/7 Chris Eidhof ch...@eidhof.nl On 5 jul 2010, at 23:48, Yves Parès wrote: Hello, I don't know if some of you are familiar

Re: [Haskell-cafe] learning advanced haskell

2010-06-14 Thread Chris Eidhof
On 14 jun 2010, at 07:42, Aran Donohue wrote: Hi Cafe, I've been doing Haskell for a few months, and I've written some mid-sized programs and many small ones. I've read lots of documentation and many papers, but I'm having difficulty making the jump into some of the advanced concepts

Re: [Haskell-cafe] Steven S. Skiena of The Algorithm Design Manual, Second Edition, 2008 has sent me a message that if there is a Haskell page of algorithms he will link to it.

2010-05-28 Thread Chris Eidhof
Nhe most important reference in literature might be Okasaki's Purely functional data structures: @book{okasaki1999purely, title={{Purely functional data structures}}, author={Okasaki, C.}, year={1999}, publisher={Cambridge Univ Pr} } -chris On 28 mei 2010, at 05:23, Casey Hawthorne

Re: [Haskell-cafe] [ANNOUNCE] First Public Release of the Snap Framework

2010-05-22 Thread Chris Eidhof
Awesome! Congratulations on the first release, I look forward to working with it. Also, the web design is great, possibly the best designed Haskell library website I've seen so far. -chris On 22 mei 2010, at 07:25, Gregory Collins wrote: Hello all, To coincide with Hac Phi 2010

Re: [Haskell-cafe] cabal problem on OS X

2010-05-22 Thread Chris Eidhof
I have a different problem (also after doing a cabal update): I get a bus error. I just created this ticket for it: http://hackage.haskell.org/trac/hackage/ticket/691 -chris On 22 mei 2010, at 13:20, Bill Atkins wrote: When I run cabal update on my Mac (Snow Leopard, Intel), I get: %

Re: [Haskell-cafe] polyvariadic function for Applicative instances

2010-05-10 Thread Chris Eidhof
Maybe this is what you are looking for: http://www.haskell.org/haskellwiki/Idiom_brackets -chris On 9 mei 2010, at 18:39, Xiao-Yong Jin wrote: Hi, Is it possible to have a function accept variable number of arguments, such that 'f' can be instantiated to different concrete types as f

Re: [Haskell-cafe] How efficient is read?

2010-05-10 Thread Chris Eidhof
There is the ChristmasTree package (http://hackage.haskell.org/package/ChristmasTree) which provides a very fast read alternative by deriving grammars for each datatype. If you want to know the speed differences, see http://www.cs.uu.nl/wiki/bin/view/Center/TTTAS for more information (it's in

Re: [Haskell-cafe] Re: lhs2TeX - lhs2TeX.fmt missing

2010-05-05 Thread Chris Eidhof
I've generated large LaTeX documents with several modules without too much hassle. The key was to use %include a lot, as well as conditionals. Lots of %if False around import statements. -chris On 5 mei 2010, at 20:18, Pierre-Etienne Meunier wrote: By the way, if someone on this list has got

[Haskell-cafe] Cabal-install: bus error

2010-05-03 Thread Chris Eidhof
Hey everyone, After I upgraded to a newer cabal-install my cabal-install broke again: I get a Bus Error when doing cabal update or cabal install something. The version that was bundled with the Haskell platform worked fine, but now it's broken again. I'm not sure what it was that went wrong or

Re: [Haskell-cafe] Re: FRP for game programming / artifical life simulation

2010-04-28 Thread Chris Eidhof
I agree. This would be an extremely useful feature, not only for game development, but also for web development. We often use continuations as a way to add state to the web, but this fails for two reasons: whenever the server restarts, or when we scale to multiple machines. However, I think it

Re: [Haskell-cafe] GSOC idea: Haskell JVM bytecode library

2010-03-26 Thread Chris Eidhof
We've used this library to generate a prototype JVM backend for UHC about a year ago, and it Just Worked. That was probably on 6.10 or 6.8. -chris On 26 mrt 2010, at 21:33, Brian Alliet wrote: On Fri, Mar 26, 2010 at 08:01:57PM +, Alexandru Scvortov wrote: I'm thinking of writing a

Re: [Haskell-cafe] GSOC idea: Haskell JVM bytecode library

2010-03-26 Thread Chris Eidhof
On 26 mrt 2010, at 22:37, Alexandru Scvortov wrote: How stable is it? I don't know. I remember that we didn't have to change anything and that everything just worked. Was it easy to use? Actually yes, because: Did it have enough documentation? I think we used the Java documentation. The

Re: [Haskell-cafe] derivable type classes

2010-03-23 Thread Chris Eidhof
No. A solution for this (depending on the type class you want to derive) is Generic Programming. Using Generic Programming, you can define functions that work on the structure of the type. For example, take a look at the regular package [1]. It provides all the functionality to write your own

Re: [Haskell-cafe] ANN: Salvia-1.0.0

2010-03-23 Thread Chris Eidhof
On 23 mrt 2010, at 14:27, Bas van Dijk wrote: On Tue, Mar 23, 2010 at 2:13 PM, Sebastiaan Visser sfvis...@cs.uu.nl wrote: Nice! This is certainly worth it. BTW What's the git equivalent of 'darcs send -o filename' which saves the patches to filename? I would rather send my patches as email

[Haskell-cafe] ANN: regular-web 0.1 | generic web programming in Haskell

2010-03-21 Thread Chris Eidhof
From the ZuriHac hackathon, I am happy to announce the first release of the regular-web package [1]. The package contains functions for generic web programming: generating HTML, JSON and Formlets. It is based on the regular generic programming library [2]. Generic HTML and forms are often not

Re: [Haskell-cafe] Code that doesn't compile - but should :)

2010-03-16 Thread Chris Eidhof
What about this? {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, UndecidableInstances, FlexibleContexts, EmptyDataDecls, ScopedTypeVariables, TypeOperators, TypeSynonymInstances #-} data Data k = Pair Integer (() - k) data RecData = RecData (Data RecData)

Re: [Haskell-cafe] Code that doesn't compile - but should :)

2010-03-16 Thread Chris Eidhof
We need to explicitly quantify over the type variables so that we can give an explicit type signature on the following line: let method = select s :: a - f a There might be an easier way to do this, but I'm not sure how exactly. -chris On Tue, Mar 16, 2010 at 2:39 AM, Chris Eidhof ch

Re: [Haskell-cafe] references for compiler optimizations for functional languages

2010-03-03 Thread Chris Eidhof
I'd like to add Urban Boquist's thesis to that list: http://www.cs.chalmers.se/~boquist/phd/index.html (I've added it to the wiki page as well). -chris On 1 mrt 2010, at 22:26, Don Stewart wrote: mvanier42: Hi everyone, I'm interested in collecting good references for compiler

Re: [Haskell-cafe] using haskell to serve with apache

2010-03-03 Thread Chris Eidhof
We run a couple of Happstack processes with FastCGI, and it works like a charm. We even wrote a module for it: http://hackage.haskell.org/package/happstack-fastcgi -chris On 1 mrt 2010, at 20:19, Yitzchak Gale wrote: brad clawsie wrote: should i just try out something based on fastcgi?

Re: [Haskell-cafe] Two GET HTTP requests

2010-02-10 Thread Chris Eidhof
not build 64bit binaries. So upgrading ghc won't solve it. --nwn On Mon, Feb 8, 2010 at 12:50 AM, Chris Eidhof ch...@eidhof.nl wrote: Thanks. Unfortunately, it didn't help. The thing that frustrates me is that it's quite hard to debug. I guess I'll upgrade my GHC to 6.12, hopefully

Re: [Haskell-cafe] Lazy language on JVM/CLR

2010-02-09 Thread Chris Eidhof
I don't think it's pure. I would definitely use a pure language on the JVM, but IIRC Open Quark / Cal is an impure language. For example, from the library documentation: printLine :: String - (). -chris On 9 feb 2010, at 15:31, Tim Wawrzynczak wrote: Perhaps this is similar to what you're

Re: [Haskell-cafe] Two GET HTTP requests

2010-02-08 Thread Chris Eidhof
On 7 feb 2010, at 19:52, Lars Viklund wrote: On Sun, Feb 07, 2010 at 05:12:23PM +, Ben Millwood wrote: This failed with just the text Bus error. I searched the HTTPBis git repository, but couldn't find the text Bus error. I don't have a clue of how to fix this. Bus error is a message

Re: [Haskell-cafe] Two GET HTTP requests

2010-02-08 Thread Chris Eidhof
I should add that I was able to work around the issue by using Michael Snoyman's http-wget [1] package. It uses the command-line version of wget, which does work on my machine. -chris [1]: http://hackage.haskell.org/package/http-wget On 7 feb 2010, at 16:50, Chris Eidhof wrote: Thanks

Re: [Haskell-cafe] Two GET HTTP requests

2010-02-07 Thread Chris Eidhof
Thanks. Unfortunately, it didn't help. The thing that frustrates me is that it's quite hard to debug. I guess I'll upgrade my GHC to 6.12, hopefully that'll solve it. -chris On 7 feb 2010, at 16:07, Yusaku Hashimoto wrote: Hello, On Sat, Feb 6, 2010 at 2:51 AM, Chris Eidhof ch

[Haskell-cafe] Two GET HTTP requests

2010-02-05 Thread Chris Eidhof
Hi everyone, I'm trying to do a number of successive HTTP requests in one program. Here's what I tried: Approach 1: I used the 'download' package, which failed to install on OS X. It fails with error: libio.h: No such file or directory. Approach 2: I installed the 'download-curl' package, and

Re: [Haskell-cafe] Determining application directory

2010-01-27 Thread Chris Eidhof
Hi Matveev, You might be interested in the System.Directory module: http://hackage.haskell.org/packages/archive/directory/1.0.0.3/doc/html/System-Directory.html HTH, -chris On 27 jan 2010, at 18:06, Matveev Vladimir wrote: Hi, I'm writing cross-platform application in Haskell which should

Re: [Haskell-cafe] HTML - based GUIs - follow up

2010-01-21 Thread Chris Eidhof
Formlets themselves don't require a server. You can use them from the commandline. However, formlets do have a limitation: they are not interactive. I would really like a library that does something like formlets (compositional web forms) but with a FRP-style of writing. A contrived example:

Re: [Haskell-cafe] Compiling a shared library on MacOS X

2010-01-04 Thread Chris Eidhof
I'm not sure if it is of any help, but at the haskell-wiki there's an article about how to communicate between Haskell and Objective-C using XCode: http://haskell.org/haskellwiki/Using_Haskell_in_an_Xcode_Cocoa_project -chris On 4 jan 2010, at 00:36, Ivan Miljenovic wrote: If I recall

Re: [Haskell-cafe] diff implementation in haskell

2009-12-09 Thread Chris Eidhof
Also, there is a paper about doing a type-safe diff in Agda, http://portal.acm.org/citation.cfm?id=1596614.1596624 I heard rumors that the library will be ported to Haskell. -chris On 8 dec 2009, at 15:20, Bayley, Alistair wrote: From: haskell-cafe-boun...@haskell.org

Re: [Haskell-cafe] Bulding a library for C users on OS X

2009-11-02 Thread Chris Eidhof
On 2 nov 2009, at 03:30, Manuel M T Chakravarty wrote: Chris Eidhof: I'm trying to call a Haskell function from C, on OS X. There's an excellent post [1] by Tomáš Janoušek that explains how to do this on Linux. However, on OS X, it's different. First of all, it looks like the -no-hs-main

Re: [solved] Re: [Haskell-cafe] Calling Haskell from C, Linking with gcc?

2009-11-01 Thread Chris Eidhof
I can confirm that, if you follow the steps on the wiki, you'll end up with a working Mac application. Excellent work John, thanks very much! -chris On 30 okt 2009, at 00:53, John Velman wrote: It's taken 21 days with interruptions, but I finally posted a tutorial with details of what I

[Haskell-cafe] Bulding a library for C users on OS X

2009-10-31 Thread Chris Eidhof
Hey all, I'm trying to call a Haskell function from C, on OS X. There's an excellent post [1] by Tomáš Janoušek that explains how to do this on Linux. However, on OS X, it's different. First of all, it looks like the -no-hs-main flag is ignored, because I get the following error: ghc

Re: [Haskell-cafe] dsl and gui toolkit

2009-10-05 Thread Chris Eidhof
That sounds really interesting, it would be great if you could share some of your work by putting it on hackage or posting a link to the repository! -chris On 5 okt 2009, at 12:42, Andrew U. Frank wrote: writing a gui is a mess (independent of wx or gtk) - too much detail is shown and

[Haskell-cafe] Re: Multiple-selection formlet?

2009-09-23 Thread Chris Eidhof
Hey Colin, Currently, I don't think this is supported. It would help a lot if you could send me a dumbed-down version of your code, I'll file an issue for it on github. Thanks, -chris On 23 sep 2009, at 14:35, Colin Adams wrote: Just in case you missed it on the cafe. --

Re: [Haskell-cafe] Problem with Text.XHtml.Strict.Formlets.file on Mac OSX

2009-09-23 Thread Chris Eidhof
Hey Colin, The code looks OK to me. Are you sure you are setting the right method for your form? It's the third component of the tuple returned by the runFormState. Thanks, -chris On 22 sep 2009, at 08:56, Colin Adams wrote: I'm writing a form that involves picking a file to upload,

Re: [Haskell-cafe] Problem with Text.XHtml.Strict.Formlets.file on Mac OSX

2009-09-23 Thread Chris Eidhof
all of this yet. 2009/9/23 Chris Eidhof ch...@eidhof.nl: Hey Colin, The code looks OK to me. Are you sure you are setting the right method for your form? It's the third component of the tuple returned by the runFormState. Thanks, -chris On 22 sep 2009, at 08:56, Colin Adams wrote: I'm

Re: [Haskell-cafe] Problem with monadic formlets

2009-08-30 Thread Chris Eidhof
Hey everybody, I've just uploaded formlets 0.6.1 to Hackage, which should fix this bug. Thanks for letting me know! -chris On 29 aug 2009, at 13:22, Jeremy Shaw wrote: Hello, Yeah, it seems that checkM in formlets 0.6 broken. I reported the bug to MightByte as well. - jeremy At Fri,

[Haskell-cafe] [ann] formlets 0.6

2009-08-24 Thread Chris Eidhof
Hey everyone, I wanted to let you know that the formlets team has released a new version of the formlets [1] on hackage, a library to build type-safe, composable web forms. Most notably, Mightybyte and I worked on the massInput functionality, which is now ready for use! Mightybyte has an

Re: [Haskell-cafe] Are GADTs what I need?

2009-07-13 Thread Chris Eidhof
Hey Kev, The types are thrown away during compile time. Therefore, if you have a constructor VWrapper :: a - Value nothing is known about that a when you scrutinize it. What you could do, however, is something like this: data Value a where VInt :: Integer - Value Integer ...

Re: [Haskell-cafe] Are GADTs what I need?

2009-07-13 Thread Chris Eidhof
as there is a fair bit of code to change, and it cascades down through the data structures (maybe a forall a . Value a will help here?) I will have a go at this approach. In case anyone is interested the code is at http://github.com/KMahoney 2009/7/13 Chris Eidhof ch...@eidhof.nl: Hey Kev

[Haskell-cafe] DHUG: meeting tomorrow (July 7th) in Utrecht

2009-07-07 Thread Chris Eidhof
Hi everyone, The Dutch HUG [1] will meet again tomorrow. This time we'll meet in Utrecht again, at the Stairway To Heaven. The meeting will start at 19h. The venue is a sometimes a bit noisy, but there's beer and nice big tables. If you want to hear everything about the Dutch HUG

Re: [Haskell-cafe] How to pretty print code efficiently

2009-07-05 Thread Chris Eidhof
On 4 jul 2009, at 05:13, Alexander Dunlap wrote: On Fri, Jul 3, 2009 at 6:45 PM, John Kynewho...@gmail.com wrote: Hi, Currently I'm pretty printing code by building arrays of strings and calling indent. For example: instance JavaPrintableNamed AST.EnumeratedType where javaLinesNamed

Re: [Haskell-cafe] ORM for haskell?

2009-07-03 Thread Chris Eidhof
On 3 jul 2009, at 11:28, Jochem Berndsen wrote: Chris Eidhof wrote: I've something working that sort of does this. You define your model in the following way: data User = User {name :: String, password :: String, age :: Int, post :: BelongsTo Post} data Post = Post {title :: String, body

Re: [Haskell-cafe] ORM for haskell?

2009-07-01 Thread Chris Eidhof
Hey Marc, On 30 jun 2009, at 19:52, Marc Weber wrote: Is there anyone interested in helping building a library which a) let's you define kind of model of you data b) let's you store you model in any backend (maybe a relational database) c) does static checking of your queries at compilation

Re: [Haskell-cafe] Logo

2009-06-16 Thread Chris Eidhof
Hey all, On 15 jun 2009, at 08:39, Ashley Yakeley wrote: Thomas Davie wrote: We had a lot of fun deciding Haskell's new logo, and while I don't agree with the final result, it would be nice if we could now start consistently using it. With that in mind, I realised that the Haskell

[Haskell-cafe] Dutch HUG meeting tonight in Amsterdam

2009-06-09 Thread Chris Eidhof
Hi everyone, Tonight there will be another meeting of the Dutch Haskell Users' Group! This time we'll meet in Amsterdam, in the library. On the wiki [1] you can find the details of how to reach it. We'll be at the top floor and shouldn't be hard to recognize. The meeting is set to begin

Re: [Haskell-cafe] Re: ANNOUNCE: gitit 0.2 release - wiki using HAppS, git, pandoc

2008-11-09 Thread Chris Eidhof
If anyone else has problems installing gitit, try updating your cabal- install (and cabal). I had old versions on my computer, and updating them solved my gitit build-problems. -chris On 9 nov 2008, at 22:41, John MacFarlane wrote: I've just uploaded a new version (0.2.1) that requires

[Haskell-cafe] Re: [Haskell] Probably a trivial thing for people knowing Haskell

2008-10-20 Thread Chris Eidhof
I think it might be more appropriate to move this discussion to haskell-cafe. On 19 okt 2008, at 17:24, Friedrich wrote: Learn to love types: one of the neat things about Haskell is that if you can write down the type of a function then you have usually done 90% of the work of writing the

Re: [Haskell-cafe] Updated formlets sample?

2008-09-22 Thread Chris Eidhof
#a1 [2] http://haskell.org/haskellwiki/Formlets Chris Eidhof schrieb: That means that you don't have input0 in your environment, maybe you're passing in an empty environment? -chris On 21 sep 2008, at 12:11, Martin Huschenbett wrote: Hi Chris, thanks for the updated example. Compiling works now

Re: [Haskell-cafe] Updated formlets sample?

2008-09-20 Thread Chris Eidhof
Hey Martin, On 19 sep 2008, at 04:14, Martin Huschenbett wrote: I found a blog post concerning formlets [1] in the web. Since looks very interesting I tried to compile the sample code with recent versions of HAppS and formlets from hackage. But this didn't work as the API of formlets has

[Haskell-cafe] Type family fun

2008-08-23 Thread Chris Eidhof
Hey all, I was playing around with type families, and I have a strange problem. Suppose we have an alternative to an Either datatype: data (:|:) a b = Inl a | Inr b and a class Ix: class Ix i where type IxMap i :: * - * empty :: IxMap i [Int] Now I want to give an instance for (a

Re: [Haskell-cafe] Re: [Haskell] Compiler Construction course using Haskell?

2008-08-20 Thread Chris Eidhof
I plan to give a course in compiler construction, using Haskell as the implementation language (not as source or target language). Something along these lines: 1. combinator parsers (Parsec), 2. simple interpreter (arithmetical expressions) 3. add algebraic data types, functions 4. type checker

[Haskell-cafe] Sphinx full-text searching client on Hackage

2008-07-14 Thread Chris Eidhof
Hey everyone, We started working on a client [1] for the sphinx full-text search engine [2], which is a very fast full-text search engine that has either SQL or XML as a backend. While our version is far from done (it only supports the query command, and a limited number of parameters),

[Haskell-cafe] Compiling GHC 6.8.3 on OS X with readline support

2008-07-07 Thread Chris Eidhof
Hey all, When compiling GHC 6.8.3 on OS X, I ended up with a GHCi without readline support. That makes interacting quite hard, especially because the Backspace-key didn't even work. With some help on irc from Baughn and by reading a blog post from Paul Brown, I managed to get readline

[Haskell-cafe] The state of database libraries

2008-07-04 Thread Chris Eidhof
Hey everyone, I'm figuring out how to do databases in Haskell (on OS X). So far, I've tried the following approaches: 1. hdbc. I'd like to connect to MySQL, so I need the ODBC backend. I couldn't get this to work under OS X, while I installed myodbc, which seems to be broken. 2. hsql.

Re: [Haskell-cafe] IMAP and NNTP libraries

2008-06-23 Thread Chris Eidhof
On 23 jun 2008, at 22:26, Spencer Janssen wrote: On Sun, Jun 22, 2008 at 02:52:33AM -0300, Maurí cio wrote: Hi, Are there mature libraries for IMAP and NNTP available to Haskell? Thanks, Maurício There is the haskellnet project: http://darcs.haskell.org/SoC/haskellnet/ I'm not sure

Re: [Haskell-cafe] wanted: Network.Curl examples

2008-06-11 Thread Chris Eidhof
Hey Brad, I wrote a blog-post with some curl-examples in there, it's a small mashup of last.fm and upcoming, check it at http://tinyurl.com/5d8jx7 Enjoy, -chris On 11 jun 2008, at 07:51, brad clawsie wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 in search of some trivial examples

Re: [Haskell-cafe] Simple list processing

2008-06-11 Thread Chris Eidhof
Hey Andrew, On 11 jun 2008, at 20:17, Andrew Coppin wrote: According to the theory, anything that consumes a list and produces a value is some kind of fold. [Assuming it traverses the list in a sensible order!] So it looks like you could implement this as a fold. But should that be a

[Haskell-cafe] [ANN] Twitter Client

2008-05-09 Thread Chris Eidhof
Hey everyone, I was tired of all those graphical Twitter clients that aren't usable from my Terminal, so I wrote my own. It's still very much alpha, but comments or improvements are more than welcome. You can install it by downloading the twitter-package from hackage. In order to get it

Re: [Haskell-cafe] parser

2007-12-07 Thread Chris Eidhof
On 7 dec 2007, at 22:55, Ryan Bloor wrote: hi The thing is... it will be a simple parser really. The expressions are already defined and we can't use parsec imports. Below is the types I have. I have a function that removes initial spaces from the start of a string. A function that

Re: [Haskell-cafe] parser

2007-12-07 Thread Chris Eidhof
On 7 dec 2007, at 23:51, Ryan Bloor wrote: i am using hugs and the isDigit and anything 'is' doesn't work... they must have forgot to add them in! Does GHC work with them. Yes, it's in base. Alternatively, you could write the functions yourself, they're not that hard. p.s... that book looks

Re: [Haskell-cafe] parser

2007-12-07 Thread Chris Eidhof
On 6 dec 2007, at 18:06, Ryan Bloor wrote: Can anyone advise me on how to check whether a string contains ints, chars, bools, etc 2345 + 6767 shoudl give IntAdd (2345) (6767) 2345 should give IntT 2345 You need to write a parser. There are a lot of libraries that will help you write a

Re: [Haskell-cafe] return in Monad class necessary?

2007-11-27 Thread Chris Eidhof
On 27 nov 2007, at 10:14, Reinier Lamers wrote: Chris Eidhof wrote: On 26 nov 2007, at 19:48, Henning Thielemann wrote: I wonder whether it is a typical mistake of beginners to write 'return' within a do-block (that is, not at the end) and if it is possible to avoid this mistake by clever

Re: [Haskell-cafe] return in Monad class necessary?

2007-11-26 Thread Chris Eidhof
On 26 nov 2007, at 19:48, Henning Thielemann wrote: I wonder whether it is a typical mistake of beginners to write 'return' within a do-block (that is, not at the end) and if it is possible to avoid this mistake by clever typing. In a proper monad 'return' can be fused with subsequent actions,

[Haskell-cafe] RLE in Haskell: why does the type variable get instantiated?

2007-07-31 Thread Chris Eidhof
Hey Haskell-Cafe, I was trying out the code in Dons's article [1], and I noticed a weird thing when doing it in GHCi. When binding the function composition to a variable, the type suddenly changes. I'm not completely sure why this happens. Is this because GHCi is in a monad and wants to

Re: [Haskell-cafe] Silly mail client

2007-05-06 Thread Chris Eidhof
One thing I did was replacing the Reply button in my toolbar with Reply All. The only problem is that I always use Cmd+R instead of clicking a button, but I'm at least a little bit closer. -chris On 6-mei-2007, at 15:21, [EMAIL PROTECTED] wrote: Andrew Coppin [EMAIL PROTECTED] writes:

Re: [Haskell-cafe] Why the Prelude must die

2007-03-24 Thread Chris Eidhof
On Mar 24, 2007, at 2:36 AM, Sebastian Sylvan wrote: On 3/24/07, Chris Eidhof [EMAIL PROTECTED] wrote: Given all these issues, I consider the only reasonable option is to discard the Prelude entirely. There will be no magic modules. Everything will be an ordinary library. HOFs like

Re: [Haskell-cafe] Why the Prelude must die

2007-03-23 Thread Chris Eidhof
Given all these issues, I consider the only reasonable option is to discard the Prelude entirely. There will be no magic modules. Everything will be an ordinary library. HOFs like (.) are available from Control.Function. List ops come from Data.List. Any general abstractions can be added in

Re: [Haskell-cafe] XML Validation and Digestion in Haskell

2007-03-22 Thread Chris Eidhof
Don't spend too much time on the various libraries though. I tried some simple things with Haskell and XML, but I found it really hard to actually parse a simple document. You really don't want to write your own parser. The only tool that worked for me was HXT, which is based on arrows.

Re: [Haskell-cafe] XML Validation and Digestion in Haskell

2007-03-22 Thread Chris Eidhof
, Chris Eidhof [EMAIL PROTECTED] wrote:Don't spend too much time on the various libraries though. I tried some simple things with Haskell and XML, but I found it really hard to actually parse a simple document. You really don't want to write your own parser. The only tool that worked for me was HXT

Re: [Haskell-cafe] A real Haskell Cookbook

2007-02-25 Thread Chris Eidhof
Hey everyone, we added some examples to this page. There are some topics that don't have any examples, notably: # 11 Network Programming # 12 XML * 12.1 Parsing XML # 13 Databases * 13.1 MySQL * 13.2 PostgreSQL * 13.3 SQLite # 14 FFI * 14.1 How to interface with C If

Re: [Haskell-cafe] Hi can u explain me how drop works in Haskell

2007-02-25 Thread Chris Eidhof
Hey, you're almost there: drop :: Integer - [a] - [a] drop 0 xs = xs drop n (x:xs) = drop (n-1) xs Your version fails when trying to do drop 10 [1..10]. My version fails when trying to do drop 10 [1..9], so you might want to try to see if you can come up with a solution for that! Good

Re: [Haskell-cafe] Recursion in Haskell

2007-02-17 Thread Chris Eidhof
The definition of myLen says: myLen [] = 0 The length for an empty list is zero myLen (x:xs) = 1 + myLen xs The length of a list containing x and some other stuff (xs) is 1 + (the length of the other stuff). So basically, if you've got a list [1,2,3], it will try to do this: myLen

Re: [Haskell-cafe] Is Excel the most used -- and fucntional -- programming lanuage on Earth?

2007-01-30 Thread Chris Eidhof
The cool thing about Excel is that it's like Function Reactive Programming. When you update the value of a cell, all the other cells that reference to it get updated too. That's pretty cool to have in GUI's as well, and Haskell has that too. See [1]. -chris [1]:

Re: [Haskell-cafe] Channel9 Interview: Software Composability and theFu ture of Languages

2007-01-28 Thread Chris Eidhof
Haskell is _not_ inherently hard - any more than any other programming language. But it is different. So right now, Haskell is hard only because we need more documentation that is designed to make Haskell seem easy. Well, I think it's harder to get a program compiled in Haskell than in Java,

Re: [Haskell-cafe] Concurrency in Haskell

2007-01-25 Thread Chris Eidhof
Yes, I'm curious too. For example, it would be great if we could change a function that uses map almost automatically to a function that does the map in parallel. Ofcourse it should be in the IO monad, so maybe mapM would be a better choice to start with. -chris On 25 Jan, 2007, at 21:13

Re: [Haskell-cafe] Currying

2007-01-18 Thread Chris Eidhof
what is so great about currying? What are its uses, apart from letting one define functions with less parentheses? Well, from an academic viewpoint, it's very interesting to see a function defined as a composition of functions. From a practical viewpoint, it's just really handy. It saves you

Re: [Haskell-cafe] MissingH: profiler support?

2007-01-12 Thread Chris Eidhof
profiling support to a Cabal lib is to add - p at configure time (ie runhaskell Setup.hs configure -p). Have you tried this? Cheers, Spencer Janssen On Jan 8, 2007, at 4:13 PM, Chris Eidhof wrote: Hey all, I'm trying to profile my application, which makes use of MissingH. But when compiling

Resending: [Haskell-cafe] MissingH: profiler support?

2007-01-11 Thread Chris Eidhof
Hey, does anyone know about this? Resending as I got no replies (yet) ;) Thanks, -chris On 8 Jan, 2007, at 23:13 , Chris Eidhof wrote: Hey all, I'm trying to profile my application, which makes use of MissingH. But when compiling with -prof -auto-all, I get the following error

[Haskell-cafe] MissingH: profiler support?

2007-01-08 Thread Chris Eidhof
Hey all, I'm trying to profile my application, which makes use of MissingH. But when compiling with -prof -auto-all, I get the following error: Language.hs:8:7: Could not find module `Data.String': Perhaps you haven't installed the profiling libraries for package

[Haskell-cafe] Re: SYB and/or HList for XML, deserialization and collections

2006-12-26 Thread Chris Eidhof
== Deserialization == HAppS periodically checkpoints application state to disk. Developers may want to add or remove fields from their state types for from data types used by their state types. The current solution is to have the developer assign a version number to state. If state

Re: [Haskell-cafe] Composing monads (sort of)

2006-12-16 Thread Chris Eidhof
Hey Mark, How can I concisely compose these functions without having to write a cascade of case statements such as: case f1 rec1 of Nothing - return Nothing Just id1 - do rec2 - f2 id2 return $ case rec2 of