[Haskell-cafe] Some reflections on Haskell

2012-02-14 Thread Kevin Jardine
https://plus.google.com/u/0/111705054912446689620/posts/DPdA2rUSQ6c Comments are welcome! Kevin ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Adding state to a library

2011-12-18 Thread Kevin Jardine
I have a library of functions that all take cfg parameter (and usually others) and return results in the IO monad. It is sometimes useful to drop the config parameter by using a state-like monad.. I have found that I can wrap all my functions like so: withLibrary cfg f = f cfg stateF a b c d =

Re: [Haskell-cafe] Adding state to a library

2011-12-18 Thread Kevin Jardine
= upgrade libraryF but I can find no way to define the function upgrade in Haskell. This must be a fairly common problem. Is there a simple solution? On Sun, Dec 18, 2011 at 10:20 PM, Kevin Jardine kevinjard...@gmail.comwrote: I have a library of functions that all take cfg parameter

Re: [Haskell-cafe] Adding state to a library

2011-12-18 Thread Kevin Jardine
By upgrading, I meant move a function from an IO monad with a config parameter to a state monad without one. On Dec 18, 10:52 pm, Bas van Dijk v.dijk@gmail.com wrote: On 18 December 2011 22:26, Kevin Jardine kevinjard...@gmail.com wrote: I have a library of functions that all take

[Haskell-cafe] Cabal issue

2011-12-09 Thread Kevin Jardine
I understand that this may have been addressed before on this list in some form, so I'll be brief: Had problem with deprecated package, was told my only option was to wipe my Haskell install and start over. Is this true and if so, doesn't this mean that Cabal (or the package management system

[Haskell-cafe] Haskell vs. Dart

2011-10-11 Thread Kevin Jardine
After Google's disappointing Dart announcement yesterday, I decided to tweak them a bit and mention Haskell and functional programming languages as an alternative: https://plus.google.com/u/0/111705054912446689620/posts/UcyLBH7RLXs Comments on the post are welcome!

Re: [Haskell-cafe] YesodAuth documentation

2011-06-14 Thread Kevin Jardine
When I review the original post I see only a question: Does passwords stored in a database in an unencrypted form? rather than a request. So I'm not sure that was the intent. I'm amazed that anyone (Sony!!!?) would store unencrypted passwords of course. Kevin On Jun 14, 10:21 am, cheater

[Haskell-cafe] Re: dynamic loading of code on windows

2010-11-16 Thread Kevin Jardine
, Kevin Jardine kevinjard...@gmail.com wrote: This isn't about the plugin functionality, it's about compiling code. As the message says : This requires a Unix compatibility toolchain such as MinGW+MSYS or Cygwin. You'll find that you need such a toolchain to compile much open source

[Haskell-cafe] Re: dynamic loading of code on windows

2010-11-12 Thread Kevin Jardine
This isn't about the plugin functionality, it's about compiling code. As the message says : This requires a Unix compatibility toolchain such as MinGW+MSYS or Cygwin. You'll find that you need such a toolchain to compile much open source software, including many Haskell modules, on Windows.

[Haskell-cafe] Re: Red links in the new haskell theme

2010-10-28 Thread Kevin Jardine
To be fair to the Haddock designer, red links are common these days. Here's two examples (among many): http://www.bbc.co.uk/ http://www.slate.com/ In the second case the site uses blue, black *and* red links to distinguish different types of content. They are all in bold and underline when

[Haskell-cafe] Re: Should Yesod.Mail be a separate package?

2010-10-17 Thread Kevin Jardine
Hi Michael, Last time I checked Hackage for email libraries I could find some basic SMTP systems but nothing very recent or robust. Practically every web app needs to send email, so I think that a robust and well maintained email package would be very useful. I know you have many other projects

[Haskell-cafe] Re: Should Yesod.Mail be a separate package?

2010-10-17 Thread Kevin Jardine
to add try to tls support to HaskellNet. I don't have any huge attachment to HaskellNet so I'd be happy to just help to migrate the useful bits of it to some larger official email package. -Rob On Sun, Oct 17, 2010 at 8:32 AM, Kevin Jardine kevinjard...@gmail.com wrote: Hi Michael

[Haskell-cafe] Re: Should Yesod.Mail be a separate package?

2010-10-17 Thread Kevin Jardine
Happstack also uses an smtp library.  I forget which one. -Rob On Sun, Oct 17, 2010 at 9:29 AM, Kevin Jardine kevinjard...@gmail.com wrote: Hi Robert, I did look at HaskellNet a few months ago. It looked big and undocumented so I guess I got scared away. What I'd be interested

[Haskell-cafe] Re: Increasing number of parameters

2010-10-15 Thread Kevin Jardine
Jacek, I haven't been following this thread in any detail, so I apologise if I misunderstand your goal, but the ctm function in the polyToMonoid library (which maps its parameters to any specified monoid) appears to work in just this way. It keeps consuming parameters until you hand it to the

[Haskell-cafe] ANNOUNCE: polyToMonoid

2010-10-14 Thread Kevin Jardine
Polyvariadic functions that accept an indefinite number of possibly multiple typed arguments are often useful but a bit difficult to declare in Haskell. With some crucial assistance from Oleg Kiselyov, I have created a library that supplies two very general polyvariadic functions that can map

[Haskell-cafe] Re: Polyvariadic functions operating with a monoid

2010-10-12 Thread Kevin Jardine
 am, Kevin Jardine kevinjard...@gmail.com wrote: It also appears that we need type families to reconstruct the original Haskell list system using polyToMonoid. instance (a ~ a') = Monoidable a [a'] where     toMonoid a = [a] testList = putStrLn $ show $ polyToMonoid (mempty :: [a]) a b c

[Haskell-cafe] Re: Polyvariadic functions operating with a monoid

2010-10-11 Thread Kevin Jardine
Hi Oleg, I've found that if I also add two other slightly scary sounding extensions: OverlappingInstances and IncoherentInstances, then I can eliminate the unwrap function *and* use your type families trick to avoid the outer type annotation. My latest code is here: {-# LANGUAGE

[Haskell-cafe] Re: Polyvariadic functions operating with a monoid

2010-10-11 Thread Kevin Jardine
together in some way. I am a bit surprised that the (a ~ a') is needed, but Haskell will not compile this code with the more usual instance Monoidable a [a] where toMonoid a = [a] Kevin On Oct 11, 9:54 am, Kevin Jardine kevinjard...@gmail.com wrote: Hi Oleg, I've found that if I also add

[Haskell-cafe] Re: Polyvariadic functions operating with a monoid

2010-10-10 Thread Kevin Jardine
, but worked for Oleg's specific example. is still not clear to me. Kevin On Oct 9, 11:51 pm, Brandon S Allbery KF8NH allb...@ece.cmu.edu wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/9/10 10:25 , Kevin Jardine wrote: instance Show a = Monoidable a [String] where     toMonoid

[Haskell-cafe] Re: Polyvariadic functions operating with a monoid

2010-10-10 Thread Kevin Jardine
) specifically, GHC is attempting to derive PolyVariadic with the wrong version of WMonoid in each case. I'm using GHC 6.12.3 Perhaps the new GHC 7 type system would work better? Kevin On Oct 10, 8:26 am, Kevin Jardine kevinjard...@gmail.com wrote: Hi Brandon, True, when I replace [] with [], I get

[Haskell-cafe] Re: Polyvariadic functions operating with a monoid

2010-10-10 Thread Kevin Jardine
]) or main = putStrLn $ show $ unwrap $ ((polyToMonoid (0::Int) (1::Int) (2::Int) (3::Int)) :: WMonoid Int) the code compiles and returns the expected result. Kevin On Oct 10, 8:58 am, Kevin Jardine kevinjard...@gmail.com wrote: And in fact in both cases, it appears that GHC is trying to derive

[Haskell-cafe] Re: Polyvariadic functions operating with a monoid

2010-10-10 Thread Kevin Jardine
the outer type cast but I can't find a way to remove it. It appears that GHC needs to be told the type both coming and going so to speak for this to work consistently. Any suggestions for improvement welcome! Kevin On Oct 10, 11:12 am, Kevin Jardine kevinjard...@gmail.com wrote: OK, upon further

[Haskell-cafe] Re: Polyvariadic functions operating with a monoid

2010-10-10 Thread Kevin Jardine
Haskell, but if not then with CPP or Template Haskell). Kevin On Oct 10, 1:28 pm, Kevin Jardine kevinjard...@gmail.com wrote: For anyone who's interested, the code I have now is: {-# LANGUAGE TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses #-} module PolyTest where import

[Haskell-cafe] Re: Polyvariadic functions operating with a monoid

2010-10-10 Thread Kevin Jardine
For example, the notation can be reduced to: poly([String],True () (Just (5::Int))) using: #define poly(TYPE,VALUES) ((polyToMonoid (mempty :: TYPE) VALUES) :: TYPE) which I think is as concise as it can get. Kevin On Oct 10, 1:47 pm, Kevin Jardine kevinjard...@gmail.com wrote

[Haskell-cafe] Re: Polyvariadic functions operating with a monoid

2010-10-10 Thread Kevin Jardine
On Oct 10, 2:51 pm, Kevin Jardine kevinjard...@gmail.com wrote: For example, the notation can be reduced to: poly([String],True () (Just (5::Int))) using: #define poly(TYPE,VALUES) ((polyToMonoid (mempty :: TYPE) VALUES) :: TYPE) which I think is as concise as it can get. Kevin On Oct

[Haskell-cafe] Re: Polyvariadic functions operating with a monoid

2010-10-09 Thread Kevin Jardine
9, 5:04 am, o...@okmij.org wrote: Kevin Jardine wrote: instead of passing around lists of values with these related types, I created a polyvariadic function polyToString... I finally figured out how to do this, but it was a bit harder to figure this out than I expected, and I was wondering

[Haskell-cafe] Re: Polyvariadic functions operating with a monoid

2010-10-09 Thread Kevin Jardine
, but I would ideally like to hide the unwrap. Kevin On Oct 9, 1:50 pm, Bartek Ćwikłowski paczesi...@gmail.com wrote: Hello Kevin, 2010/10/9 Kevin Jardine kevinjard...@gmail.com: I was attempting to turn this into a small library and wanted to avoid exporting unwrap. I defined

[Haskell-cafe] Re: Polyvariadic functions operating with a monoid

2010-10-09 Thread Kevin Jardine
$ polyToMonoid [] True () (Just (5::Int)) fails to compile. Why would that be? My understanding is that all lists are automatically monoids. Kevin On Oct 9, 2:28 pm, Kevin Jardine kevinjard...@gmail.com wrote: Hi Bartek, Yes, it compiles, but when I try to use polyToMonoid', it turns out

[Haskell-cafe] Re: Polyvariadic functions operating with a monoid

2010-10-09 Thread Kevin Jardine
) (3::Int) In this case, I was expecting a sumOf function. This gives me: No instance for (PolyVariadic Int (WMonoid m)) arising from a use of `polyToMonoid' Any further suggestions? On Oct 9, 4:25 pm, Kevin Jardine kevinjard...@gmail.com wrote: Oleg, Another puzzle is that: instance

[Haskell-cafe] Polyvariadic functions operating with a monoid

2010-10-03 Thread Kevin Jardine
I had a situation where I had some related types that all had toString functions. Of course in Haskell, lists all have to be composed of values of exactly the same type, so instead of passing around lists of values with these related types, I created a polyvariadic function polyToString so that I

[Haskell-cafe] Re: Polyvariadic functions operating with a monoid

2010-10-03 Thread Kevin Jardine
3, 2010 at 1:26 PM, Luke Palmer lrpal...@gmail.com wrote: On Sun, Oct 3, 2010 at 1:24 AM, Kevin Jardine kevinjard...@gmail.com wrote: I had a situation where I had some related types that all had toString functions. Of course in Haskell, lists all have to be composed of values

[Haskell-cafe] Polymorphic record field?

2010-09-26 Thread Kevin Jardine
I have an almost finished Haskell program and I discovered that I needed to change the type of one record field. The problem is that the new type is polymorphic. Being new to Haskell, I simply changed: data MyStruct = MyStruct {myField :: myType} to data MyStruct = MyStruct {myField ::

[Haskell-cafe] Re: Polymorphic record field?

2010-09-26 Thread Kevin Jardine
OK, thanks for this advice. The type definition compiles, but when I try to actually access myField, the compiler says: Cannot use record selector `myField' as a function due to escaped type variables Probable fix: use pattern-matching syntax instead So I took the hint and wrote a new

[Haskell-cafe] Re: Polymorphic record field?

