Re: [Haskell-cafe] Unicode strings and runCommand / runProcess

2010-04-24 Thread Khudyakov Alexey
В сообщении от 24 апреля 2010 06:14:55 вы написали: Khudyakov Alexey wrote: Actually, the behavior of openFile when given a String with characters 0xFF is also completely undocumented. I am not sure what it does with that. It should probably be the same as runCommand, whatever

Re: [Haskell-cafe] Curl UTF8

2010-04-23 Thread Khudyakov Alexey
В сообщении от 23 апреля 2010 02:36:07 Rickard Karlsson написал: Hi, I'm trying to download a file in UTF-8 with libcurl(1.3.5) and GHC 6.12: import Network.Curl u = http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt; main = curlGetString u [] = putStrLn . snd Which doesn't

Re: [Haskell-cafe] Unicode strings and runCommand / runProcess

2010-04-23 Thread Khudyakov Alexey
В сообщении от 23 апреля 2010 21:44:29 John Goerzen написал: Here is a very interesting little problem. ghci GHCi, version 6.12.1: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base

Re: [Haskell-cafe] Unicode strings and runCommand / runProcess

2010-04-23 Thread Khudyakov Alexey
В сообщении от 24 апреля 2010 03:50:54 John Goerzen написал: Ivan Lazar Miljenovic wrote: John Goerzen jgoer...@complete.org writes: ghci GHCi, version 6.12.1: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking

[Haskell-cafe] mapM for vectors

2010-04-08 Thread Khudyakov Alexey
. V.toList Any suggestions about implementation of such function? Specifically I want to use Random monad. -- Khudyakov Alexey ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] ANN: fixed-list -- A fixed length list library

2010-03-21 Thread Khudyakov Alexey
В сообщении от 21 марта 2010 09:37:26 Casey McCann написал: Using head and tail on longer lists fails likewise. I expect there's some way to make it work without simply increasing the stack depth, but I'm not sure how. Any thoughts? It's possible to use binary encoding for natural numbers.

Re: [Haskell-cafe] fast, strongly typed heterogeneous collections

2010-02-19 Thread Khudyakov Alexey
В сообщении от 19 февраля 2010 15:20:30 Serguey Zefirov написал: And, actually, what looks like O(n) at the compile time is O(1) at runtime. This is so because it is really hard to create types at runtime. ;) What did you mean by really hard? One have to use black magic and ask demons for

[Haskell-cafe] Type level splices and instance deriving

2010-01-23 Thread Khudyakov Alexey
} |] -- Khudyakov Alexey ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Tokenizing and Parsec

2010-01-12 Thread Khudyakov Alexey
В сообщении от 12 января 2010 03:35:10 Günther Schmidt написал: Hi all, I've used Parsec to tokenize data from a text file. It was actually quite easy, everything is correctly identified. So now I have a list/stream of self defined Tokens and now I'm stuck. Because now I need to write my

Re: [Haskell-cafe] Distinct types in a list

2010-01-07 Thread Khudyakov Alexey
В сообщении от Четверг 07 января 2010 21:35:10 rodrigo.bonifacio написал: Hi all, I have a family of parsers that return either (Success t) or (Fail), using the following data type: data ParserResult a = Success a | Fail String deriving (Read, Show, Eq, Ord) isSuccess (Success _) =

Re: [Haskell-cafe] Data.Binary and error handling

2009-11-29 Thread Khudyakov Alexey
В сообщении от 27 ноября 2009 23:55:47 Don Stewart написал: alexey.skladnoy: It does but it was already noted that cereal uses strict bytestrings which are not really convenient when dealing with huge inputs. One may end up using both binary and cereal which is not really satisfactory.

Re: [Haskell-cafe] Data.Binary and error handling

2009-11-27 Thread Khudyakov Alexey
В сообщении от 27 ноября 2009 23:09:53 Don Stewart написал: alexey.skladnoy: Hello Is there any plans to add error handling for binary? When it comes to binary parsing most awkward part is error handling It is now available in the 'cereal' package. A strict binary with explicit,

Re: [Haskell-cafe] Data.Binary and error handling

2009-11-27 Thread Khudyakov Alexey
В сообщении от Пятница 27 ноября 2009 23:55:47 вы написали: It is quite hard to do a good job of lazy input, but explicit checked errors (turning it into an Either Error a makes the whole stream strict!). It does. To a degree. For example if one need to read 8 bytes to decide whether parsing

Re: [Haskell-cafe] Re: ANNOUNCE: htzaar-0.0.1

2009-10-09 Thread Khudyakov Alexey
В сообщении от 09 октября 2009 16:24:49 Jose A. Ortega Ruiz написал: Hi, When i try to cabal install htzaar i get the following error: src/Main.hs:11:7: Could not find module `Play': Use -v to see a list of the files searched for. cabal: Error: some packages failed to install:

Re: Fwd: [Haskell-cafe] Haskell for Physicists

2009-10-03 Thread Khudyakov Alexey
В сообщении от 30 сентября 2009 23:42:57 Casey Hawthorne написал: On Wed, 30 Sep 2009 21:24:11 +0200, you wrote: I?m a physicist, so I think they would be attracted by something like Haskell: high level physics modelling at Fortran speeds Haskell: mathematics beyond numerical calculus

Re: [Haskell-cafe] I read somewhere that for 90% of a wide classof computing problems, you only need 10% of the source code in Haskell, that you would in an imperative language.

2009-09-30 Thread Khudyakov Alexey
В сообщении от 30 сентября 2009 18:05:28 Peter Verswyvelen написал: On Wed, Sep 30, 2009 at 3:56 PM, Kalani Thielen kthie...@lab49.com wrote: That might be true, but the calculus and even arithmetic were once considered obscure. Mmm, to the average student calculus is still very obscure

Re: [Haskell-cafe] I read somewhere that for 90% of a wide class of computing problems, you only need 10% of the source code in Haskell, that you would in an imperative language.

2009-09-30 Thread Khudyakov Alexey
В сообщении от 30 сентября 2009 15:58:40 Jochem Berndsen написал: Deniz Dogan wrote: 2009/9/30 Andrew Coppin andrewcop...@btinternet.com: (Mr C++ argues that homo sapiens fundamentally think in an imperative way, and therefore functional programming in general will never be popular.

Re: [Haskell-cafe] Haskell for Physicists

2009-09-30 Thread Khudyakov Alexey
В сообщении от 30 сентября 2009 21:42:57 ed...@ymonad.com написал: Hi, I will give a seminar to physicists at USP (Universidade de São Paulo, Brazil) university and they asked me for a good title, something that can attract physicists. Anyone has some suggestions? (Will be a seminar about

Re: [Haskell-cafe] Haskell for Physicists

2009-09-30 Thread Khudyakov Alexey
В сообщении от Среда 30 сентября 2009 22:37:52 вы написали: Khudyakov Alexey wrote: В сообщении от 30 сентября 2009 21:42:57 ed...@ymonad.com написал: Hi, I will give a seminar to physicists at USP (Universidade de São Paulo, Brazil) university and they asked me for a good title

Re: [Haskell-cafe] Haskell for Physicists

2009-09-30 Thread Khudyakov Alexey
В сообщении от Среда 30 сентября 2009 23:08:02 вы написали: Yep, sure did. I just hit `reply' assuming haskell-cafe was in the reply-to. I do that more often than not it seems. Going back to the OP, what area of physics, and how on earth are you going to convert years of fortran users to

Re: [Haskell-cafe] Haskell for Physicists

2009-09-30 Thread Khudyakov Alexey
В сообщении от Среда 30 сентября 2009 23:29:32 Max Rabkin написал: On Wed, Sep 30, 2009 at 9:24 PM, Alberto G. Corona agocor...@gmail.com wrote: Haskell: mathematics beyond numerical calculus I'd imagine most physicists know a fair bit of mathematics beyond numerical calculus; what they

Re: [Haskell-cafe] Hurray! I hit my 1st true lazy IO problem

2009-09-27 Thread Khudyakov Alexey
В сообщении от 27 сентября 2009 18:59:57 Günther Schmidt написал: and now I'll really have to figure out Iteratee / Enumerator to solve it. Can I call myself a Haskeller now? If you wish so. But in fact you only need to overcome laziness. Not the first time in the life I suppose.

