[Haskell-cafe] Tools to make tidy HTML

2010-05-21 Thread Dmitri O.Kondratiev
Hello! Please advise haskell libraries similar to convert real-world HTML to well-formed XML. I need something similat to HTML Tidy library: http://tidy.sourceforge.net/ Thanks! Dmitri ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Newbie Q: Deriving MyOrd from Eq problem

2006-07-25 Thread Dmitri O.Kondratiev
I am trying to derive MyOrd class from Eq (Prelude): class Eq a = MyOrd a where (%=), (%), (%=) :: a - a - Bool x %= y = (x y || x == y) x % y = y x x %= y = (y x || x == y) I get these errors: ClassTest.hs:28:21: Could not deduce (Ord a) from the context

Re: [Haskell-cafe] Newbie Q: Deriving MyOrd from Eq problem

2006-07-26 Thread Dmitri O.Kondratiev
On 7/25/06, Jared Updike [EMAIL PROTECTED] wrote: I am trying to derive MyOrd class from Eq (Prelude): class Eq a = MyOrd a where (%=), (%), (%=) :: a - a - Bool x %= y = (x y || x == y) x % y = y x x %= y = (y x || x == y) Q: What's wrong? Why 'Ord'

[Haskell-cafe] Newbie Q: composeMaybe :: (a - Maybe b) - (b - Maybe c) - (a - Maybe c)

2006-11-08 Thread Dmitri O.Kondratiev
I am trying to solve a problem from The Craft of Functional Programming book: 14.38 ... define the function: data Maybe a = Nothing | Just a composeMaybe :: (a - Maybe b) - (b - Maybe c) - (a - Maybe c) using functions: squashMaybe :: Maybe (Maybe a) - Maybe a squashMaybe (Just (Just x)) =

Re: [Haskell-cafe] Newbie Q: composeMaybe :: (a - Maybe b) - (b - Maybe c) - (a - Maybe c)

2006-11-09 Thread Dmitri O.Kondratiev
type f1 :: (c - Maybe d) - (t - Maybe c) - t - Maybe (Maybe d) substituting different type variable names gives f1 :: (b - Maybe c) - (a - Maybe b) - a - Maybe (Maybe c) So you are very close to finishing... :) Hope this helps. DeeJay Dmitri O.Kondratiev wrote: I am trying to solve a problem

[Haskell-cafe] Newbie Q: GHCi: Where “Lis t” module is imported from?

2007-02-16 Thread Dmitri O.Kondratiev
Going through Haskell. The Craft of Functional Programming book , in section 16.8 I found a Set module example. Module declarations starts with: import List hiding (union) Set module here is built with list and uses among other things list comparison functions such as (==) and (=). For

Re: [Haskell-cafe] Newbie Q: GHCi: W here “List” module is imported from?

2007-02-16 Thread Dmitri O.Kondratiev
On 2/16/07, Jules Bean [EMAIL PROTECTED] wrote: Actually, lists are partly defined in the Prelude, with auxiliary functions in Data.List. In particular, = for List is defined in the Prelude. Or rather, I should say, the Ord instance for lists is defined in the prelude (and only if the type

Re: [Haskell-cafe] Newbie: State monad example questions

2008-05-21 Thread Dmitri O.Kondratiev
] wrote: 2008/5/19 Dmitri O.Kondratiev [EMAIL PROTECTED]: I am trying to understand State monad example15 at: http://www.haskell.org/all_about_monads/html/statemonad.html Hi Dmitri, I'm not sure you need to understand everything about Monad and do-notation to use the State Monad. So I

Re: [Haskell-cafe] Newbie: State monad example questions

2008-05-21 Thread Dmitri O.Kondratiev
: On Wed, May 21, 2008 at 8:42 AM, Dmitri O.Kondratiev [EMAIL PROTECTED] wrote: So let's start with fundamental and most intriguing (to me) things: getAny :: (Random a) = State StdGen a getAny = do g - get -- magically get the current StdGen First line above declares a data type: State

Re: [Haskell-cafe] Newbie: State monad example questions

2008-05-21 Thread Dmitri O.Kondratiev
Jules, Stupid question, please bear with me: x :: Int -- x declared, but not constructed x = 1 -- x constructed s1 :: State StdGen a -- s1 declared, yes, but why s1 is *also already constructed* ? On Wed, May 21, 2008 at 6:54 PM, Jules Bean [EMAIL PROTECTED] wrote: Dmitri O.Kondratiev wrote

Re: [Haskell-cafe] Newbie: State monad example questions

2008-05-21 Thread Dmitri O.Kondratiev
a random value. --} On Wed, May 21, 2008 at 10:31 PM, Olivier Boudry [EMAIL PROTECTED] wrote: On Wed, May 21, 2008 at 11:10 AM, Dmitri O.Kondratiev [EMAIL PROTECTED] wrote: But how will 'g1' actually get delivered from 'makeRandomValueST g1' to invocation of 'getAny' I don't yet understand

[Haskell-cafe] Newbie Q: Overloading and type classes

2008-06-07 Thread Dmitri O.Kondratiev
{-- I try to define class Store that will group types implmenting different storage mechanisms . All types should support two functions: 1) put (key, value) pair into storage 2) get value from storage corresponding to the given key As an example I start with the following storage types: --} --

Re: [Haskell-cafe] Newbie Q: Overloading and type classes

