
Bonjour a tous, Je me suis lancé dans le tuto de DAAN LEIJEN sur parsec il y a qq temps. Je voulais passer a l'experimentation mais je n'arrive pas a compiler mon code. J'ai tenté toutes les variantes de lancement de ghc fournies dans la le tuto a coup de ghc -lparsec -Lparsec, ghc --package Parsec, ... rien ne fait ... en simplifiant, voila ce que je tente:
cabal install 'parsec >= 3' Resolving dependencies... No packages to be installed. All the requested packages are already installed. If you want to reinstall anyway then use the --reinstall flag.
cat > a.hs import Parsec main = print "do"
ghc -v !$
Glasgow Haskell Compiler, Version 6.10.4, for Haskell 98, stage 2 booted by GHC version 6.8.2 Using package config file: /usr/local/stow/ghc-6.10.4/lib/ghc-6.10.4/./package.conf Using package config file: /home/mc/.ghc/i386-linux-6.10.4/package.conf hiding package base-3.0.3.1 to avoid conflict with later version base-4.1.0.0 hiding package Cabal-1.6.0.3 to avoid conflict with later version Cabal-1.8.0.6 hiding package network-2.2.1.2 to avoid conflict with later version network-2.2.1.4 hiding package QuickCheck-1.2.0.0 to avoid conflict with later version QuickCheck-2.1.0.2 hiding package parsec-2.1.0.1 to avoid conflict with later version parsec-3.1.0 hiding package regex-base-0.72.0.2 to avoid conflict with later version regex-base-0.93.1 hiding package time-1.1.2.4 to avoid conflict with later version time-1.1.4 hiding package vty-3.1.8.4 to avoid conflict with later version vty-4.0.0.1 hiding package happstack-util-0.3.2 to avoid conflict with later version happstack-util-0.4.1 hiding package happstack-data-0.3.3 to avoid conflict with later version happstack-data-0.4.1 hiding package happstack-ixset-0.3.2 to avoid conflict with later version happstack-ixset-0.4.1 hiding package happstack-server-0.3.3 to avoid conflict with later version happstack-server-0.4.1 hiding package happstack-state-0.3.4 to avoid conflict with later version happstack-state-0.4.1 hiding package happstack-0.3.2 to avoid conflict with later version happstack-0.4.1 hiding package xml-1.3.4 to avoid conflict with later version xml-1.3.5 hiding package pandoc-1.5.1 to avoid conflict with later version pandoc-1.5.1.1 wired-in package ghc-prim mapped to ghc-prim-0.1.0.0 wired-in package integer mapped to integer-0.1.0.1 wired-in package base mapped to base-4.1.0.0 wired-in package rts mapped to rts-1.0 wired-in package haskell98 mapped to haskell98-1.0.1.0 wired-in package syb mapped to syb-0.1.0.1 wired-in package template-haskell mapped to template-haskell-2.3.0.1 wired-in package dph-seq mapped to dph-seq-0.3 wired-in package dph-par mapped to dph-par-0.3 Hsc static flags: -static Created temporary directory: /tmp/ghc31931_0 *** Checking old interface for main:Main: *** Parser: *** Renamer/typechecker: a.hs:1:0: Failed to load interface for `Parsec': locations searched: Parsec.hi Parsec.hi-boot *** Deleting temp files: Deleting: /tmp/ghc31931_0/ghc31931_0.s Warning: deleting non-existent /tmp/ghc31931_0/ghc31931_0.s *** Deleting temp dirs: Deleting: /tmp/ghc31931_0 si qq1 peut voler a mon secours ? cordialement marc

Je n'ai pas lu tes logs en détail mais as-tu essayé de rajouter le flag --make ?
ghc --make -lparsec ...
http://www.haskell.org/ghc/docs/5.00/set/make-mode.html (en anglais)
et 4.6.3 dans http://www.haskell.org/ghc/docs/6.12.1/html/users_guide/separate-compilation...
guillaume
On Tue, Aug 10, 2010 at 11:02 AM, Marc Chantreux
Bonjour a tous,
Je me suis lancé dans le tuto de DAAN LEIJEN sur parsec il y a qq temps. Je voulais passer a l'experimentation mais je n'arrive pas a compiler mon code.
J'ai tenté toutes les variantes de lancement de ghc fournies dans la le tuto a coup de
ghc -lparsec -Lparsec, ghc --package Parsec, ...
rien ne fait ... en simplifiant, voila ce que je tente:
cabal install 'parsec >= 3' Resolving dependencies... No packages to be installed. All the requested packages are already installed. If you want to reinstall anyway then use the --reinstall flag.
cat > a.hs import Parsec main = print "do"
ghc -v !$
Glasgow Haskell Compiler, Version 6.10.4, for Haskell 98, stage 2 booted by GHC version 6.8.2 Using package config file: /usr/local/stow/ghc-6.10.4/lib/ghc-6.10.4/./package.conf Using package config file: /home/mc/.ghc/i386-linux-6.10.4/package.conf hiding package base-3.0.3.1 to avoid conflict with later version base-4.1.0.0 hiding package Cabal-1.6.0.3 to avoid conflict with later version Cabal-1.8.0.6 hiding package network-2.2.1.2 to avoid conflict with later version network-2.2.1.4 hiding package QuickCheck-1.2.0.0 to avoid conflict with later version QuickCheck-2.1.0.2 hiding package parsec-2.1.0.1 to avoid conflict with later version parsec-3.1.0 hiding package regex-base-0.72.0.2 to avoid conflict with later version regex-base-0.93.1 hiding package time-1.1.2.4 to avoid conflict with later version time-1.1.4 hiding package vty-3.1.8.4 to avoid conflict with later version vty-4.0.0.1 hiding package happstack-util-0.3.2 to avoid conflict with later version happstack-util-0.4.1 hiding package happstack-data-0.3.3 to avoid conflict with later version happstack-data-0.4.1 hiding package happstack-ixset-0.3.2 to avoid conflict with later version happstack-ixset-0.4.1 hiding package happstack-server-0.3.3 to avoid conflict with later version happstack-server-0.4.1 hiding package happstack-state-0.3.4 to avoid conflict with later version happstack-state-0.4.1 hiding package happstack-0.3.2 to avoid conflict with later version happstack-0.4.1 hiding package xml-1.3.4 to avoid conflict with later version xml-1.3.5 hiding package pandoc-1.5.1 to avoid conflict with later version pandoc-1.5.1.1 wired-in package ghc-prim mapped to ghc-prim-0.1.0.0 wired-in package integer mapped to integer-0.1.0.1 wired-in package base mapped to base-4.1.0.0 wired-in package rts mapped to rts-1.0 wired-in package haskell98 mapped to haskell98-1.0.1.0 wired-in package syb mapped to syb-0.1.0.1 wired-in package template-haskell mapped to template-haskell-2.3.0.1 wired-in package dph-seq mapped to dph-seq-0.3 wired-in package dph-par mapped to dph-par-0.3 Hsc static flags: -static Created temporary directory: /tmp/ghc31931_0 *** Checking old interface for main:Main: *** Parser: *** Renamer/typechecker:
a.hs:1:0: Failed to load interface for `Parsec': locations searched: Parsec.hi Parsec.hi-boot *** Deleting temp files: Deleting: /tmp/ghc31931_0/ghc31931_0.s Warning: deleting non-existent /tmp/ghc31931_0/ghc31931_0.s *** Deleting temp dirs: Deleting: /tmp/ghc31931_0
si qq1 peut voler a mon secours ?
cordialement marc _______________________________________________ Haskell-fr mailing list Haskell-fr@haskell.org http://www.haskell.org/mailman/listinfo/haskell-fr

Ne fais pas "import Parsec". A la place, fais import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Char import Text.ParserCombinators.Parsec.Combinator Pour voir si ca marche: david@pcdavid:~/code/edimail$ ghci GHCi, version 6.12.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Loading package ffi-1.0 ... linking ... done. Prelude> import Parsec <no location info>: Could not find module `Parsec': it is not a module in the current program, or in any known package. Prelude> import Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> Pour compiler, ghc --make -O2 Tatata.hs David.

On Tue, Aug 10, 2010 at 04:12:49PM +0200, David Virebayre wrote:
Ne fais pas "import Parsec". A la place, fais
import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Char import Text.ParserCombinators.Parsec.Combinator
Pour voir si ca marche:
ca marche ... mais du coup j'ai un peu de mal a saisir: - dans le tuto je trouve import parsec - en cherchant sur hackage je trouve module Text.Parsec (et juste en dessous, je m'en rend compte maintenant, Text.ParserCombinators.Parsec) et enfin il me faut ton exemple pour avoir le bon namespace. venant du monde perl (ou tout est bien carré dans le CPAN), j'avoue etre un peu perdu: - le tuto est faux ? - c'est le foutoir dans hackage ? - je n'ai pas encore compris un des concepts metaphysiques dont haskell a le secret ? marc

2010/8/10 Marc Chantreux
- le tuto est faux ? - c'est le foutoir dans hackage ? - je n'ai pas encore compris un des concepts metaphysiques dont haskell a le secret ?
Haskell est un langage qui évolue, à mon avis le tuto doit dater un peu. Dans la norme haskell 98, il n'y a pas de hierarchie de modules, dont tous les modules avaient un nom simple: import List import Char import Parsec etc... Mais comme ca devenait le foutoir, une extension prévoit des noms de modules "hiérarchiques", comme Data.List Control.Monad etc. Cette extension fait maintenant partie de la norme Haskell 2010. David. P.S. --make facilite la tache dès que ton projet comporte plusieurs fichiers haskell. Pour les librairies externes, c'est autre chose.

On Tue, Aug 10, 2010 at 11:05:47AM -0300, Guillaume Hoffmann wrote:
Je n'ai pas lu tes logs en détail mais as-tu essayé de rajouter le flag --make ?
ghc --make -lparsec ...
--make est nécessaire quand on link avec des libs qui ne sont pas écrites en haskell (comme readline par exemple). Il me semble que le pb est différent ? marc

Hi,
Parsec is actually separated in "pieces".
But if you are using modular parser combinators from Parsec or other functions, then is a good ideea to locate the exact module from where they belongs, and include it, as it was told.
Use Hoogle to locate the needed module.
Make is forcing/instructing the compiler to find ALL the needed dependencies (modules) and compile them all.
If still in trouble, ask again.
Dan
--- On Tue, 8/10/10, Marc Chantreux
From: Marc Chantreux
Subject: Re: [Haskell-fr] premier essai avec Parsec To: "La liste Haskell Francophone" Date: Tuesday, August 10, 2010, 7:32 AM On Tue, Aug 10, 2010 at 11:05:47AM -0300, Guillaume Hoffmann wrote: Je n'ai pas lu tes logs en détail mais as-tu essayé de rajouter le flag --make ?
ghc --make -lparsec ...
--make est nécessaire quand on link avec des libs qui ne sont pas écrites en haskell (comme readline par exemple). Il me semble que le pb est différent ?
marc _______________________________________________ Haskell-fr mailing list Haskell-fr@haskell.org http://www.haskell.org/mailman/listinfo/haskell-fr

Hi,
Have you tried ?
ghc --make main.hs
Dan
--- On Tue, 8/10/10, Marc Chantreux
From: Marc Chantreux
Subject: [Haskell-fr] premier essai avec Parsec To: haskell-fr@haskell.org Date: Tuesday, August 10, 2010, 7:02 AM Bonjour a tous, Je me suis lancé dans le tuto de DAAN LEIJEN sur parsec il y a qq temps. Je voulais passer a l'experimentation mais je n'arrive pas a compiler mon code.
J'ai tenté toutes les variantes de lancement de ghc fournies dans la le tuto a coup de
ghc -lparsec -Lparsec, ghc --package Parsec, ...
rien ne fait ... en simplifiant, voila ce que je tente:
cabal install 'parsec >= 3' Resolving dependencies... No packages to be installed. All the requested packages are already installed. If you want to reinstall anyway then use the --reinstall flag.
cat > a.hs import Parsec main = print "do"
ghc -v !$
Glasgow Haskell Compiler, Version 6.10.4, for Haskell 98, stage 2 booted by GHC version 6.8.2 Using package config file: /usr/local/stow/ghc-6.10.4/lib/ghc-6.10.4/./package.conf Using package config file: /home/mc/.ghc/i386-linux-6.10.4/package.conf hiding package base-3.0.3.1 to avoid conflict with later version base-4.1.0.0 hiding package Cabal-1.6.0.3 to avoid conflict with later version Cabal-1.8.0.6 hiding package network-2.2.1.2 to avoid conflict with later version network-2.2.1.4 hiding package QuickCheck-1.2.0.0 to avoid conflict with later version QuickCheck-2.1.0.2 hiding package parsec-2.1.0.1 to avoid conflict with later version parsec-3.1.0 hiding package regex-base-0.72.0.2 to avoid conflict with later version regex-base-0.93.1 hiding package time-1.1.2.4 to avoid conflict with later version time-1.1.4 hiding package vty-3.1.8.4 to avoid conflict with later version vty-4.0.0.1 hiding package happstack-util-0.3.2 to avoid conflict with later version happstack-util-0.4.1 hiding package happstack-data-0.3.3 to avoid conflict with later version happstack-data-0.4.1 hiding package happstack-ixset-0.3.2 to avoid conflict with later version happstack-ixset-0.4.1 hiding package happstack-server-0.3.3 to avoid conflict with later version happstack-server-0.4.1 hiding package happstack-state-0.3.4 to avoid conflict with later version happstack-state-0.4.1 hiding package happstack-0.3.2 to avoid conflict with later version happstack-0.4.1 hiding package xml-1.3.4 to avoid conflict with later version xml-1.3.5 hiding package pandoc-1.5.1 to avoid conflict with later version pandoc-1.5.1.1 wired-in package ghc-prim mapped to ghc-prim-0.1.0.0 wired-in package integer mapped to integer-0.1.0.1 wired-in package base mapped to base-4.1.0.0 wired-in package rts mapped to rts-1.0 wired-in package haskell98 mapped to haskell98-1.0.1.0 wired-in package syb mapped to syb-0.1.0.1 wired-in package template-haskell mapped to template-haskell-2.3.0.1 wired-in package dph-seq mapped to dph-seq-0.3 wired-in package dph-par mapped to dph-par-0.3 Hsc static flags: -static Created temporary directory: /tmp/ghc31931_0 *** Checking old interface for main:Main: *** Parser: *** Renamer/typechecker:
a.hs:1:0: Failed to load interface for `Parsec': locations searched: Parsec.hi Parsec.hi-boot *** Deleting temp files: Deleting: /tmp/ghc31931_0/ghc31931_0.s Warning: deleting non-existent /tmp/ghc31931_0/ghc31931_0.s *** Deleting temp dirs: Deleting: /tmp/ghc31931_0
si qq1 peut voler a mon secours ?
cordialement marc _______________________________________________ Haskell-fr mailing list Haskell-fr@haskell.org http://www.haskell.org/mailman/listinfo/haskell-fr
participants (4)
-
Dan Popa
-
David Virebayre
-
Guillaume Hoffmann
-
Marc Chantreux