[Haskell-cafe] [uvector] derive UA instance for newtype

2009-09-23 Thread Khudyakov Alexey
memmoveOffMU = primMemmoveOffMU Am I moving in right direction and are there other/better solutions to problem? -- Khudyakov Alexey ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] [ANN] histogram-fill, library for creating hitograms

2009-09-20 Thread Khudyakov Alexey
. So data could be used with other tools. -- Khudyakov Alexey ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] [ANN] histogram-fill, library for creating hitograms

2009-09-20 Thread Khudyakov Alexey
В сообщении от Воскресенье 20 сентября 2009 22:03:42 вы написали: alexey.skladnoy: Hello. ... skipped ... Where can we get the code? :) http://hackage.haskell.org/package/histogram-fill-0.1.0 -- Don (who thinks it is interesting that hackage is now implied) It's so easy

[Haskell-cafe] Too much strictness in binary-0.5.0.2

2009-09-18 Thread Khudyakov Alexey
to old behavior. -- Khudyakov Alexey ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] ANNOUNCE: A Levenberg-Marquardt implementation

2009-09-14 Thread Khudyakov Alexey
В сообщении от Суббота 12 сентября 2009 18:46:28 автор Xiao-Yong Jin написал: I believe most of the linux distributions do not have `lapack.pc', if you install certain implementation of lapack like the one provided by netlib.org, or the one with `ATLAS', or the one provided by intel mkl. So,

Re: [Haskell-cafe] ANNOUNCE: A Levenberg-Marquardt implementation

2009-09-14 Thread Khudyakov Alexey
В сообщении от Понедельник 14 сентября 2009 12:41:29 вы написали: If pkgconfig-depends lines is removed from cabal file it builds fine. But any program which uses levmar fails to link ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] ANNOUNCE: A Levenberg-Marquardt implementation

2009-09-14 Thread Khudyakov Alexey
В сообщении от 14 сентября 2009 13:28:33 автор Roel van Dijk написал: Thank you for testing. I have just released bindings-levmar-0.1.0.1 on hackage. It simply replaces pkgconfig-depends with extra-libraries. I hope this solves the installation problems. Yes. Now it installs fine.

Re: [Haskell-cafe] Haskell#? F#?

2009-09-14 Thread Khudyakov Alexey
В сообщении от Вторник 15 сентября 2009 00:15:10 автор Don Stewart написал: State /= Imperative Programming Yup, it's anarchy at times... ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] ANNOUNCE: A Levenberg-Marquardt implementation

2009-09-12 Thread Khudyakov Alexey
В сообщении от Четверг 10 сентября 2009 17:21:40 автор Bas van Dijk написал: We like to announce the release of a Haskell binding to Manolis Lourakis's C levmar library bindings-levmar fails to configure on debian testing with following message: $ cabal install bindings-levmar Resolving

Re: [Haskell-cafe] What's the status with unicode characters on haddock ?

2009-07-10 Thread Khudyakov Alexey
On Пятница 10 июля 2009 12:55:46 Magnus Therning wrote: Not that I have any hope of being able to answer your question, but I think it might be useful if you informed us where the characters are mangled. Is it when you view it in a browser, or when you open the Haddock-generated HTML files in

Re: [Haskell-cafe] Haskell and symbolic references

2009-05-29 Thread Khudyakov Alexey
] http://haskell.org/haskellwiki/Template_Haskell -- Khudyakov Alexey ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Data.Binary and little endian encoding

2009-05-28 Thread Khudyakov Alexey
for that link. I didn't find it earlier. But actually I asked what are you trying to write? -- Khudyakov Alexey ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Parsing command lines

2009-05-25 Thread Khudyakov Alexey
there is System.Console.GetOpt. All the splitting, escaping and quotes interpretaion is done by shell. All what get program when starts is list of strings. Program name is actually arbitrary string. (At least on unices, it may work a bit differently on windows). -- Khudyakov Alexey

Re: [Haskell-cafe] Data.Binary suboptimal instance

2009-05-24 Thread Khudyakov Alexey
On Saturday 23 May 2009 23:23:05 Henning Thielemann wrote: Interesting solution however it does not perform very nice. I wrote microbenchmark ... skipped ... I didn'd do any profiling so I have no idea why writing is so slow. If you use top-level definition 'xs' the program might

Re: Fwd: [Haskell-cafe] Data.Binary suboptimal instance

2009-05-23 Thread Khudyakov Alexey
didn'd do any profiling so I have no idea why writing is so slow. -- Best regard Khudyakov Alexey ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Data.Binary suboptimal instance

2009-05-23 Thread Khudyakov Alexey
tricks ghc used. I think code with list is more clear. Another problem that you can't use existing Binary instances with Builder. -- Best regards Khudyakov Alexey ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman

Re: [Haskell-cafe] Data.Binary suboptimal instance

2009-05-22 Thread Khudyakov Alexey
[] else do x - getter xs - getStream getter return (x:xs) -- | Write list of values. putStream :: (a - Put) - [a] - Put putStream f = mapM_ f -- Khudyakov Alexey ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Data.Binary and little endian encoding

2009-05-16 Thread Khudyakov Alexey
On Friday 15 May 2009 06:52:29 David Leimbach wrote: I actually need little endian encoding... wondering if anyone else hit this with Data.Binary. (because I'm working with Bell Lab's 9P protocol which does encode things on the network in little-endian order). Anyone got some tricks for this?

Re: [Haskell-cafe] Data.Binary, Data.Text and errors

2009-03-16 Thread Khudyakov Alexey
On Monday 16 March 2009 06:40:12 Alexander Dunlap wrote: Hi all, I have noticed that in both Data.Binary and Data.Text (which is still experimental, but still), the decode functions can be undefined (i.e. bottom) if they encounter malformed input. What is the preferred way to use these

Re: [Haskell-cafe] How to make a dock window for xmonad using gtk2hs?

2009-03-05 Thread Khudyakov Alexey
On Thursday 05 March 2009 09:45:51 Magicloud Magiclouds wrote: I am confused. Code like this works in other WM, except xmonad. You code does not set _NET_WM_STRUT property. And because of that xmonad doesn't treat it specifically. You can inspect you window properties using `xprop' utility.

Fwd: Re: [Haskell-cafe] speed: ghc vs gcc

2009-02-21 Thread Khudyakov Alexey
Oh I've again sent mail to wrong address -- Forwarded Message -- On Saturday 21 February 2009 02:42:11 you wrote: On Sat, Feb 21, 2009 at 12:22 AM, Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello Khudyakov, Saturday, February 21, 2009, 2:07:39 AM, you wrote:

Re: [Haskell-cafe] speed: ghc vs gcc

2009-02-20 Thread Khudyakov Alexey
On Friday 20 February 2009 16:29:29 Bulat Ziganshin wrote: Hello haskell-cafe, since there are no objective tests comparing ghc to gcc, i made my own one. these are 3 programs, calculating sum in c++ and haskell: main = print $ sum[1..10^9::Int] ... skipped ... The discussion is mostly

[Haskell-cafe] Uses of `fix' combinator

2009-02-19 Thread Khudyakov Alexey
to imagine any. Naive approach lead to nothing (no surprise): Prelude Data.Function fix (^^2) interactive: out of memory (requested 2097152 bytes) Second question what does word `least' mean?`a' isn't an Ord instance. -- Khudyakov Alexey

Re: [Haskell-cafe] Uses of `fix' combinator

2009-02-19 Thread Khudyakov Alexey
Thankyou everyone. This was most helpful. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Haddock Markup

2009-02-07 Thread Khudyakov Alexey
sign. P.S. Maybe I just to used to TeX. -- Khudyakov Alexey ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Haddock Markup

2009-02-07 Thread Khudyakov Alexey
is required (MathPlayer). I believe image are safest way at least for now. -- Khudyakov Alexey ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Ready for testing: Unicode support for Handle I/O

2009-02-07 Thread Khudyakov Alexey
. For example let consider file with name {0xff} on computer with UTF8 locale. It's valid and everything, but its name cannot be converted to string. 0xff byte cannot appear in UTF8 strings. -- Khudyakov Alexey ___ Haskell-Cafe mailing list Haskell