2010-09-26 Thread Kevin Jardine
! Kevin On Sep 26, 2:00 pm, Kevin Jardine kevinjard...@gmail.com wrote: OK, thanks for this advice. The type definition compiles, but when I try to actually access myField, the compiler says: Cannot use record selector `myField' as a function due to escaped type variables     Probable fix

[Haskell-cafe] Re: Polymorphic record field?

2010-09-26 Thread Kevin Jardine
Hi Michael, Yes, that does compile! Much less ugly and does not expose the internal bits of MyStruct. Thanks. Kevin On Sep 26, 2:26 pm, Michael Snoyman mich...@snoyman.com wrote: How about f myS@(MyStruct { myField = value }) ? On Sun, Sep 26, 2010 at 2:14 PM, Kevin Jardine kevinjard

[Haskell-cafe] Re: Scraping boilerplate deriving?

2010-09-15 Thread Kevin Jardine
Hi Malcolm, In this case, I am counting on GHC's {-# LANGUAGE GeneralizedNewtypeDeriving #-} feature to derive the instances for the classes I am including in the deriving clause. So perhaps portability is not a big issue here in any case. I do think that defObj(MyType) looks a bit cleaner

[Haskell-cafe] Re: Scraping boilerplate deriving?

2010-09-15 Thread Kevin Jardine
Hi Ben, Good point! I can confirm that it does compile under GHC 6.12. So really the same number of characters either way. Kevin On Sep 15, 4:49 pm, Ben Millwood hask...@benmachine.co.uk wrote: On Wed, Sep 15, 2010 at 2:11 PM, Kevin Jardine kevinjard...@gmail.com wrote: I do think

[Haskell-cafe] Scraping boilerplate deriving?

2010-09-14 Thread Kevin Jardine
I have a set of wrapper newtypes that are always of the same format: newtype MyType = MyType Obj deriving (A,B,C,D) where Obj, A, B, C, and D are always the same. Only MyType varies. A, B, C, and D are automagically derived by GHC using the {-# LANGUAGE GeneralizedNewtypeDeriving #-} feature.

[Haskell-cafe] Re: Scraping boilerplate deriving?

2010-09-14 Thread Kevin Jardine
Mitrofanov miguelim...@yandex.ru wrote:   Sorry, got stupid today. Won't help. 14.09.2010 12:29, Miguel Mitrofanov пишет:  class (A x, B x, C x, D x) = U x ? 14.09.2010 12:24, Kevin Jardine пишет: I have a set of wrapper newtypes that are always of the same format: newtype MyType = MyType

[Haskell-cafe] Re: Scraping boilerplate deriving?

2010-09-14 Thread Kevin Jardine
. Any ideas? The CPP solution works but Template Haskell is definitely cooler, so it would be great to get this to work! Kevin On Sep 14, 2:29 pm, Zefirov sergu...@gmail.com wrote: 2010/9/14 Kevin Jardine kevinjard...@gmail.com: I would like to use some macro system (perhaps Template Haskell

[Haskell-cafe] Re: Scraping boilerplate deriving?

2010-09-14 Thread Kevin Jardine
Hmm - It seems to work if the code is defined before my main function and not after it. Does this have to do with TH being part of the compile process and so the order matters? Kevin On Sep 14, 6:03 pm, Kevin Jardine kevinjard...@gmail.com wrote: Thanks Serguey! The library code compiles

[Haskell-cafe] Re: Scraping boilerplate deriving?

2010-09-14 Thread Kevin Jardine
Jardine kevinjard...@gmail.com wrote: Hmm - It seems to work if the code is defined before my main function and not after it. Does this have to do with TH being part of the compile process and so the order matters? Kevin On Sep 14, 6:03 pm, Kevin Jardine kevinjard...@gmail.com wrote

[Haskell-cafe] Re: Scraping boilerplate deriving?

2010-09-14 Thread Kevin Jardine
. Kevin On Sep 14, 11:01 pm, John Meacham j...@repetae.net wrote: On Tue, Sep 14, 2010 at 01:24:16AM -0700, Kevin Jardine wrote: I have a set of wrapper newtypes that are always of the same format: newtype MyType = MyType Obj deriving (A,B,C,D) where Obj, A, B, C, and D are always the same

[Haskell-cafe] Re: Unwrapping newtypes

2010-09-09 Thread Kevin Jardine
problem. I wanted one line. Fortunately, {-# LANGUAGE GeneralizedNewtypeDeriving #-} gives me what I want now that I know how it works! I agree that the Foldable solution was a bit of a kludge. Kevin On Sep 9, 3:57 am, Ertugrul Soeylemez e...@ertes.de wrote: Kevin Jardine kevinjard...@gmail.com

[Haskell-cafe] Re: Unwrapping newtypes

2010-09-09 Thread Kevin Jardine
that for you. Figuring out how to avoid writing the instances was the point of my original post. Kevin On Sep 9, 11:10 am, Ertugrul Soeylemez e...@ertes.de wrote: Kevin Jardine kevinjard...@gmail.com wrote: My goal was to find a way to define all that was needed using Haskell's automatic instance

[Haskell-cafe] Unwrapping newtypes

2010-09-08 Thread Kevin Jardine
I have a generic object that I want to wrap in various newtypes to better facilitate type checking. For example, newtype Blog = Blog Obj newtype Comment = Comment Obj newtype User = User Obj Unlike Obj itself, whose internal structure is hidden in a library module, the newtype wrappings are

[Haskell-cafe] Re: Unwrapping newtypes

2010-09-08 Thread Kevin Jardine
tonymor...@gmail.com wrote: I think you might want -XGeneralizedNewtypeDeriving http://haskell.org/ghc/docs/6.12.2/html/users_guide/deriving.html#id6... On 08/09/10 22:01, Kevin Jardine wrote: I have a generic object that I want to wrap in various newtypes to better facilitate type

[Haskell-cafe] Re: Unwrapping newtypes

2010-09-08 Thread Kevin Jardine
Hi Tony and James, I'm having trouble constructing the ToObj instance. The obvious code: toObj (w o) = o fails with a syntax error. How do I unwrap the value? Kevin On Sep 8, 2:30 pm, James Andrew Cook mo...@deepbondi.net wrote: On Sep 8, 2010, at 8:19 AM, Kevin Jardine wrote: Hi Tony

[Haskell-cafe] Re: Unwrapping newtypes

2010-09-08 Thread Kevin Jardine
Ah, I was missing an important piece of the puzzle. If I write: class ToObj a where toObj :: a - Obj instance ToObj Obj where toObj a = a then newtype Blog = Blog Obj deriving ToObj works! Thanks. On Sep 8, 2:36 pm, Kevin Jardine kevinjard...@gmail.com wrote: Hi Tony and James

[Haskell-cafe] Re: Unwrapping newtypes

2010-09-08 Thread Kevin Jardine
wrapped and bare objects less visible (except of course where it should matter). Kevin On Sep 8, 3:44 pm, Arie Peterson ar...@xs4all.nl wrote: On Wed, 8 Sep 2010 05:51:22 -0700 (PDT), Kevin Jardine kevinjard...@gmail.com wrote: Ah, I was missing an important piece of the puzzle. If I write

[Haskell-cafe] Re: ANNOUNCE: text 0.8.0.0, fast Unicode text support

2010-09-01 Thread Kevin Jardine
Hi Tako, The issues involved with String, ByteString, Text and a few related libraries were discussed at great length recently in this thread: http://groups.google.com/group/haskell-cafe/browse_thread/thread/52a21cf61ffb21b0/ Basically, Chars are 32 bit integers and Strings are represented as a

[Haskell-cafe] Re: Unix emulation

2010-08-23 Thread Kevin Jardine
I'd agree with Stephen. I've used MinGW / msys for years and would never consider doing any open source development (especially involving C) without it. In the past, installing it has only taken a few minutes. That still looks to be the case for MinGW but it now appears that msys has been split

[Haskell-cafe] regex-compat on latest Haskell Platform

2010-08-17 Thread Kevin Jardine
I'm running Haskel Platform 2010.2.0.0 and attempting to compile with regex-compat under Windows XP. The link stage fails with a number of lines of the form: D:\Program Files\Haskell Platform\2010.2.0.0\lib\extralibs\regex- posix-0.94.2\ghc-6.12.3/libHSregex-posix-0.94.2.a(Wrap.o):fake:(.text

[Haskell-cafe] Re: regex-compat on latest Haskell Platform

2010-08-17 Thread Kevin Jardine
I have found this project: http://gnuwin32.sourceforge.net/packages/regex.htm and downloaded the DLL. But just placing this in Windows/System32 does nothing. Kevin On Aug 17, 11:00 am, Kevin Jardine kevinjard...@gmail.com wrote: I'm running Haskel Platform 2010.2.0.0 and attempting

[Haskell-cafe] Re: regex-compat on latest Haskell Platform

2010-08-17 Thread Kevin Jardine
I was assuming that regex would work properly with the latest Haskell Platform so I haven't attempted to re-install it. However as I mentioned above, attempting to compile a program that uses regex fails with linker errors on my Windows XP machine. Any ideas on how I can fix this problem? Kevin

[Haskell-cafe] Re: regex-compat on latest Haskell Platform

2010-08-17 Thread Kevin Jardine
, 1:54 pm, Stephen Tetley stephen.tet...@gmail.com wrote: On 17 August 2010 12:45, Kevin Jardine kevinjard...@gmail.com wrote: I was assuming that regex would work properly with the latest Haskell Platform so I haven't attempted to re-install it. Yes - its wise not to upgrade platform

[Haskell-cafe] Re: String vs ByteString

2010-08-17 Thread Kevin Jardine
On Aug 17, 1:55 pm, Tako Schotanus t...@codejive.org wrote: I'll repeat here that in my opinion a Text package should be good at handling text, human text, from whatever country. If I need to handle large streams of ASCII I'll use something else. I would mostly agree. However, a key use

[Haskell-cafe] Re: regex-compat on latest Haskell Platform

2010-08-17 Thread Kevin Jardine
No, it's my own code. But in ghci even the simplest =~ fails on my machine. Here's a complete transcript: ghci GHCi, version 6.12.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ...

[Haskell-cafe] Re: regex-compat on latest Haskell Platform

2010-08-17 Thread Kevin Jardine
yep now I see it: http://trac.haskell.org/haskell-platform/ticket/137 Next time I'll check the bug tracker as well as Google before posting here! Thanks. Kevin On Aug 17, 2:37 pm, Stephen Tetley stephen.tet...@gmail.com wrote: Hi Kevin I've just installed Platform-2010.2.0.0 and I'm

[Haskell-cafe] Re: regex-compat on latest Haskell Platform

2010-08-17 Thread Kevin Jardine
The bug tracker recommended just installing from Hackage so with some trepidation I typed: cabal install regex-posix and everything now works as expected! So sorry for the waste of bandwidth. At least this thread is now in Google. Kevin On Aug 17, 3:06 pm, Kevin Jardine kevinjard

[Haskell-cafe] Re: regex-compat on latest Haskell Platform

2010-08-17 Thread Kevin Jardine
Mikhail and Don, All I needed to do was to type: cabal install regex-posix and everything now works as expected. As Mikhail also mentioned this problem is already in the Haskell Platform bug tracker. Kevin On Aug 18, 5:17 am, Don Stewart d...@galois.com wrote: kevinjardine: I'm running

[Haskell-cafe] Re: A cabal odyssey

2010-08-16 Thread Kevin Jardine
The latest version of the Haskell Platform is Haskell Platform 2010.2.0.0. However, even with the latest version, cabal install cabal-install installs cabal in the wrong place (not in extralibs/bin) under Windows at least so it is impossible to upgrade cabal. Having said that perhaps it is for

[Haskell-cafe] Re: String vs ByteString

2010-08-13 Thread Kevin Jardine
I'm interested to see this kind of open debate on performance, especially about libraries that provide widely used data structures such as strings. One of the more puzzling aspects of Haskell for newbies is the large number of libraries that appear to provide similar/duplicate functionality. The

[Haskell-cafe] Re: String vs ByteString

2010-08-13 Thread Kevin Jardine
This back and forth on performance is great! I often see ByteString used where Text is theoretically more appropriate (eg. the Snap web framework) and it would be good to get these performance issues ironed out so people feel more comfortable using the right tool for the job based upon API rather

[Haskell-cafe] Re: String vs ByteString

2010-08-13 Thread Kevin Jardine
Surely a lot of real world text processing programs are IO intensive? So if there is no native Text IO and everything needs to be read in / written out as ByteString data converted to/from Text this strikes me as a major performance sink. Or is there native Text IO but just not in your example?

[Haskell-cafe] Re: String vs ByteString

2010-08-13 Thread Kevin Jardine
I find it disturbing that a modern programming language like Haskell still apparently forces you to choose between a representation for mostly ASCII text and Unicode. Surely efficient Unicode text should always be the default? And if the Unicode format used by the Text library is not efficient

[Haskell-cafe] Re: String vs ByteString

2010-08-13 Thread Kevin Jardine
Hi Don, With respect, I disagree with that approach. Almost every modern programming language has one or at most two standard representations for strings. That includes PHP, Python, Ruby, Perl and many others. The lack of a standard text representation in Haskell has created a crazy patchwork

[Haskell-cafe] Re: String vs ByteString

2010-08-13 Thread Kevin Jardine
On Aug 14, 2:41 am, Brandon S Allbery KF8NH allb...@ece.cmu.edu wrote: Efficient for what?  The most efficient Unicode representation for Latin-derived strings is UTF-8, but the most efficient for CJK is UTF-16. I think that this kind of programming detail should be handled internally (even if

[Haskell-cafe] Re: can Haskell do everyting as we want?

2010-08-04 Thread Kevin Jardine
In my experience two of the biggest issues in selecting any language are the pool of potential programmers and the learning curve for the programmers you already have. If you only need two programmers to do a project and they both know Haskell well, then I think Haskell would do almost any job

[Haskell-cafe] Re: what's the best environment for haskell work?

2010-07-31 Thread Kevin Jardine
On Windows, I've used cedit for various projects for years and was delighted to discover that it comes with a Haskell syntax colouring file. See: http://cedit.sourceforge.net/ It supports collections of project files and compiling directly from the editor. I also use Eclipse for (sigh) PHP

[Haskell-cafe] Re: Can we come out of a monad?

2010-07-30 Thread Kevin Jardine
The original poster states that the type of modifiedImage is simply ByteString but given that it calls execState, is that possible? Would it not be State ByteString? Kevin On Jul 30, 9:49 am, Anton van Straaten an...@appsolutions.com wrote: C K Kashyap wrote: In the code here -

[Haskell-cafe] Re: Can we come out of a monad?

2010-07-30 Thread Kevin Jardine
Oops, I should have written IO ByteString as the State stuff is only *inside* execState. But a monad none the less? Kevin On Jul 30, 9:59 am, Kevin Jardine kevinjard...@gmail.com wrote: The original poster states that the type of modifiedImage is simply ByteString but given that it calls

[Haskell-cafe] Re: Can we come out of a monad?

2010-07-30 Thread Kevin Jardine
in this as well. Kevin On Jul 30, 10:11 am, Kevin Jardine kevinjard...@gmail.com wrote: Oops, I should have written IO ByteString as the State stuff is only *inside* execState. But a monad none the less? Kevin On Jul 30, 9:59 am, Kevin Jardine kevinjard...@gmail.com wrote: The original

[Haskell-cafe] Re: Can we come out of a monad?

2010-07-30 Thread Kevin Jardine
? Apparently not. Although functions that do this for monads that have side effects are unsafe, so use them carefully. Cheers, Kevin On Jul 30, 11:17 am, Anton van Straaten an...@appsolutions.com wrote:   On Jul 30, 9:59 am, Kevin Jardine kevinjard...@gmail.com wrote:     The original poster

[Haskell-cafe] Re: Can we come out of a monad?

2010-07-30 Thread Kevin Jardine
Straaten an...@appsolutions.com wrote: Kevin Jardine wrote: I think that these are therefore the responses to the original questions: I am of the understanding that once you into a monad, you cant get out of it? You can run monadic functions and get pure results. Some clarifications

[Haskell-cafe] Re: Can we come out of a monad?

2010-07-30 Thread Kevin Jardine
           return (x + 3) of      Just a   -  a      Nothing  -  0 So we can get out of many monads, but we need to know which one it is to use the appropriate operation. Kevin Jardine wrote: I'm still trying to understand how monads interact with types so I am interested in this as well

[Haskell-cafe] Re: Can we come out of a monad?

2010-07-30 Thread Kevin Jardine
On Jul 30, 1:11 pm, Brent Yorgey byor...@seas.upenn.edu wrote: Monads are hard to understand.  But they are *worth understanding*. That's the most inspiring and encouraging statement I've seen all week. Thanks! Kevin ___ Haskell-Cafe mailing list

[Haskell-cafe] Re: Lists and monads

2010-07-27 Thread Kevin Jardine
Looks interesting. I've also come across Data.List.Class: http://hackage.haskell.org/packages/archive/generator/0.5.1/doc/html/Data-List-Class.html Has anyone used that? Kevin On Jul 27, 6:02 pm, wren ng thornton w...@freegeek.org wrote: Kevin Jardine wrote: But as I said, that is just

[Haskell-cafe] Lists and monads

2010-07-26 Thread Kevin Jardine
As a Haskell neophyte, one of the things I find confusing is the way that the usual list functions (map, fold, ++, etc.) often cannot be used directly with monadic lists (m [a] or [m a]) but seem to require special purpose functions like ap, mapM etc. I get the idea of separating pure and impure

[Haskell-cafe] Re: Lists and monads

2010-07-26 Thread Kevin Jardine
On Jul 26, 3:00 pm, Vo Minh Thu not...@gmail.com wrote: Also, just like with IO, maybe restructuring the code to separate monadic code would help. The specific monad I am dealing with carries state around inside it. I could revert to a pure system in many cases by simply passing the state as

[Haskell-cafe] Re: Lists and monads

2010-07-26 Thread Kevin Jardine
On Jul 26, 3:19 pm, Vo Minh Thu not...@gmail.com wrote: Maybe you missed the part of my answer hinting to applicative style? No, I saw that but as I mentioned, I am looking for a tutorial. The source code alone means little to me. LYAH has a chapter about it[0]. Thanks for the pointer. I

[Haskell-cafe] Re: Lists and monads

2010-07-26 Thread Kevin Jardine
On Jul 26, 3:26 pm, Bill Atkins watk...@alum.rpi.edu wrote: Can you post an example of your code? Without getting into the complexities, one simple example is a fold where the step function returns results in a monad. I have taken to replacing the fold in that case with a recursive function,

[Haskell-cafe] Re: Lists and monads

2010-07-26 Thread Kevin Jardine
On Jul 26, 3:49 pm, Kevin Jardine kevinjard...@gmail.com wrote: I find myself wishing that f (m [a]) just automatically returned m f([a]) without me needing to do anything but I expect that there are reasons why that is not a good idea. Or is there a monadic list module where f(m [a]) = m f

[Haskell-cafe] Re: Lists and monads

2010-07-26 Thread Kevin Jardine
On Jul 26, 4:12 pm, Bill Atkins watk...@alum.rpi.edu wrote: The answer is still applicative.  :) OK, then I know where to spend my reading time. Thanks! Kevin ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Re: Haskell Forum

2010-07-26 Thread Kevin Jardine
Other topics I am interested in are served by both a web forum and a mailing list, usually with different content and participants in both. In my experience, routing one kind of content to another does not work very well because of issues of spam control, moderation, topic subdivisions, the

[Haskell-cafe] Re: Haskell Forum

2010-07-26 Thread Kevin Jardine
On Jul 26, 6:45 pm, Nick Bowler nbow...@elliptictech.com wrote: Since when do mailing lists not have threading?  Web forums with proper support for threading seem to be few and far apart. Most of the email clients I'm familiar with don't support threaded displays and most of the web forums I'm

[Haskell-cafe] Re: Haskell Forum

2010-07-26 Thread Kevin Jardine
On Jul 26, 10:10 pm, Evan Laforge qdun...@gmail.com wrote: Interesting, I've never figured out why some people prefer forums, but you're proof that they exist :)   This debate is eerily similar to several others I've seen (for example, on the interactive fiction mailing list). In every case

[Haskell-cafe] Re: Haskell Forum

2010-07-26 Thread Kevin Jardine
On Jul 26, 10:37 pm, Nick Bowler nbow...@elliptictech.com wrote: It seems to me, then, that a wine-like web forum - mailing list gateway would satisfy everyone without fragmenting the community? Seehttp://forum.winehq.org/viewforum.php?f=2. -- Nick Bowler, Elliptic Technologies

[Haskell-cafe] Re: Haskell Forum

2010-07-26 Thread Kevin Jardine
On Jul 26, 10:37 pm, Nick Bowler nbow...@elliptictech.com wrote: It seems to me, then, that a wine-like web forum - mailing list gateway would satisfy everyone without fragmenting the community? Definitely looks like an interesting option, although since Google groups and any decent web forum

[Haskell-cafe] Re: gd on Win32

2010-07-21 Thread Kevin Jardine
Is there an easy way to install this module on Windows? I just ran cabal install gd and got the rather intimidating response: Missing C libraries: gd, png, z, jpeg, fontconfig, freetype, expat I actually have some of these libraries installed (eg. expat) but not most. I'm using MinGW.

[Haskell-cafe] Re: gd on Win32

2010-07-21 Thread Kevin Jardine
On Jul 21, 10:57 pm, Stephen Tetley stephen.tet...@gmail.com wrote: Given the number of libraries involved, I'd look for an alternative to GD. ___ Yes, I've seen reports that people have tried and failed to install the Haskell GD module on Windows.

[Haskell-cafe] Haskell Platform dependency hell

2010-07-16 Thread Kevin Jardine
I have Haskell Platform 2010.1.0.0 installed under Windows and I often find that Haskell breaks if I try upgrading some of the current modules. For example, after using cabal to upgrade to the latest version of Network.CGI, I can no longer compile any code and instead get this message:

[Haskell-cafe] Heist template splice functions and custom monad

2010-06-14 Thread Kevin Jardine
I'd like to run Heist template splice functions in my own custom monad. I can define a splice function as: mySplice :: Splice MyMonad However, when I try to call functions that return values in my monad in mySplice, I get a compile error: Couldn't match expected type TemplateMonad MyMonad a

[Haskell-cafe] Efficient string construction

2010-06-03 Thread Kevin Jardine
(I've done a basic Google search on this with no results. Apologies if this has been asked before.) I am coding a web application in which the content is a Unicode string built up over multiple functions and maintained in a State structure. I gather that the String module is inefficient and

Re: [Haskell-cafe] Efficient string construction

2010-06-03 Thread Kevin Jardine
--- On Thu, 6/3/10, Daniel Fischer daniel.is.fisc...@web.de wrote: Perhaps Data.ByteString[.Lazy].UTF8 is an even better choice than Data.Text (depends on what you do). I thought that I had the differences between the three libraries figured out but I guess not now from what you say. I had

[Haskell-cafe] GPL answers from the SFLC (WAS: Re: ANN: hakyll-0.1)

2010-03-04 Thread Kevin Jardine
I'm a Haskell newbie but long time open source developer and I've been following this thread with some interest. The GPL is not just a license - it is a form of social engineering and social contract. The idea if I use the GPL is that I am releasing free and open source software to the

Re: [Haskell-cafe] FastCGI under Windows

2009-11-28 Thread Kevin Jardine
. Kevin --- On Thu, 11/26/09, Michael Snoyman mich...@snoyman.com wrote: From: Michael Snoyman mich...@snoyman.com Subject: Re: [Haskell-cafe] FastCGI under Windows To: Kevin Jardine kevinjard...@yahoo.com Cc: haskell-cafe@haskell.org Date: Thursday, November 26, 2009, 12:36 PM You could try

Re: [Haskell-cafe] FastCGI under Windows

2009-11-25 Thread Kevin Jardine
127.0.0.1] Premature end of script headers: test2.fcgi Any suggestions? Kevin --- On Wed, 11/25/09, Kevin Jardine kevinjard...@yahoo.com wrote: From: Kevin Jardine kevinjard...@yahoo.com Subject: [Haskell-cafe] FastCGI under Windows To: haskell-cafe@haskell.org Date: Wednesday, November 25, 2009