2008-06-07 Thread Dmitri O.Kondratiev
{-- Thanks! Yes, you got it right - I want to make explicit the fact that the type s depends on k and v. So I followed your advice and used the most simple way to do what I need: --} class Store s where put :: Eq k = (k, v) - s k v - s k v get :: Eq k = k - s k v - Maybe v instance Store

[Haskell-cafe] Newbie: Appending arrays?

2008-07-10 Thread Dmitri O.Kondratiev
What is the best way to extend array? I would use a list instead of array as it is easy to append, but need to have random access to its elements later. So in fact I need to start with an integer array of size 1. Next I may need to add new elements to this array or modify values of the existing

Re: [Haskell-cafe] Newbie: Appending arrays?

2008-07-11 Thread Dmitri O.Kondratiev
. This is usually fairly efficient for most applications. By the way, depending on the type of the data you're putting into these arrays, Data.ByteString might be a good choice as well. On Thu, Jul 10, 2008 at 12:12 PM, Felipe Lessa [EMAIL PROTECTED] wrote: 2008/7/10 Dmitri O.Kondratiev [EMAIL

Re: [Haskell-cafe] Newbie: Appending arrays?

2008-07-11 Thread Dmitri O.Kondratiev
How does Data.Sequence http://www.haskell.org/ghc/docs/latest/html/libraries/containers/Data-Sequence.html compares with ArrayRef for appending and accessing arrays efficiently ? On Fri, Jul 11, 2008 at 4:58 PM, Chaddaï Fouché [EMAIL PROTECTED] wrote: 2008/7/11 Dmitri O.Kondratiev [EMAIL

Re: [Haskell-cafe] Newbie: Appending arrays?

2008-07-11 Thread Dmitri O.Kondratiev
later. That's why I need a collection both indexed and able to extend also. I think that Data.Sequence will do for the task, don't you think? On Fri, Jul 11, 2008 at 7:23 PM, Chaddaï Fouché [EMAIL PROTECTED] wrote: 2008/7/11 Dmitri O.Kondratiev [EMAIL PROTECTED]: How does Data.Sequence http

Re: [Haskell-cafe] Newbie: Appending arrays?

2008-07-11 Thread Dmitri O.Kondratiev
Thanks for your help, guys! I like simple solutions most of all :) On Fri, Jul 11, 2008 at 9:44 PM, Reid Barton [EMAIL PROTECTED] wrote: This doesn't require any fancy data structures. Instead store this as a list of pairs [([10,6,80,25,6,7], 5), ...] and it'll be easy to write a

[Haskell-cafe] win32: haddock: internal Haddock or GHC error?

2008-07-16 Thread Dmitri O.Kondratiev
Using GHC 6.8.2 and haddock 2.0.0.0. in WinXP (SP3) I am trying to follow instructions from How to write a Haskell programhttp://www.haskell.org/haskellwiki/How_to_write_a_Haskell_program#Build_some_haddock_documentation . Everything goes well, until I try to generate html documentation for the

Re: [Haskell-cafe] win32: haddock: internal Haddock or GHC error?

2008-07-16 Thread Dmitri O.Kondratiev
Neil, Thanks for the quick response! I got haddock from its site ( http://haskell.org/haddock/#Download )using the link that says: Windows: a binary distribution http://haskell.org/haddock/dist/haddock-2.0.0.0-Win32.zip is available, just unzip and go. My configuration: C:\wks\haqrunhaskell

[Haskell-cafe] Haskell on Pocket PC?

2006-03-31 Thread Dmitri O.Kondratiev
Any ideas on how much work needs to be done for using Haskell on PPC Windows Mobile platform? It would be interesting to use PPC as: 1) Haskell learning tool, so small code snipets could be entered and run directly on hand-held (REPL). How hard is it to port Hugs to PPC for this? Do any other

[Haskell-cafe] Re: Haskell on Pocket PC?

2006-03-31 Thread Dmitri O.Kondratiev
I am sorry for confusion that abreviation PPC may cause in the text of my message. In this context I used 'PPC' to refer to Pocket PC and nothing else. Sorry again. On 3/31/06, Dmitri O.Kondratiev [EMAIL PROTECTED] wrote: Any ideas on how much work needs to be done for using Haskell on PPC

Re: [Haskell-cafe] Haskell on Pocket PC?

2006-04-03 Thread Dmitri O.Kondratiev
Hi Neil, Thanks for your reply. Starting from YHC porting pages the only source for Win32 port I found is WinHaskell. [http://www-users.cs.york.ac.uk/~ndm/projects/winhaskell.php] I have not yet found which port it is: Hugs, YHc, ...? Also there is a thing called WinHugs at

[Haskell-cafe] Newbie: Replacing substring?

2008-07-22 Thread Dmitri O.Kondratiev
A few simple questions: What standard library function can be used to replace substring in a string (or sub-list in a list) ? I wrote my own version, please criticize: -- replace all occurances of 123 with 58 in a string: test = replStr abc123def123gh123ikl 123 58 {-- In a string replace all

Re: [Haskell-cafe] Newbie: Replacing substring?

2008-07-22 Thread Dmitri O.Kondratiev
PROTECTED] wrote: Dmitri O.Kondratiev wrote: I wrote my own version, please criticize: -- replace all occurances of 123 with 58 in a string: test = replStr abc123def123gh123ikl 123 58 This is a tricky problem: first of all, you fail your own test! ;-) *Main test abc58def58gh58ikl58

Re: [Haskell-cafe] Newbie: Replacing substring?

2008-07-23 Thread Dmitri O.Kondratiev
? then new ++ loop rest -- yes: replace it else head str : loop (tail str) -- no: keep looking n = length old On Tue, Jul 22, 2008 at 8:21 PM, Dmitri O.Kondratiev [EMAIL PROTECTED] wrote: Roberto thanks! Shame on me, to post code without enough testing :( Yet

[Haskell-cafe] How to use Unicode strings?

2008-11-22 Thread Dmitri O.Kondratiev
Please advise how to write Unicode string, so this example would work: main = do putStrLn Les signes orthographiques inclus les accents (aigus, grâve, circonflexe), le tréma, l'apostrophe, la cédille, le trait d'union et la majuscule. I get the following error: hello.hs:4:68: lexical error

[Haskell-cafe] SOEGraphics in GHC?

2008-11-24 Thread Dmitri O.Kondratiev
Please help, to locate in GHC distribution SOEGraphics library from Paul Hudak, book The Haskell School of Expression (http://www.haskell.org/soe/ ) Thanks! ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] How to define Show [MyType] ?

2008-12-04 Thread Dmitri O.Kondratiev
I am trying to define instance Show[MyType] so show (x:xs :: MyType) would return a single string where substrings corresponding to list elements will be separated by \n. This would allow pretty printing of MyType list in several lines instead of one, as default Show does for lists. For example:

Re: [Haskell-cafe] How to define Show [MyType] ?

2008-12-05 Thread Dmitri O.Kondratiev
On Fri, Dec 5, 2008 at 1:29 AM, Martijn van Steenbergen [EMAIL PROTECTED] wrote: Dmitri O.Kondratiev wrote: -- How to define Show [MyType] ? Define instance Show MyType and implement not only show (for 1 value of MyType) but also showList, which Show provides as well. You can do all

Re: [Haskell-cafe] How to define Show [MyType] ?

2008-12-06 Thread Dmitri O.Kondratiev
characters \ come from in this case? 2)How showList function 'removes' characters \ from the output? What magic goes behind the scenes here? --} Thanks! Dmitri On 12/6/08, Daniel Fischer [EMAIL PROTECTED] wrote: Am Samstag, 6. Dezember 2008 00:13 schrieb Dmitri O.Kondratiev: Thanks everybody for your

[Haskell-cafe] Newbie: Is‘type’ synonym h iding two much?

2007-03-22 Thread Dmitri O.Kondratiev
I am learning Haskell working through Simon Thompson book Haskell The Craft of Functional Programming (second edition). Solving problems in the book with more or less success I arrived almost to the end of the book at the section 17.5 Case study: parsing expressions. Most probably the question I

Re: [Haskell-cafe] Newbie: Is 'type' synonym hiding two much?

2007-03-22 Thread Dmitri O.Kondratiev
Now, in the 17.5 section of a book one may see the following declarations: succeed :: b - Parse a b *Before looking at 'succeed' function definition* one may think that 'succeed' is a function of *one* argument of type 'b' that returns object of type 'Parse a b'. Antti-Juhani Kaijanaho

[Haskell-cafe] Newbie: a parser for a list of objects?

2007-03-26 Thread Dmitri O.Kondratiev
Please see my questions inside comments {-- --} : Thanks! --- module Parser where import Data.Char type Parse a b = [a] - [(b, [a])] {-- Newbie: a parser for a list of objects? I am working with the section 17.5 Case study: parsing expressions of the book Haskell The Craft of Functional

Re: [Haskell-cafe] Newbie: a parser for a list of objects?

2007-03-27 Thread Dmitri O.Kondratiev
Fischer [EMAIL PROTECTED] wrote: -Ursprüngliche Nachricht- Von: Dmitri O.Kondratiev [EMAIL PROTECTED] Gesendet: 26.03.07 16:44:12 An: haskell-cafe@haskell.org Betreff: [Haskell-cafe] Newbie: a parser for a list of objects? Please see my questions inside comments {-- --} : Thanks

Re: [Haskell-cafe] Newbie: a parser for a list of objects?

2007-03-28 Thread Dmitri O.Kondratiev
Dmitri O.Kondratiev: Thanks Daniel! Things are getting more in shape, yet I still can not fully comprehend the expression: ((p * pList p) `build` (uncurry (:))) where (*) :: Parse a b - Parse a c - Parse a (b, c) (*) p1 p2 inp = [((x,y), rem2) |(x, rem1) - p1 inp, (y, rem2) - p2 rem1

Re: [Haskell-cafe] Newbie: a parser for a list of objects?

2007-03-29 Thread Dmitri O.Kondratiev
, 3), (123, )] Thanks again Daniel for your great help! Dima On 3/28/07, Daniel Fischer [EMAIL PROTECTED] wrote: Am Mittwoch, 28. März 2007 11:57 schrieb Dmitri O.Kondratiev: Daniel, I am still trying to figure out the order of function applications in the parser returning list of objects (I

[Haskell-cafe] Newbie Q: Monad 'fail' and 'error'

2007-06-06 Thread Dmitri O.Kondratiev
Monad class contains declaration *fail* :: String - m a and provides default implementation for 'fail' as: fail s = error s On the other hand Prelude defines: * error* :: String - a which stops execution and displays an error message. Questions: 1) What value and type 'error' actually

Re: [Haskell-cafe] Newbie Q: Monad 'fail' and 'error'

2007-06-06 Thread Dmitri O.Kondratiev
? On 6/6/07, Tillmann Rendel [EMAIL PROTECTED] wrote: Dmitri O.Kondratiev wrote: Monad class contains declaration *fail* :: String - m a and provides default implementation for 'fail' as: fail s = error s On the other hand Prelude defines: * error* :: String - a which stops execution

[Haskell-cafe] GHC 6.6.1: Where is Graphics.SOE ?

2007-07-17 Thread Dmitri O.Kondratiev
I am trying to use Graphics.SOE (that was present at least in GHC 6.4) to go through Simple Graphics examples as described in Pail Hudak book The Haskell School of Expression. Learning functional programming through multimedia. It looks like Graphics.SOE does not anymore exist in GHC 6.6.1.

[Haskell-cafe] GHC 6.6.1: Where is Graphics.SOE ?

2007-07-18 Thread Dmitri O.Kondratiev
*Andrea Rossato* wrote: haskell-cafe%40haskell.org?Subject=%5BHaskell-cafe%5D%20GHC%206.6.1%3A%20Where%20is%20Graphics.SOE%20%3FIn-Reply-To=53396d9e0707170752q6769729es68d214639b69a789%40mail.gmail.com Hi! as far as I know what you are looking for (Graphics.SOE) is part of HGL. Have a look

Re: [Haskell-cafe] GHC 6.6.1: Where is Graphics.SOE ?

2007-07-18 Thread Dmitri O.Kondratiev
On 7/17/07, Malte Milatz [EMAIL PROTECTED] wrote: Dmitri O.Kondratiev: It looks like Graphics.SOE does not anymore exist in GHC 6.6.1. Where one can get it or what to use instead of it? You may try Gtk2Hs, which includes an implementation of SOE, called Graphics.SOE.Gtk. (It works

[Haskell-cafe] GHC 6.6.1: Where is Graphics.SOE ?

2007-07-20 Thread Dmitri O.Kondratiev
Olivier Boudry [EMAIL PROTECTED] wrote: (Wed Jul 18 11:56:56 EDT 2007) Hi Dmitri, I built gtk2hs on Windows with GHC 6.6.1 and gtk2hs-0.9.11. Here's are the steps that worked for me: (not sure I didn't missed some) First you need to install a GTK+ development package for windows. I think mine

Re: [Haskell-cafe] GHC 6.6.1: Where is Graphics.SOE ?

2007-07-25 Thread Dmitri O.Kondratiev
! Dima On 7/23/07, Duncan Coutts [EMAIL PROTECTED] wrote: On Fri, 2007-07-20 at 13:47 +0400, Dmitri O.Kondratiev wrote: Oliver, thanks! I tried that, yet have some problems. Questions: 1) Should I ignore autoreconf errors? I've never managed to get autoconf working on windows. I always

[Haskell-cafe] Haskell on-line judge for Programming Challenges / Contests ?

2011-04-14 Thread Dmitri O.Kondratiev
Hello, I am looking for a site providing on-line automatic judge for Programming Challenges that can be coded in Haskell. For example this site: http://www.programming-challenges.com provides lots of interesting programming provlems: http://www.programming-challenges.com/pg.php?page=index Yet,

[Haskell-cafe] Programming Chalenges: The 3n+1 problem

2011-04-14 Thread Dmitri O.Kondratiev
3n+1 is the first, warm-up problem at Programming Chalenges site: http://www.programming-challenges.com/pg.php?page=downloadproblemprobid=110101format=html (This problem illustrates Collatz conjecture: http://en.wikipedia.org/wiki/3n_%2B_1#Program_to_calculate_Collatz_sequences ) As long as the

[Haskell-cafe] Haskell on-line judge for Programming Challenges / Contests ?

2011-04-14 Thread Dmitri O.Kondratiev
Angel de Vicente wrote: On 14/04/11 10:29, Dmitri O.Kondratiev wrote: * I am looking for a site providing on-line automatic judge for ** Programming Challenges that can be coded in Haskell. ** For example this site: ** http://www.programming-challenges.com ** provides lots of interesting

Re: [Haskell-cafe] Programming Chalenges: The 3n+1 problem

2011-04-14 Thread Dmitri O.Kondratiev
Thanks, Felipe! Sure I will try to code solution myself. Doing it all by yourself is the main fun of everything, isn't it? I was just asking about the *idea* of implementing cache in Haskell, in general, not just in this case only. On Thu, Apr 14, 2011 at 3:11 PM, Felipe Almeida Lessa

Re: [Haskell-cafe] Programming Chalenges: The 3n+1 problem

2011-04-14 Thread Dmitri O.Kondratiev
Thanks, everybody! Your feedback is a great food for my mind (as Lewis Carroll once wrote :) When asking how to implement cache in Haskell I was hopping that there exists some solution without using Data.Array, more functional approach, if I may say so ... I must be wrong, though (need more time

[Haskell-cafe] Please help with double recursion

2011-05-28 Thread Dmitri O.Kondratiev
Hello, I am trying to solve a simple task, but got stuck with double recursion - for some reason not all list elements get processed. Please advice on a simple solution, using plane old recursion :) *** Task: From a sequence of chars build all possible chains where each chain consists of chars

[Haskell-cafe] Fwd: Please help with double recursion

2011-05-28 Thread Dmitri O.Kondratiev
For some reason, my previous message got truncated, so I repeat it in hope that it will come complete this time: -- Forwarded message -- From: Dmitri O.Kondratiev doko...@gmail.com Date: Sat, May 28, 2011 at 3:47 PM Subject: Please help with double recursion To: haskell-cafe

Re: [Haskell-cafe] Please help with double recursion

2011-05-28 Thread Dmitri O.Kondratiev
On Sat, May 28, 2011 at 3:57 PM, Daniel Fischer daniel.is.fisc...@googlemail.com wrote: On Saturday 28 May 2011 13:47:10, Dmitri O.Kondratiev wrote: Hello, I am trying to solve a simple task, but got stuck with double recursion - for some reason not all list elements get processed

Re: [Haskell-cafe] Please help with double recursion

2011-05-30 Thread Dmitri O.Kondratiev
On Mon, May 30, 2011 at 11:26 AM, Richard O'Keefe o...@cs.otago.ac.nz wrote: On 28/05/2011, at 11:47 PM, Dmitri O.Kondratiev wrote: Hello, I am trying to solve a simple task, but got stuck with double recursion - for some reason not all list elements get processed. Please advice

[Haskell-cafe] Detecting overlay-ed signal patterns

2011-05-30 Thread Dmitri O.Kondratiev
Hello, I am trying to detect signal patterns in a system with numerous signals overlaying each other in time. I am aware that there is a whole class of problem solving methods for this task, yet trying my own algorithm, that may be wrong of course :) Next I use a simple example to describe the

[Haskell-cafe] Matplotlib analog for Haskell?

2011-06-03 Thread Dmitri O.Kondratiev
Hello, Please advise on Haskell 2D plotting libraries to generate plots, histograms, power spectra, bar charts, errorcharts, scatterplots, etc, similar to what Matplotlib does: http://matplotlib.sourceforge.net/ Thanks! Dmitri ___ Haskell-Cafe mailing

Re: [Haskell-cafe] Matplotlib analog for Haskell?

2011-06-03 Thread Dmitri O.Kondratiev
On Fri, Jun 3, 2011 at 3:44 PM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: On 3 June 2011 21:39, Dmitri O.Kondratiev doko...@gmail.com wrote: Hello, Please advise on Haskell 2D plotting libraries to generate plots, histograms, power spectra, bar charts, errorcharts

Re: [Haskell-cafe] Matplotlib analog for Haskell?

2011-06-03 Thread Dmitri O.Kondratiev
On Sat, Jun 4, 2011 at 12:55 AM, Henning Thielemann schlepp...@henning-thielemann.de wrote: Malcolm Wallace schrieb: I tried gnuplot: Demo.hs:25:18: Could not find module `Paths_gnuplot': Use -v to see a list of the files searched for. Failed, modules loaded: none.

[Haskell-cafe] Data.List / Map: simple serialization?

2011-06-09 Thread Dmitri O.Kondratiev
Hello, Please advise on existing serialization libraries. I need a simple way to serialize Data.List and Data.Map to plain text files. Thanks, Dmitri ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Data.List / Map: simple serialization?

2011-06-09 Thread Dmitri O.Kondratiev
from it another list, save it to text file, etc. I wonder how Haskell will distribute memory between the buffer for sequential element access (list elements, map tree nodes) and memory for computation while reading in list, Data.Map from file? On 9 June 2011 08:23, Dmitri O.Kondratiev doko

Re: [Haskell-cafe] Data.List / Map: simple serialization?

2011-06-09 Thread Dmitri O.Kondratiev
On Thu, Jun 9, 2011 at 7:23 PM, Max Bolingbroke batterseapo...@hotmail.comwrote: Hi Dmitri, On 9 June 2011 09:13, Dmitri O.Kondratiev doko...@gmail.com wrote: I wonder how Haskell will distribute memory between the buffer for sequential element access (list elements, map tree nodes

Re: [Haskell-cafe] Data.List / Map: simple serialization?

2011-06-10 Thread Dmitri O.Kondratiev
On Thu, Jun 9, 2011 at 11:31 AM, Max Bolingbroke batterseapo...@hotmail.com wrote: If you want plain text serialization, writeFile output.txt . show and fmap read (readFile output.txt) should suffice... Max This code works: main = do let xss = [[1,2,3],[4,5,6],[7,8],[9]]

Re: [Haskell-cafe] Data.List / Map: simple serialization?

2011-06-10 Thread Dmitri O.Kondratiev
On Fri, Jun 10, 2011 at 4:13 PM, Daniel Fischer daniel.is.fisc...@googlemail.com wrote: On Friday 10 June 2011, 13:49:23, Dmitri O.Kondratiev wrote: On Thu, Jun 9, 2011 at 11:31 AM, Max Bolingbroke batterseapo...@hotmail.com wrote: If you want plain text serialization, writeFile

Re: [Haskell-cafe] Data.List / Map: simple serialization?

2011-06-10 Thread Dmitri O.Kondratiev
Thanks for the excellent explanation! : On Fri, Jun 10, 2011 at 4:49 PM, Daniel Fischer daniel.is.fisc...@googlemail.com wrote: On Friday 10 June 2011, 14:25:59, Dmitri O.Kondratiev wrote: Two questions: 1) Why to use 'fmap' at all if a complete file is read in a single line of text

[Haskell-cafe] Installing Gtk2Hs on Win32

2011-06-10 Thread Dmitri O.Kondratiev
Please help to find pre-compiled binary libraries of Gtk+ for Win32. Gtk2Hs insatll instructions at: http://code.haskell.org/gtk2hs/INSTALL tells us: [quote] Building on Windows Installation on Windows is nearly as easy as on Unix platforms. However, you need to download

[Haskell-cafe] Errors installing 'Haskell Charts'

2011-06-10 Thread Dmitri O.Kondratiev
I am trying to install HaskellCharts at: http://dockerz.net/twd/HaskellCharts Running: cabal update cabal install gtk2hs-buildtools cabal install gtk cabal install chart goes well untill 'cabal install chart' which results in: C:\wks\RCAcabal install chart Resolving

Re: [Haskell-cafe] Errors installing 'Haskell Charts'

2011-06-10 Thread Dmitri O.Kondratiev
Trying to install the same stuff on Mac OS X 10.6.7 I get problems both with gtk2hs-buildtools and pkg-config, (see below). Any ideas where to get pre-built glib and pkg-config both for Win32 and Mac OS X? == Problems on Mac OS X with gtk2hs-buildtools : cabal install gtk Resolving

Re: [Haskell-cafe] Matplotlib analog for Haskell?

2011-06-10 Thread Dmitri O.Kondratiev
On Sat, Jun 4, 2011 at 1:56 AM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: On 4 June 2011 07:11, Dmitri O.Kondratiev doko...@gmail.com wrote: So, if I got this right, I should run: 'cabal install -fbuildExamples gnuplot' from gnuplot source root folder? You can either get

Re: [Haskell-cafe] Matplotlib analog for Haskell?

2011-06-10 Thread Dmitri O.Kondratiev
On Sat, Jun 11, 2011 at 12:54 AM, Henning Thielemann lemm...@henning-thielemann.de wrote: On Sat, 11 Jun 2011, Dmitri O.Kondratiev wrote: That's what I get (see below). What else should I do to install gnuplot? ~/wks/haskell-wks/gnuplot/gnuplot-0.4.2/srcghc -v Demo.hs Do you really

[Haskell-cafe] Generating simple histograms in png format?

2011-06-10 Thread Dmitri O.Kondratiev
I am looking for platform-independent library to generate simple histograms in png format. Does such thing exist? Thanks! ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] GHC 7.0.3 / Win32: Data.Time library?

2011-06-14 Thread Dmitri O.Kondratiev
It looks like GHC, 7.0.3 Haskell Hierarchical Libraries documentation generated for Win32, that goes with Haskell Platform installation package, does not have a section on Data.Time module. How can that be? I need to convert a string of the form ,10/11/2009 7:04:28 PM to Haskell type that can be

Re: [Haskell-cafe] GHC 7.0.3 / Win32: Data.Time library?

2011-06-14 Thread Dmitri O.Kondratiev
Sorry for typo - I need subtract dates (no 'abstracting') : On Tue, Jun 14, 2011 at 3:49 PM, Dmitri O.Kondratiev doko...@gmail.comwrote: It looks like GHC, 7.0.3 Haskell Hierarchical Libraries documentation generated for Win32, that goes with Haskell Platform installation package, does

Re: [Haskell-cafe] GHC 7.0.3 / Win32: Data.Time library?

2011-06-14 Thread Dmitri O.Kondratiev
at http://hackage.haskell.org/packages/archive/time/1.2.0.5/doc/html/Data-Time-Format.html ? Is it enough? 2011/6/14 Dmitri O.Kondratiev doko...@gmail.com Sorry for typo - I need subtract dates (no 'abstracting') : On Tue, Jun 14, 2011 at 3:49 PM, Dmitri O.Kondratiev doko...@gmail.comwrote

Re: [Haskell-cafe] GHC 7.0.3 / Win32: Data.Time library?

2011-06-14 Thread Dmitri O.Kondratiev
It would also help to see a simple example of parsing 10/11/2009 7:04:28 PM to time and date objects. On Tue, Jun 14, 2011 at 4:41 PM, Dmitri O.Kondratiev doko...@gmail.comwrote: Yes, thanks. I just wonder why documentation for this particular module (Data.Time) is missing from GHC, 7.0.3

[Haskell-cafe] Please help : Data.Time.Format parseTime

2011-06-14 Thread Dmitri O.Kondratiev
I am trying to convert data string to time: import Data.Time import Data.Time.Format import Locale ds = 10/11/2009 7:04:28 PM t = parseTime defaultTimeLocale %D %H:%M:%S %p ds :: Maybe UTCTime and get Nothing. What is wrong? Thanks ! Dmitri. ___

Re: [Haskell-cafe] Please help : Data.Time.Format parseTime

2011-06-14 Thread Dmitri O.Kondratiev
On Wed, 15 Jun 2011 00:33:56 +0400 Dmitri O.Kondratiev doko...@gmail.com wrote: I am trying to convert data string to time: import Data.Time import Data.Time.Format import Locale ds = 10/11/2009 7:04:28 PM t = parseTime defaultTimeLocale %D %H:%M:%S %p ds :: Maybe UTCTime

[Haskell-cafe] Best platform for development with GHC?

2011-06-14 Thread Dmitri O.Kondratiev
Which platform - Mac OS X, Linux or Win32 is best for development with GHC today? How are things with Ubuntu? It was quite a while already that I used Haskell on Linux. Today I have to code on Win32 and Mac OS X. Installing extra libraries caused most of the pains for me on Win32 - for example

Re: [Haskell-cafe] Best platform for development with GHC?

2011-06-14 Thread Dmitri O.Kondratiev
On Wed, Jun 15, 2011 at 2:34 AM, Henning Thielemann lemm...@henning-thielemann.de wrote: On Wed, 15 Jun 2011, Dmitri O.Kondratiev wrote: Which platform - Mac OS X, Linux or Win32 is best for development with GHC today? How are things with Ubuntu? It was quite a while already that I used

Re: [Haskell-cafe] GHC 7.0.3 / Win32: Data.Time library?

2011-06-15 Thread Dmitri O.Kondratiev
Hi, Yitz! Your example puts scattered around pieces in place, thanks a lot! On Wed, Jun 15, 2011 at 9:49 AM, Yitzchak Gale g...@sefer.org wrote: Dmitri O.Kondratiev wrote: It would also help to see a simple example of parsing 10/11/2009 7:04:28 PM to time and date objects. Let's assume

Re: [Haskell-cafe] GHC 7.0.3 / Win32: Data.Time library?

2011-06-15 Thread Dmitri O.Kondratiev
' function? 3) How to convert UTCTime to Data.Time.Calendar.Day and back to UTCTime? Thanks! On Wed, Jun 15, 2011 at 12:55 PM, Dmitri O.Kondratiev doko...@gmail.comwrote: Hi, Yitz! Your example puts scattered around pieces in place, thanks a lot! On Wed, Jun 15, 2011 at 9:49 AM, Yitzchak Gale g

Re: [Haskell-cafe] Best platform for development with GHC?

2011-06-15 Thread Dmitri O.Kondratiev
*Ketil Malde* ketil at malde.org haskell-cafe%40haskell.org?Subject=Re%3A%20%5BHaskell-cafe%5D%20Best%20platform%20for%20development%20with%20GHC%3FIn-Reply-To=%3C8739jb60hv.fsf%40malde.org%3E writes: I use Ubuntu. Most stuff is fairly up-to-date, but even with six-month releases, it's lagging

[Haskell-cafe] Simple string tokenizer?

2011-06-15 Thread Dmitri O.Kondratiev
Sorry if this question was asked billions of times already, but I can not find a simple string tokenizer. All I need is to split a line in chunks at specified delimiter such as (,), nothing more. Don't want to write it myself for two reasons: 1) have to write lots of other code in very short time

Re: [Haskell-cafe] Simple string tokenizer?

2011-06-15 Thread Dmitri O.Kondratiev
/archive/split/0.1.4/doc/html/Data-List-Split.html On Jun 15, 2011, at 12:21 PM, Dmitri O.Kondratiev wrote: Sorry if this question was asked billions of times already, but I can not find a simple string tokenizer. All I need is to split a line in chunks at specified delimiter such as (,), nothing

[Haskell-cafe] Win32: cabal install --prefix=$HOME --user ?

2011-06-16 Thread Dmitri O.Kondratiev
On win32 cabal install --prefix=$HOME --user fails: cabal install --prefix=$HOME --user Resolving dependencies... Configuring split-0.1.4... cabal: expected an absolute directory name for --prefix: $HOME cabal: Error: some packages failed to install: split-0.1.4 failed during the configure step.

[Haskell-cafe] Data.Map: Values to keys and keys to values

2011-06-16 Thread Dmitri O.Kondratiev
Hi, Data.Map has many great functions, yet I could not find the one that allows from one map create another map where keys are values and values are keys of the first one. Something like: transMap:: (Ord k, Ord a) = Map k a - Map a k Does such function exist? Thanks!

Re: [Haskell-cafe] Data.Map: Values to keys and keys to values

2011-06-16 Thread Dmitri O.Kondratiev
On Thu, Jun 16, 2011 at 5:38 PM, Johan Tibell johan.tib...@gmail.comwrote: On Thu, Jun 16, 2011 at 3:01 PM, Dmitri O.Kondratiev doko...@gmail.com wrote: Hi, Data.Map has many great functions, yet I could not find the one that allows from one map create another map where keys are values

Re: [Haskell-cafe] Win32: cabal install --prefix=$HOME --user ?

2011-06-16 Thread Dmitri O.Kondratiev
On Thu, Jun 16, 2011 at 6:18 PM, Ryan Yates fryguy...@gmail.com wrote: There is a nice table in the cabal docs that explains how prefix gets used: http://www.haskell.org/ghc/docs/7.0.4/html/Cabal/builders.html#simple-paths For Vista and above C:\Documents and settings\myusername\ is

[Haskell-cafe] Simple CSV parser?

2011-06-16 Thread Dmitri O.Kondratiev
Hi, This time I am looking for a simple CSV parser that supports commas and quotes. I have no time now to learn Parsec, so I hope to find something simple and easy to use. Thanks! ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Simple CSV parser?

2011-06-16 Thread Dmitri O.Kondratiev
On Fri, Jun 17, 2011 at 1:27 AM, Felipe Almeida Lessa felipe.le...@gmail.com wrote: On Thu, Jun 16, 2011 at 6:21 PM, Dmitri O.Kondratiev doko...@gmail.com wrote: This time I am looking for a simple CSV parser that supports commas and quotes. I have no time now to learn Parsec, so I hope

Re: [Haskell-cafe] Simple CSV parser?

2011-06-16 Thread Dmitri O.Kondratiev
On Fri, Jun 17, 2011 at 1:33 AM, Henning Thielemann lemm...@henning-thielemann.de wrote: How could it miss my lovely package named spreadsheet? It provides a lazy parser. Installing spreadsheet: cabal install Resolving dependencies... cabal: cannot configure explicit-exception-0.1.6. It

Re: [Haskell-cafe] Simple CSV parser?

2011-06-16 Thread Dmitri O.Kondratiev
On Fri, Jun 17, 2011 at 2:05 AM, Henning Thielemann lemm...@henning-thielemann.de wrote: On Fri, 17 Jun 2011, Dmitri O.Kondratiev wrote: How to make cabal install all the dependencies? I couldn't find this in the docs at: http://www.haskell.org/haskellwiki/Cabal-Install Usually, 'cabal

Re: [Haskell-cafe] Simple CSV parser?

2011-06-16 Thread Dmitri O.Kondratiev
On Fri, Jun 17, 2011 at 2:13 AM, Dmitri O.Kondratiev doko...@gmail.comwrote: On Fri, Jun 17, 2011 at 2:05 AM, Henning Thielemann lemm...@henning-thielemann.de wrote: On Fri, 17 Jun 2011, Dmitri O.Kondratiev wrote: How to make cabal install all the dependencies? I couldn't find

Re: [Haskell-cafe] Simple CSV parser?

2011-06-16 Thread Dmitri O.Kondratiev
On Fri, Jun 17, 2011 at 2:27 AM, Henning Thielemann lemm...@henning-thielemann.de wrote: I see. I had fixed the problem locally long time ago, but somehow missed upload to Hackage. Try the updated package, please. Ok great! Installed (with some warnings, see below), thank you! I'll try it

Re: [Haskell-cafe] Simple CSV parser?

2011-06-17 Thread Dmitri O.Kondratiev
On Fri, Jun 17, 2011 at 2:37 AM, Henning Thielemann lemm...@henning-thielemann.de wrote: On Thu, 16 Jun 2011, Felipe Almeida Lessa wrote: [1] http://hackage.haskell.org/**package/bytestring-csvhttp://hackage.haskell.org/package/bytestring-csv [2]

[Haskell-cafe] Text.CSV questions

2011-06-17 Thread Dmitri O.Kondratiev
Hi, I try to parse csv file with Text.CSV, like this: import Text.CSV import System main = do [inpFileName] - getArgs putStrLn (Parsing ++inpFileName++...) let result = parseCSVFromFile inpFileName print result === As a result I get: No instance for (Show

Re: [Haskell-cafe] Text.CSV questions

2011-06-17 Thread Dmitri O.Kondratiev
On Fri, Jun 17, 2011 at 1:04 PM, Vincent Hanquez t...@snarc.org wrote: On 06/17/2011 10:00 AM, Dmitri O.Kondratiev wrote: Hi, I try to parse csv file with Text.CSV, like this: import Text.CSV import System main = do [inpFileName] - getArgs putStrLn (Parsing ++inpFileName

[Haskell-cafe] Conditional IO ?

2011-06-20 Thread Dmitri O.Kondratiev
Hi, What is right way to do conditional IO? For example, I need to write to file errors only in case they exist, otherwise my function should do nothing: handleParseErrors errors | (not . null) errors = writeFile parse-errors.txt (show errors) | otherwise = ? What should be an 'otherwise'

Re: [Haskell-cafe] Conditional IO ?

2011-06-20 Thread Dmitri O.Kondratiev
that eliminates the else case for conditional IO: http://hackage.haskell.org/packages/archive/base/latest/doc/html/Control-Monad.html#v:when On Mon, Jun 20, 2011 at 4:00 PM, Dmitri O.Kondratiev doko...@gmail.com wrote: Hi, What is right way to do conditional IO? For example, I need to write to file

Re: [Haskell-cafe] Text.CSV questions

2011-06-20 Thread Dmitri O.Kondratiev
, this is better, then printing empty error list. 2011/6/17 Dmitri O.Kondratiev doko...@gmail.com On Fri, Jun 17, 2011 at 1:04 PM, Vincent Hanquez t...@snarc.org wrote: On 06/17/2011 10:00 AM, Dmitri O.Kondratiev wrote: Hi, I try to parse csv file with Text.CSV, like this: import Text.CSV

[Haskell-cafe] Text report tools?

2011-06-20 Thread Dmitri O.Kondratiev
Hi, I am looking for an easy way to generate text reports. For starters I need a very simple report that may contain: - Some headers - Lists of text strings where each string can include instances of basic Haskell types. Each string should be printed on a separate line (terminated with LF). Do I

[Haskell-cafe] Graph diagram tools?

2011-06-22 Thread Dmitri O.Kondratiev
Hi, I am looking for Haskell library to create graph diagrams in png or similar formats. Thanks! ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

  1   2   >