Précédent   Forum du club des développeurs et IT Pro > Autres langages > Langages fonctionnels > Haskell
Haskell Forum d'entraide sur la programmation en langage fonctionnel Haskell
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse
 
Outils de la discussion
Publicité
'
Vieux 04/03/2012, 21h25   #1
LAYCI
Invité de passage
 
Femme
Étudiant
Inscription : février 2012
Messages : 13
Détails du profil
Informations personnelles :
Sexe : Femme
Localisation : Tunisie

Informations professionnelles :
Activité : Étudiant
Secteur : Industrie

Informations forums :
Inscription : février 2012
Messages : 13
Points : 2
Points : 2
Par défaut Compiler dans ghci

et comment compiler dans ghci!!!!
LAYCI est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 04/03/2012, 22h29   #2
Ptival
Membre actif
 
Avatar de Ptival
 
Homme Valentin Robert
Étudiant
Inscription : juin 2004
Messages : 70
Détails du profil
Informations personnelles :
Nom : Homme Valentin Robert
Âge : 24
Localisation : Etats-Unis

Informations professionnelles :
Activité : Étudiant

Informations forums :
Inscription : juin 2004
Messages : 70
Points : 172
Points : 172
LAYCI :
Il suffit de faire :
Ou plus court :
Tu peux peut-être aussi mettre un nom de fichier entier. Et si tu modifies un fichier chargé, tu peux :
ou
Ptival est déconnecté   Envoyer un message privé Réponse avec citation 10
Vieux 08/03/2012, 12h20   #3
LAYCI
Invité de passage
 
Femme
Étudiant
Inscription : février 2012
Messages : 13
Détails du profil
Informations personnelles :
Sexe : Femme
Localisation : Tunisie

Informations professionnelles :
Activité : Étudiant
Secteur : Industrie

Informations forums :
Inscription : février 2012
Messages : 13
Points : 2
Points : 2
Merci
j'ai un fichier notepad++ dans lequel j'ai écrit mon code:
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import Data.Array.Repa.IO.DevIL
import Data.Array.Repa hiding ((++))
import Data.Word
import System.Environment
 
--
-- Read an image, desaturate, write out with new name.
--
main = do 
  [f] <- getArgs
  runIL $ do
    a <- readImage f
    let b = traverse a id luminosity 
    writeImage ("grey-" ++ f) b


--
-- (Parallel) desaturation of an image via the luminosity method.
--
luminosity :: (DIM3 -> Word8) -> DIM3 -> Word8
luminosity _ (Z :. _ :. _ :. 3) = 255   -- alpha channel
luminosity f (Z :. i :. j :. _) = ceiling $ 0.21 * r + 0.71 * g + 0.07 * b
    where
        r = fromIntegral $ f (Z :. i :. j :. 0)
        g = fromIntegral $ f (Z :. i :. j :. 1)
        b = fromIntegral $ f (Z :. i :. j :. 2)
Je l'ai appelé exp.hs
j'ai volu le compiler en faisant :l exp.hs mais il ne reconnait pas le Repa
(à ce que j'ai compris je dois compiler tout d'abord le cabal puis faire "cabal install repa" ou quelque chose comme ça!!Mais comment compiler le cabal!!??)
LAYCI est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse
Outils de la discussion

Navigation rapide


Fuseau horaire GMT +2. Il est actuellement 11h54.


 
 
 
 
Partenaires

Hébergement Web