[Haskell-cafe] Compiling haskell-platform-2013.2.0.0 fails
Hello, I'm attempting to compile haskell-platform on an Arch Linux system. It fails very soon after invoking 'make': Configuring HUnit-1.2.5.2... Setup: Use of GHC's environment variable GHC_PACKAGE_PATH is incompatible with Cabal. Use the flag --package-db to specify a package database (it can be used multiple times). If it makes a difference, I'm using GHC 7.6.3 from the Arch package repo. The envar GHC_PACKAGE_PATH mentioned in the error message is unset. Thanks for any help, Roger This electronic communication is governed by the terms and conditions at http://www.mun.ca/cc/policies/electronic_communications_disclaimer_2012.php ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] parsing a CSV file
Hello, I'm attempting to write a parser for files that look like this: Bruker Nano GmbH Berlin, Germany Esprit 1.9 Date: 02/05/2013 10:06:49 AM Real time: 15000 Energy Counts -0.4740 . The line before the ellipsis is repeated many times (such lines represents a spectrum). I need to be able to extract numbers from lines containing string: and I want to extract the number pairs following Energy Counts\n. The extracted data will then be written to a file in a different format. For now I'll be satisfied with reading the header info, i.e. down to Energy Counts\n. Thus far, I have: -- derived from RWH -- file: ch16/csv2.hs import Text.ParserCombinators.Parsec headerLines = endBy csvFile endHeader csvFile = endBy line eol line = sepBy cell (char ',') cell = many (noneOf ,\n) eol = char '\n' parseCSV :: String - Either ParseError [[String]] parseCSV input = parse csvFile (unknown) input parseHDR :: String - Either ParseError [[String]] parseHDR input = parse headerLines (unknown) input endHeader = string Energy Counts This loads into GHCi (7.6.2) OK. However, when I test it: parseHDR Bruker Nano GmbH Berlin, Germany\nEsprit 1.9\n\nDate: 02/05/2013 10:06:49 AM\nReal time: 15000\nEnergy Counts Not in scope: `parseHDR' which makes sense because ghci :t endHeader interactive:1:1: Not in scope: `endHeader' Clearly, my naiive implementation of endHeader is no good. I appreciate any pointers. Thanks, Roger This electronic communication is governed by the terms and conditions at http://www.mun.ca/cc/policies/electronic_communications_disclaimer_2012.php ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] parsing a CSV file
Hi Roman, On 05/21/2013 12:36 PM, Roman Cheplyaka wrote: Clearly, my naiive implementation of endHeader is no good. Hi Roger, Not in scope means that that thing is not defined. So it's not a problem with your implementation, but with the way you load it. If you copy-paste your ghci session here, you may get further help. Roman Starting with a clean ghci session I get this: ghci :l csv.hs [1 of 1] Compiling Main ( csv.hs, interpreted ) csv.hs:15:24: Couldn't match type `[Char]' with `Char' Expected type: Text.Parsec.Prim.Parsec String () [[String]] Actual type: Text.Parsec.Prim.ParsecT String () Data.Functor.Identity.Identity Char In the first argument of `parse', namely `headerLines' In the expression: parse headerLines (unknown) input In an equation for `parseHDR': parseHDR input = parse headerLines (unknown) input Failed, modules loaded: none. Thanks, Roger This electronic communication is governed by the terms and conditions at http://www.mun.ca/cc/policies/electronic_communications_disclaimer_2012.php ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] parsing a CSV file
Thank you. Roger On 05/21/2013 03:15 PM, Roman Cheplyaka wrote: So this is the real error. If you read it carefully, it says that it expected [[String]] but got Char (i.e. [[[String]]]) as a result of the headerLines parser. I don't have time right now to look closer at your code, but I suggest studying the types of combinators you use (such as endBy) and trying to write down type signatures for the rest of the values you define. This way you'll find the error and better understand your program. A useful trick is to start ghci with -fdefer-type-errors and use :t to inspect types of various expressions that you encounter. Roman This electronic communication is governed by the terms and conditions at http://www.mun.ca/cc/policies/electronic_communications_disclaimer_2012.php ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Cabal install pandoc
Hello Albert, On 04/01/2013 11:41 PM, Albert Y. C. Lai wrote: On 13-04-01 06:26 AM, Roger Mason wrote: It turned out that there was a stale version of 'array' lurking in the ghc package db. In spite of reinstalling ghc it did not go away until I unregistered it. I think it was persisting because re-installing ghc simply unpacked over the old directory leaving that pre-existing file intact. See my http://www.vex.net/~trebla/haskell/sicp.xhtml for how does GHC know or not know what libs you have. In particular, it has very little to do with files, and clearing GHC is only half the story. And how to have the same kind of problems recur in the future. Thank you. I have read and filed away the article for future reference. I guess the best (least error prone) method of installing ghc and packages is to obtain a binary ghc (outside one's package manager), build haskell platform and then maintain ghc and packages outside the distro package manager. Comments welcome. Roger This electronic communication is governed by the terms and conditions at http://www.mun.ca/cc/policies/electronic_communications_disclaimer_2012.php ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] cabal install pandoc
Hello Brent, On 03/31/2013 04:53 PM, Brent Yorgey wrote: It looks like your entire Haskell Platform installation is completely hosed. Sad to say, but I think your best bet is to simply reinstall the Haskell Platform. -Brent ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe It turned out that there was a stale version of 'array' lurking in the ghc package db. In spite of reinstalling ghc it did not go away until I unregistered it. I think it was persisting because re-installing ghc simply unpacked over the old directory leaving that pre-existing file intact. 'ghc-pkg check' shows no errors and I have successfully installed pandoc and some other packages. Roger This electronic communication is governed by the terms and conditions at http://www.mun.ca/cc/policies/electronic_communications_disclaimer_2012.php ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] cabal install pandoc
Thank you for your response. 'ghc-pkg check' shows some problems: http://pastebin.ca/2344794 On 03/28/2013 08:01 PM, Patrick Wheeler wrote: So I printed off the requirements for pandoc on a empty ghc-7.6.2 install you can find it at: http://hpaste.org/84794 I do not see any odd package versions listed in what you posted so far. No promise I will be able to help afterwards but it might help to see the full log, and then again with verbosity turned on. So seperate pastes for: * `cabal install pandoc --dry-run` * `cabal install pandoc --dry-run --verbose=2` * `cabal install pandoc --dry-run --verbose=3` You might also want to run a `ghc-pkg check` to check to see if your packages are consistent/unbroken. 'ghc-pkg check' shows some problems: http://pastebin.ca/2344794 Thanks for any help you can offer. Roger This electronic communication is governed by the terms and conditions at http://www.mun.ca/cc/policies/electronic_communications_disclaimer_2012.php ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] cabal install pandoc
Hello, On 03/29/2013 06:47 AM, Henk-Jan van Tuyl wrote: On Thu, 28 Mar 2013 19:08:46 +0100, Roger Mason rma...@mun.ca wrote: I installed ghc (7.6.2) on an Arch Linux machine. I'm trying to install pandoc via cabal but it fails: ... Configuring text-0.11.2.3... Warning: This package indirectly depends on multiple versions of the same package. This is highly likely to cause a compile failure. package deepseq-1.3.0.1 requires array-0.4.0.1 package text-0.11.2.3 requires array-0.4.0.1 Building text-0.11.2.3... Preprocessing library text-0.11.2.3... command line: cannot satisfy -package-id array-0.4.0.1-db49bb8b0087ae85b5875d4c0cc12874 (use -v for more information) Failed to install text-0.11.2.3 ... I had something similar with Ubuntu (before there was a binary package available for this platform); I installed several packages, that gave such message, again. That solved it. Regards, Henk-Jan van Tuyl It appears in my case that cabal may be looking in a strange place for installed pacckages. At least, that is how I interpret the output I just pasted here: http://pastebin.ca/2344794 Thanks, Roger This electronic communication is governed by the terms and conditions at http://www.mun.ca/cc/policies/electronic_communications_disclaimer_2012.php ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] cabal install pandoc [solved]
Hello, On 03/29/2013 08:13 AM, Roger Mason wrote: Hello, It appears in my case that cabal may be looking in a strange place for installed pacckages. At least, that is how I interpret the output I just pasted here: http://pastebin.ca/2344794 Thanks, Roger ghc-pkg check showed that there were problems with 'array'. ghc-pkg unregister and a fresh installation of ghc and cabal-install have fixed the problem. Thanks to all who responded. Roger This electronic communication is governed by the terms and conditions at http://www.mun.ca/cc/policies/electronic_communications_disclaimer_2012.php ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] cabal install pandoc
Hello, I installed ghc (7.6.2) on an Arch Linux machine. I'm trying to install pandoc via cabal but it fails: ... Configuring text-0.11.2.3... Warning: This package indirectly depends on multiple versions of the same package. This is highly likely to cause a compile failure. package deepseq-1.3.0.1 requires array-0.4.0.1 package text-0.11.2.3 requires array-0.4.0.1 Building text-0.11.2.3... Preprocessing library text-0.11.2.3... command line: cannot satisfy -package-id array-0.4.0.1-db49bb8b0087ae85b5875d4c0cc12874 (use -v for more information) Failed to install text-0.11.2.3 ... There are then errors for other packages that depend on 'text' or 'array'. I will be grateful for any help. Thanks, Roger This electronic communication is governed by the terms and conditions at http://www.mun.ca/cc/policies/electronic_communications_disclaimer_2012.php ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] cabal install pandoc
hello, On 03/28/2013 04:11 PM, Mark Fredrickson wrote: To side step the issue, Pandoc is available via the ArchHaskell repos (package name `haskell-pandoc`): https://wiki.archlinux.org/index.php/Haskell_package_guidelines -M Yes, I know. I wanted to avoid having a mixture of packages installed by pacman and others (not available in the repo) installed using cabal. Thanks, Roger This electronic communication is governed by the terms and conditions at http://www.mun.ca/cc/policies/electronic_communications_disclaimer_2012.php ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe