Re: [Haskell-cafe] hsql-mysql encoding issues
So far I used HDBC with mysql and sqlite3, in both cases with UTF8 encoded data (filenames including chinese characters, umlauts etc, e.g.). (After connecting to mysql, I use the statement set names utf8; sqlite does not need this) Am 10/24/12 11:10 AM, schrieb Johannes Waldmann: Daniel van den Eijkel dvde at gmx.net writes: ... but I use HDBC and I'm happy with it. including its handling of character encodings? (That is, do you have, e.g., texts with umlauts in your data?) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] hsql-mysql encoding issues
Hi, I can't say anything about HSQL, but I use HDBC and I'm happy with it. [1] says it's the most popular database for Haskell. Best, Daniel [1] http://en.wikibooks.org/wiki/Haskell/Database Am 10/23/12 4:21 PM, schrieb Johannes Waldmann: Hi. I am using hsql-(mysql-)1.8.2 When compiled with ghc-7.6, the resulting executable does not seem to be able to read strings from the DB correctly (umlauts do vanish) while it worked with hsql-(mysql-)1.8.1 and ghc-7.4. the mysql server says (show variables) | character_set_client| latin1 | | character_set_connection| latin1 | | character_set_database | latin1 | | character_set_filesystem| binary | | character_set_results | latin1 | | character_set_server| latin1 | | character_set_system| utf8| hsql is using type String all over the place, while it should be ByteString? Internally, Database.HSQL.Types.SqlBind uses Foreign.C.String.peekCStringLen . Did the behaviour of this function change? hsql is quite old, but so is my application. Assuming I find the time to rewrite my code (not likely) - what DB binding should I rather be using? Thanks - J.W. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Haskell Logo
http://en.wikipedia.org/wiki/File:Haskell-Logo.svg cheers daniel Am 6/25/11 8:18 AM, schrieb Michael Xavier: I wondered if anyone knew the legalities of using the haskell logo, in particular, this one: http://media.nokrev.com/junk/haskell-logos/logo1.png on a website, a personal blog in particular. While I am not yet a primarily haskell coder, I'm using it more and more. I find this logo in particular to be quite beautiful and would probably modify it a bit to emphasize the lambda, which has broader application to computer science beyond 1 language. I can't find any information on what the license is for this image. Could anyone offer any advice on this? -- Michael Xavier http://www.michaelxavier.net ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Haskell meeting in Berlin on Tuesday Nov 9th
Hi everybody, just wanted to send this again to the list - it's tomorrow. Cheers Daniel Am 10/31/10 6:30 PM, schrieb Sönke Hahn: I can confirm the next meeting: Date: Tuesday, November 9th Time: from 20:00 Location: c-base, Rungestrasse 20, 10179 Berlin I was asked by some people from c-base, if we could do a talk about Haskell for non-haskellers, which is a good idea, IMHO. We could discuss the details in the mext meeting. Sönke ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Haskell meeting in Berlin
Hi, thanks to all participants for the funny meeting! I had a lot of fun and I'm looking forward to see you again. Best, Daniel Sönke Hahn schrieb: Hi all! There will be an informal Haskell meeting in Berlin. Date: Thursday, October 28th Time: from 20:00 Location: c-base, Rungestrasse 20, 10179 Berlin The bi-monthly lisp meeting takes place at the same time and place [1]. This is the first of hopefully more meetings to come, so we will probably discuss the details of following meetings. If you're in Berlin and want to talk to other Haskell users (or want to yell at lisp users for being from the dark side of the force), please come by. Cheers, Sönke [1] http://www.c-base.org/calender/phpicalendar/month.php ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] What is -
If xs is a list, xs = f is the same as (concat (map f xs)). Take a look at the monad instance for lists. So, in [1..] = \x - x is "every" element of the list. Example: [1,2,3] = \x - [x, x*2] is concat [ (\x - [x, x*2]) 1 , (\x - [x, x*2]) 2 , (\x - [x, x*2]) 3 ] is concat [ [1,1], [2,4], [3,6] ] is [1,1,2,4,3,6] hope that helps. best regards, daniel michael rice schrieb: getLine = \x - -- x is a string at this point [1..] = \x - -- x is WHAT at this point? MIchael --- On Sun, 8/8/10, Henning Thielemann lemm...@henning-thielemann.de wrote: From: Henning Thielemann lemm...@henning-thielemann.de Subject: Re: [Haskell-cafe] What is - To: "michael rice" nowg...@yahoo.com Cc: haskell-cafe@haskell.org Date: Sunday, August 8, 2010, 9:38 AM On Sun, 8 Aug 2010, michael rice wrote: So, Example 2 desugared becomes... [1..] == \z - ? Yes, [1..] = \z - ... ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] What is -
Daniel van den Eijkel schrieb: If xs is a list, xs = f is the same as (concat (map f xs)). Take a look at the monad instance for lists. So, in [1..] = \x - x is "every" element of the list. Example: [1,2,3] = \x - [x, x*2] is concat [ (\x - [x, x*2]) 1 , (\x - [x, x*2]) 2 , (\x - [x, x*2]) 3 ] is concat [ [1,1], [2,4], [3,6] ] typo: should be [1,2] is [1,1,2,4,3,6] ... and [1,2, ... hope that helps. best regards, daniel michael rice schrieb: getLine = \x - -- x is a string at this point [1..] = \x - -- x is WHAT at this point? MIchael --- On Sun, 8/8/10, Henning Thielemann lemm...@henning-thielemann.de wrote: From: Henning Thielemann lemm...@henning-thielemann.de Subject: Re: [Haskell-cafe] What is - To: "michael rice" nowg...@yahoo.com Cc: haskell-cafe@haskell.org Date: Sunday, August 8, 2010, 9:38 AM On Sun, 8 Aug 2010, michael rice wrote: So, Example 2 desugared becomes... [1..] == \z - ? Yes, [1..] = \z - ... ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Suggestions For An Intro To Monads Talk.
For me, the following two things did the magic, so I'll suggest them: 1. Writing a recursive function that takes a binary tree and returns the same tree, but with its leaves enumerated. Each function call takes the tree and the counter and returns the resulting tree and the new counter value. The pattern that emerges is similar to the state monad. The pattern shows that the order of the recursive calls is not ambiguous, unlike in a function that just counts the leaves, for example. Changing the order of the recursive calls changes the result. (code below) 2. Putting the above pattern into a datatype and rewriting the apply-funtion for this datatype (=) allows only to apply funtions in a non-ambiguous way. Not giving a deconstructor for the IO monad forces the programmer to decide in which order calls to IO functions have to be done. I hope this is clear enough; I was able to use the IO monad at the moment I realized that Haskell uses this kind of "trick" to ensure that the order of execution of function arguments is always well-defined and never ambiguous. Of course, there is much more about monads, but this was my entry point. Best regards Daniel code (tree enumeration): data Tree a = Leaf a | Node (Tree a) (Tree a) deriving Show enumTree n (Node a b) = let (n', a') = enumTree n a in let (n'', b') = enumTree n' b in (n'', Node a' b') enumTree n (Leaf x) = (n+1, Leaf n) aditya siram schrieb: Hi all, I am doing an "Intro To Monads" talk in September [1]. The audience consists of experienced non-Haskell developers but they will be familiar with basic functional concepts (closures, first-class functions etc.). I am looking for suggestions on how to introduce the concept and its implications. I'd also like to include a section on why monads exist and why we don't really see them outside of Haskell. Has anyone here done a talk like this? And if so what parts of your presentation were successful and what would you stay away from. Thanks for the feedback. -deech [1] It's in St.Louis, Missouri at the St.Louis Perl Mongers meeting so come on by if you're around! ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] double2Float is faster than (fromRational . toRational)
Dear Haskellers, I just want to share an observation. I had to convert a Double to a Float value in an inner loop of an application, and I used somethin like this: xf = (fromRational $ toRational xd) :: Float The program works on windows but it did not on OSX - it was too slow. Now, after big headaches and much frustration, I replaced the code above with this line (why didn't I come up with this earlier?): xf = double2Float xd and now everything works just fine. I am not really surprised by the speed-up (and no-one should be), but I am still surprised how often such kinds of unobvious problems occur while programming in Haskell. So I write this email just to remind me and you to look out for such pitfalls. Best, Daniel ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] double2Float is faster than (fromRational . toRational)
I see. And I changed the code, it works well. Thanks for that! Daniel Henning Thielemann schrieb: On Fri, 21 May 2010, Daniel van den Eijkel wrote: Dear Haskellers, I just want to share an observation. I had to convert a Double to a Float value in an inner loop of an application, and I used somethin like this: xf = (fromRational $ toRational xd) :: Float I think realToFrac is the function to use here, and this might be replaced by double2Float by an optimizer rule. I think double2Float is from a GHC package and thus one should avoid to call double2Float directly. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: virus/trojan in bamse package?
Thank you for that answer. All I could find out is that the file that causes the alarm is named folder.exe (size: 82kb). I don't know for sure what that is, but since I don't need the package I simply deleted it. Probably it was just a coincidence that I had some trojan problems just after zipping and unzipping that hackage torrent... Regards, Daniel Jannis (jix) Harder schrieb: Am 07.11.2009, 16:28 Uhr, schrieb Daniel van den Eijkel d...@gmx.net: hi, my Avira antivirus program says that there is a trojan in the bamse-0.9.5 package. I downloaded the hackage-torrent a week ago, and Avira says TR/Crypt.CFI.Gen is in bamse. To be sure, I downloaded bamse-0.9.5 from hackage today, and now avira says less specificly that there are some viruses and/or unwanted programs inside. .Gen usually means that the file isn't a known virus but some heuristics triggered. This can also happen if a file is compressed with an executable packer that the virus scanner can't decompress, which wouldn't be strange for an installer tool. I don't know if that's the problem in this case but I had a lot of trouble with virus scanners in combination with executable packers so it might be. -- Jannis ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] virus/trojan in bamse package?
hi, my Avira antivirus program says that there is a trojan in the bamse-0.9.5 package. I downloaded the hackage-torrent a week ago, and Avira says TR/Crypt.CFI.Gen is in bamse. To be sure, I downloaded bamse-0.9.5 from hackage today, and now avira says less specificly that there are some viruses and/or unwanted programs inside. Since I have some trojan trouble for a few days now, bamse might be the reason for that, but I am not sure. Maybe it is a false alarm, I can't determine this. (bamse is a framework for building Windows Installer, so it might contain code that looks like a virus or alike wrongly?) Does anybody know if this is really a virus/trojan? Best regards, Daniel ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] hackage is down.
you saved my day! thanks, daniel Jochem Berndsen schrieb: On Sun, Nov 01, 2009 at 07:58:00AM -0600, Thomas Hartman wrote: http://hackage.haskell.org Hackage is down currently, I am seeding the torrent by mauke from IRC on http://mauke.ath.cx/tmp/2009-10-19-hackage-archive.torrent Cheers, Jochem ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] [Haskell Cafe] Troubles with StateT and Parsec
Hi Paul, the expression (lift parse $ parseSyslog message) has the same meaning as (lift parse (parseSyslog message)), so you are indeed applying lift to two arguments, while it expects one. Probably you forgot the $ after lift? Best regards, Daniel Paul Sujkov schrieb: Hi haskellers, I have a few problems using monad transformers. I have such two functions: parseSyslog :: StateT Integer Parser TimeStamp parseString :: StateT Integer Parser LogString and the following code: parseString = do -- string parse here, all in the form of lift $ parser stamp - lift $ lexeme parseTimestamp -- ? timestamp message - lift $ manyTill anyToken eof-- ? message return (LogString ...parsed values here... (check stamp console message) ...more parsed values here...) where check :: (Maybe TimeStamp) - Console - String - Maybe TimeStamp check Nothing Syslog message = case (lift parse $ parseSyslog message) of Left err - Nothing Right res - Just res ...other clauses here... this code seems quite intuitive to me, however it doesn't compile with a king error: Couldn't match kind `(* - *) - * - *' against `?? - ? - *' When matching the kinds of `t :: (* - *) - * - *' and `(-) :: ?? - ? - *' Probable cause: `lift' is applied to too many arguments In the first argument of `($)', namely `lift parse' I'm not so familiar with monad transformers whatsoever, so I'll be very happy if someone can show me the right way. The code compile nicely if I use parse line in a such way: check Nothing Syslog message = case (parse (evalStateT parseSyslog 0) message) of but this is not what I really want. To be accurate, here is the sequence which I do want to have in the code: some user state is initialized; parseString gets called many times and changes the state via call to the parseSyslog (that is the only function that really uses/affects user state, everything else is pure Parsec code with it's own internal state). Two main problems that I have now is: 1) impossibility to use parse/parseTest functions with the (StateT state type Parser parse type) argument. I want it to be lifted somehow, but cannot see how 2) too many lifts in the code. I have only one function that really affects state, but code is filled with lifts from StateT to underlying Parser Sorry if the questions are silly; any help is appreciated -- Regards, Paul Sujkov ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ghci identifier listing question
Ah, thats great! And it shows the values (or part of if), too. Very nice. Thank you, Daniel Jeff Wheeler schrieb: On Mon, Jul 27, 2009 at 6:37 PM, Daniel van den Eijkeld...@gmx.net wrote: Is it possible, to reach the (shadowed) values in any way? I'm not sure about this, but . . . Another question: Is it possible to show only those identifiers that are defined during the interactive session? I only can list all identifiers which start with a given prefix, but I would like to know if GHCi can show me all identifiers defined in a given module or in the current session (by pressing Tab or alike). Yes, this will list the current bindings: :show bindings Jeff Wheeler ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] ghci identifier listing question
Hi, in GHCi, after pressing the tab-key, all defined identifiers are listed. If an identifier was redefined, all old and shadowed versions are listed, too. Is it possible, to reach the (shadowed) values in any way? Another question: Is it possible to show only those identifiers that are defined during the interactive session? I only can list all identifiers which start with a given prefix, but I would like to know if GHCi can show me all identifiers defined in a given module or in the current session (by pressing Tab or alike). Best regards, Daniel ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] RE: Haskell as a first language?
In an ideal world, Haskell would be a perfect first programming language. But consider: If someone without any programming background learns Haskell as first language, she or he might have big problems using any other language after that. Unlearning what you can do with Haskell is much harder than unlearning imperative thinking. (I had to learn PHP after I was used to write in Haskell, and it was no fun) I don't want to miss the great experience of learning Haskell *after* Scheme (and Scheme after C), and I would not like to deprieve anybody of such an experience. Or what should they have for dessert? I don't know if that's a good argument. Best regards, Daniel ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANN: bloxorz clone
Very nice! Just to give feedback: It installs and works perfectly on windows. kind regards, daniel Patai Gergely schrieb: Hello all, This post is not about my own creation, it's just a little fun program written by a student of mine. You can install the bloxorz package to try it out, and read more about its background on my blog: http://just-bottom.blogspot.com/2009/07/playing-and-learning.html Gergely ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Use MySQL from Haskell
The same with me - I'm on XP, and HDBC-odbc is the library I got running to access the MySQL database. Regards, Daniel Michael Snoyman schrieb: Marciej, I went the HDBC route and got the same problem. Although it does not seem to be officially blessed, try installing the time-1.1.3 package. It's working for me at least, which I know is a dubious recommendation. Also, I am currently using the hdbc-odbc package for accessing MySQL. I couldn't get hdbc-mysql to work properly. I hope that once I get this project working right, I'll have a chance to dig into the hdbc-mysql issue itself. Good luck! Michael On Fri, Jun 19, 2009 at 12:26 AM, Maciej Podgurski maciej.podgur...@googlemail.com mailto:maciej.podgur...@googlemail.com wrote: Hello, I'm trying to use MySQL from Haskell but it seems impossible for me to install one of the MySQL packages on my Windows XP machine. First I tired to install hsql-mysql-1.7.1 on GHC 6.10.3 but installing haskelldb-hsql failed with a hidden package error. So I added the old-time package to the cabal file but there still was a compile error (something due to the change from Exception to Exception e = e). So I switched to GHC 6.8.3 and tried it again. Now it says: Configuring hsql-mysql-1.7.1... Warning: 'extra-lib-dirs: /usr/lib/mysql' directory does not exist. Warning: 'include-dirs: /usr/include/mysql' directory does not exist. Warning: This package indirectly depends on multiple versions of the same package. This is highly likely to cause a compile failure. package process-1.0.0.1 requires filepath-1.1.0.0 package directory-1.0.0.1 requires filepath-1.1.0.0 package Cabal-1.6.0.3 requires filepath-1.1.0.2 Setup: Missing dependency on a foreign library: * Missing C library: mysqlclient This problem can usually be solved by installing the system package that provides this library (you may need the -dev version). If the library is already installed but in a non-standard location then you can use the flags --extra-include-dirs= and --extra-lib-dirs= to specify where it is. There's no Haskell package mysqlclient and I don't know how to install a C library in Haskell. So I switched to HDBC-2.1.1 and got the next compile error: Building convertible-1.0.5... Data/Convertible/Instances/Num.hs:671:0: warning: no newline at end of file [...] [5 of 8] Compiling Data.Convertible.Instances.C ( Data/Convertible/Instances/C.hs, dist\build/Data/C onvertible/Instances/C.o ) [6 of 8] Compiling Data.Convertible.Instances.Time ( Data/Convertible/Instances/Time.hs, dist\build/ Data/Convertible/Instances/Time.o ) Data/Convertible/Instances/Time.hs:64:0: Duplicate instance declarations: instance Typeable NominalDiffTime -- Defined at Data/Convertible/Instances/Time.hs:(64,0)-(65,42) instance Typeable NominalDiffTime -- Defined in time-1.1.3:Data.Time.Clock.UTC Data/Convertible/Instances/Time.hs:67:0: Duplicate instance declarations: instance Typeable UTCTime -- Defined at Data/Convertible/Instances/Time.hs:(67,0)-(68,34) instance Typeable UTCTime -- Defined in time-1.1.3:Data.Time.Clock.UTC So please help me, what GHC/package configuration will I need to use MySQL from my Haskell programs on Windows? I really like Haskell but all those broken packages are really discouraging. :( Best wishes, Maciej ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org mailto:Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] IORef memory leak
Don Stewart schrieb: It is not possible to write a modifyIORef that *doesn't* leak memory! Why? Or can one read about it somewhere? Best regards, Daniel ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] IORef memory leak
Don Stewart schrieb: dvde: Don Stewart schrieb: It is not possible to write a modifyIORef that *doesn't* leak memory! Why? Or can one read about it somewhere? Try writing a version of this program, using modifyIORef only, such that it doesn't exhaust the heap: import Data.IORef import Control.Monad import System.IO.Unsafe ref :: IORef Int ref = unsafePerformIO $ newIORef 0 {-# NOINLINE ref #-} main = do modifyIORef ref (\a - a + 1) main Run it in a constrained environment, so you don't thrash: $ ./A +RTS -M100M Heap exhausted; Current maximum heap size is 9744 bytes (95 MB); use `+RTS -Msize' to increase it. The goal is to run in constant space. -- Don Hm, do you say it is not possible to write a modifyIORef function that does not leak memory, or do you say it is not possible to use the (existing) modifyIORef without having memory leaks? I wrote the following which runs in constant space, but it introduces strictness, which is not always desirable. And yes, using only modifyIORef this could not be done this way, because the strict evaluation happens on the IO-Monad-level. But such examples occured already in this thread. import Data.IORef import Control.Monad import System.IO.Unsafe ref :: IORef Int ref = unsafePerformIO $ newIORef 0 {-# NOINLINE ref #-} main = do myModifyIORef ref (\a - a + 1) main myModifyIORef :: IORef a - (a-a) - IO () myModifyIORef ref f = do a - readIORef ref let a' = f a seq a' $ writeIORef ref a' So would it make sense to create a strict modifyIORef' function? best regards, daniel ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] IORef memory leak
Yes I guessed that. Thanks, Daniel Claus Reinke schrieb: It is not possible to write a modifyIORef that *doesn't* leak memory! Why? Or can one read about it somewhere? Possibly, Don meant that 'modifyIORef' is defined in a way that does not allow to enforce evaluation of the result of the modification function (a typical problem with fmap-style library functions): modifyIORef ref f = readIORef ref = writeIORef ref . f No matter whether 'f' is strict or not, the 'writeIORef r' doesn't evaluate its result, just stores the unevaluated application: r-newIORef 0 modifyIORef r (\x-trace done $ x+1) modifyIORef r (\x-trace done $ x+1) readIORef r done done 2 If it had been defined like this instead mRef r ($) f = readIORef r = (writeIORef r $) . f it would be possible to transform the strictness of 'writeIORef r' to match that of 'f': r-newIORef 0 mRef r ($) (\x-trace done $ x+1) mRef r ($) (\x-trace done $ x+1) readIORef r done done 2 r-newIORef 0 mRef r ($!) (\x-trace done $ x+1) done mRef r ($!) (\x-trace done $ x+1) done readIORef r 2 Claus ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Use MySQL from Haskell
Hi Maciej, Database.HDBC.getTables works fine here (XP, ghc 6.10.2, HDBC-2.1.0, HDBC-ODBC-2.1.0.0) - it gives me the list of all tablenames, as intended. Which HDBC version do you use? best regards, daniel Maciej Podgurski schrieb: Does Database.HDBC.getTables work for you? I successfully created a new table and selected data from a database but getTables always returns an empty list (what is not a big problem since a query show tables works fine). Besh wishes, Maciej W dniu 19.06.2009 13:50 Daniel van den Eijkel pisze: The same with me - I'm on XP, and HDBC-odbc is the library I got running to access the MySQL database. Regards, Daniel Michael Snoyman schrieb: Marciej, I went the HDBC route and got the same problem. Although it does not seem to be officially blessed, try installing the time-1.1.3 package. It's working for me at least, which I know is a dubious recommendation. Also, I am currently using the hdbc-odbc package for accessing MySQL. I couldn't get hdbc-mysql to work properly. I hope that once I get this project working right, I'll have a chance to dig into the hdbc-mysql issue itself. Good luck! Michael ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] what is [::]
Dear Haskellers, please can anybody tell me what [::] means or where to read about it? A few days ago I saw this for the first time in my life, at the list of instances of the Functor class, and I don't know where to look for information. The search engines I tried didn't produce results for [::]. Thanks, Daniel ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] what is [::]
ah! ok, thanks for the hint... regards, daniel Jonathan Cast schrieb: On Wed, 2009-02-18 at 16:28 +0100, Daniel van den Eijkel wrote: Dear Haskellers, please can anybody tell me what [::] means or where to read about it? A few days ago I saw this for the first time in my life, at the list of instances of the Functor class, and I don't know where to look for information. The search engines I tried didn't produce results for [::]. Try Googling `Haskell Parallel Arrays' instead. jcc ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] type metaphysics
I had the same idea, here's my implemention, running on an old Winhugs 2001 (and GHC 6.8). regards, Daniel import System import Directory chars = map chr [32..126] string 0 = return string n = do c - chars s - string (n-1) return (c:s) mkfun n = do s - string n return (f :: Integer - Bool; f = ++ s) test fundef = do system (del test.exe) writeFile test.hs (fundef ++ ; main = return ()) system (ghc --make test.hs) b - doesFileExist test.exe if b then putStrLn fundef else return () main = do let fundefs = [0..] = mkfun mapM_ test $ drop 1000 fundefs Lennart Augustsson schrieb: You can enumerate all possible implementations of functions of type (Integer - Bool). Just enumerate all strings, and give this to a Haskell compiler f :: Integer - Bool f = enumerated-string-goes-here if the compiler is happy you have an implementation. The enumerated functions do not include all mathematical functions of type (Integer - Bool), but it does include the ones we usually mean by the type (Integer - Bool) in Haskell. -- Lennart On Mon, Feb 2, 2009 at 4:47 PM, Martijn van Steenbergen mart...@van.steenbergen.nl wrote: Lennart Augustsson wrote: The Haskell function space, A-B, is not uncountable. There is only a countable number of Haskell functions you can write, so how could there be more elements in the Haskell function space? :) The explanation is that the Haskell function space is not the same as the functions space in set theory. Most importantly Haskell functions have to be monotonic (in the domain theoretic sense), so that limits the number of possible functions. I was thinking about a fixed function type A - B having uncountably many *values* (i.e. implementations). Not about the number of function types of the form A - B. Is that what you meant? For example, fix the type to Integer - Bool. I can't enumeratate all possible implementations of this function. Right? Martijn. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] type metaphysics
oops, the '$ drop 1000' in the main function should not be there... Daniel van den Eijkel schrieb: I had the same idea, here's my implemention, running on an old Winhugs 2001 (and GHC 6.8). regards, Daniel import System import Directory chars = map chr [32..126] string 0 = return string n = do c - chars s - string (n-1) return (c:s) mkfun n = do s - string n return (f :: Integer - Bool; f = ++ s) test fundef = do system (del test.exe) writeFile test.hs (fundef ++ ; main = return ()) system (ghc --make test.hs) b - doesFileExist test.exe if b then putStrLn fundef else return () main = do let fundefs = [0..] = mkfun mapM_ test $ drop 1000 fundefs Lennart Augustsson schrieb: You can enumerate all possible implementations of functions of type (Integer - Bool). Just enumerate all strings, and give this to a Haskell compiler f :: Integer - Bool f = enumerated-string-goes-here if the compiler is happy you have an implementation. The enumerated functions do not include all mathematical functions of type (Integer - Bool), but it does include the ones we usually mean by the type (Integer - Bool) in Haskell. -- Lennart On Mon, Feb 2, 2009 at 4:47 PM, Martijn van Steenbergen mart...@van.steenbergen.nl wrote: Lennart Augustsson wrote: The Haskell function space, A-B, is not uncountable. There is only a countable number of Haskell functions you can write, so how could there be more elements in the Haskell function space? :) The explanation is that the Haskell function space is not the same as the functions space in set theory. Most importantly Haskell functions have to be monotonic (in the domain theoretic sense), so that limits the number of possible functions. I was thinking about a fixed function type A - B having uncountably many *values* (i.e. implementations). Not about the number of function types of the form A - B. Is that what you meant? For example, fix the type to Integer - Bool. I can't enumeratate all possible implementations of this function. Right? Martijn. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Logos of Other Languages
what about such a variation? something between an ouroborob, a lambda and a mermaid... By the way: I mixed up something: My note, that the orouboros was used as a logo for Heinz von Försters second order cybernetics, was not correct. The correct note should have been: Heinz von Förster, the later founder of the second order cybernetics, invented the ouroboros as a logo for the american society for cybernetics. http://www.asc-cybernetics.org/ daniel Paulo Tanimoto wrote: Another idea: something in the form of an Ouroboros. Is that already taken for a programming language? http://en.wikipedia.org/wiki/Ouroboros Something like this? http://www.haskell.org/sitewiki/images/f/fd/Ouroborous-oval.png Paul ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe inline: lambda-ouroboros.JPG___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Logos of Other Languages
The ouroboros was used as a logo of the second order cybernetics by Heinz von Förster. But I don't know of any programming language using this as logo. regards, daniel Paulo Tanimoto schrieb: Hello, On Fri, Dec 19, 2008 at 8:53 AM, Bayley, Alistair alistair.bay...@invesco.com wrote: That said, I also like the sloth. Alistair I quite like the sloth too, that would be a great mascot if you ask me. Distinctive, conveys the idea of laziness, warm fuzzy, etc. I hope somebody can come up with a design with it. Conrad's robot idea is also appealing to me, which is funny because we're so picky about side-effects. (There's a logo with a missile in the page too.) Remember that robot mascot that Firefox had a while ago? Another idea: something in the form of an Ouroboros. Is that already taken for a programming language? http://en.wikipedia.org/wiki/Ouroboros I should open up my GEB again. Paulo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Daniel van den Eijkel Tucholskystrasse 37 D-10117 Berlin Phone: ++49(0)30 3810 6028 Mobil: ++49(0)174 3877 266 Email: d...@gmx.net ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Haskell as a religion
as some german right-hegelian thinkers of the beginning of the 20th century noticed, the hegelian system is missing what we call 'action'. the whole system can be described as a timeless and closed set of invariant relations between parts of the world, which can also be seen as gods thinking. this critique is similar to the marxist turn of the hegelian philosophy. now, thinking of an timeless set of invariant relations, that should be extended by some concept of action, reminds me of haskell's monads. so I would say, haskell is not a revolutionary movement itself, its just a (or: THE) vehicle of the revolutionary progress that started 200 years ago (some might say, 2000 years ago). it's the place where the 'spirit of the world' comes to itself in these days... just kidding. daniel Jonathan Cast schrieb: On Tue, 2008-12-16 at 20:38 +, Andrew Coppin wrote: Don Stewart wrote: I think of Haskell more as a revolutionary movement LOL! Longest revolution EVER, eh? No. Das Kapital publication 1867. Russian Revolution 1917. FTW. jcc ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-caf ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe