Send Beginners mailing list submissions to
        beginners@haskell.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        beginners-requ...@haskell.org

You can reach the person managing the list at
        beginners-ow...@haskell.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1.  cabal-dev ghci issues and reinstalling platform  with
      profiling on windows (MH)
   2.  problem using hsc2hs (Graham Gill)
   3. Re:  Strange behavior (Alba Marchisio)
   4. Re:  Strange behavior (Luca Ciciriello)
   5. Re:  Strange behavior (Daniel Fischer)
   6. Re:  Strange behavior (Luca Ciciriello)


----------------------------------------------------------------------

Message: 1
Date: Sun, 28 Aug 2011 15:19:30 -0400
From: MH <mha...@gmail.com>
Subject: [Haskell-beginners] cabal-dev ghci issues and reinstalling
        platform        with profiling on windows
To: beginners@haskell.org
Message-ID:
        <cabypoyybko-kwbqdff69gdm9ibggwcoaot0z3x08ukl1x-p...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

I have windows 7 with mingw/msys environment. I just installed the latest
haskell platform and cabal-dev.
For some reason, cabal-dev ghci fails with no much information. I tried to
add -v and message is not helpfull at all.
Here is what I did.

$ cd haskell_dev
$ cabal-dev install
cabal.exe: No cabal file found.
Please create a package description file <pkgname>.cabal

$cabal init
....
$ cabal-dev install
$ cabal-dev ghci
FAILED:
Failed to extract GHC build arguments
--------------------------------------------------
Run ghci configured as per the specified cabal file.

Usage: cabal-dev.exe <command>
...................


$ cabal-dev ghci -v
c:\build\Haskell\2011.2.0.1\lib\extralibs\bin\cabal.exe --numeric-version
c:\build\Haskell\2011.2.0.1\bin\ghc-pkg.exe --version
Using ghc-pkg 7.0.3
c:\build\Haskell\2011.2.0.1\lib\extralibs\bin\cabal.exe --version
c:\build\Haskell\2011.2.0.1\lib\extralibs\bin\cabal.exe
--config-file=c:\build\Projects\eclipseworkspace\Test\cabal-dev\cabal.config
build --verbose=2 --with-ghc=fake-ghc-cabal-dev
FAILED:
Failed to extract GHC build arguments

The second question relates to installing haskell platform on windows 7 with
profiling enabled. I tried
cabal install haskell-platform --reinstall -p (and some other options)
but it didn't work as haskell-platform is not on hackage.
Is reinstalling each library one by one the only option available for
windows users?

Thanks,

Malik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20110828/4bff8f28/attachment-0001.htm>

------------------------------

Message: 2
Date: Sun, 28 Aug 2011 23:45:30 -0400
From: Graham Gill <math.simp...@gmail.com>
Subject: [Haskell-beginners] problem using hsc2hs
To: beginners@haskell.org
Message-ID: <4e5b0b5a.9040...@gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

I've been trying to build package unix-compat-0.2.2.1 on a Windows XP 
machine which has the latest Haskell package installed (2011.2.0.1). I 
use "cabal install unix-compat". (I've updated my package list.)

I run into a problem when the file Extensions.hs is generated from 
Extensions.hsc using hsc2hs. Extensions.hs is created, but empty.

When I run the cabal install with verbose on, I'm able to see the hsc2hs 
command which generates Extensions.hs. Running that hsc2hs command with 
verbose on, I see the steps where it creates intermediate files .c, .o 
and .exe, then runs the .exe, which sends its output to stdout, and that 
stdout is redirected into Extentions.hs. The intermediate files are 
deleted. Extensions.hs is empty.

However, if I manually run each command which hsc2hs runs, Extensions.hs 
has the intended contents. I've reproduced the details below. Could this 
be a case of a problem with how lazy IO is used?

Here are the details. This command (I've cut out the paths from 
Extensions* files, so they're all created in/read from the current 
directory),

"C:\Program Files\Haskell Platform\2011.2.0.1\bin\hsc2hs.exe" 
--cc="C:\Program Files\Haskell Platform\2011.2.0.1\mingw\bin\gcc.exe" 
--ld="C:\Program Files\Haskell Platform\2011.2.0.1\mingw\bin\gcc.exe" 
--cflag=-fno-stack-protector --lflag=-fno-stack-protector 
--cflag=-D__GLASGOW_HASKELL__=700 --cflag=-Dmingw32_BUILD_OS 
--cflag=-Dmingw32_HOST_OS --cflag=-Di386_BUILD_ARCH 
--cflag=-Di386_HOST_ARCH --cflag=-DMISSING_POSIX_TYPES 
--cflag="-IC:\Program Files\Haskell 
Platform\2011.2.0.1\lib\directory-1.1.0.0\include" --cflag="-IC:\Program 
Files\Haskell Platform\2011.2.0.1\lib\old-time-1.0.0.6\include" 
--cflag="-IC:\Program Files\Haskell 
Platform\2011.2.0.1\lib\Win32-2.2.0.1\include" --cflag="-IC:\Program 
Files\Haskell Platform\2011.2.0.1\lib\bytestring-0.9.1.10\include" 
--cflag="-IC:\Program Files\Haskell 
Platform\2011.2.0.1\lib\base-4.3.1.0\include" --cflag="-IC:\Program 
Files\Haskell Platform\2011.2.0.1\lib/include" --cflag="-IC:\Program 
Files\Haskell Platform\2011.2.0.1\lib/include" --lflag="-LC:\Program 
Files\Haskell Platform\2011.2.0.1\lib\directory-1.1.0.0" 
--lflag="-LC:\Program Files\Haskell 
Platform\2011.2.0.1\lib\old-time-1.0.0.6" --lflag="-LC:\Program 
Files\Haskell Platform\2011.2.0.1\lib\old-locale-1.0.0.2" 
--lflag="-LC:\Program Files\Haskell 
Platform\2011.2.0.1\lib\filepath-1.2.0.0" --lflag="-LC:\Program 
Files\Haskell Platform\2011.2.0.1\lib\Win32-2.2.0.1" --lflag=-luser32 
--lflag=-lgdi32 --lflag=-lwinmm --lflag=-ladvapi32 --lflag=-lshell32 
--lflag=-lshfolder --lflag="-LC:\Program Files\Haskell 
Platform\2011.2.0.1\lib\bytestring-0.9.1.10" --lflag="-LC:\Program 
Files\Haskell Platform\2011.2.0.1\lib\base-4.3.1.0" --lflag=-lwsock32 
--lflag=-luser32 --lflag=-lshell32 --lflag="-LC:\Program Files\Haskell 
Platform\2011.2.0.1\lib\integer-gmp-0.2.0.3" --lflag="-LC:\Program 
Files\Haskell Platform\2011.2.0.1\lib\ghc-prim-0.2.0.0" 
--lflag="-LC:\Program Files\Haskell Platform\2011.2.0.1\lib" --lflag=-lm 
--lflag=-lwsock32 --lflag="-LC:\Program Files\Haskell 
Platform\2011.2.0.1\lib" --verbose -o Extensions.hs Extensions.hsc

run in a Windows command shell, generates Extensions_hsc_make.c, 
Extensions_hsc_make.o, Extensions_hsc_make.exe, and then runs

.\Extensions_hsc_make.exe >Extensions.hs

After this the intermediate files Extensions_hsc_make.* are deleted. 
Extensions.hs has no contents.

Since I ran with verbose on, I could see each step. Running each step 
individually:

1) create Extensions_hsc_make.c from Extensions.hsc, using --no-compile 
flag to hsc2hs:
"C:\Program Files\Haskell Platform\2011.2.0.1\bin\hsc2hs.exe" 
--cc="C:\Program Files\Haskell Platform\2011.2.0.1\mingw\bin\gcc.exe" 
--ld="C:\Program Files\Haskell Platform\2011.2.0.1\mingw\bin\gcc.exe" 
--cflag=-fno-stack-protector --lflag=-fno-stack-protector 
--cflag=-D__GLASGOW_HASKELL__=700 --cflag=-Dmingw32_BUILD_OS 
--cflag=-Dmingw32_HOST_OS --cflag=-Di386_BUILD_ARCH 
--cflag=-Di386_HOST_ARCH --cflag=-DMISSING_POSIX_TYPES 
--cflag="-IC:\Program Files\Haskell 
Platform\2011.2.0.1\lib\directory-1.1.0.0\include" --cflag="-IC:\Program 
Files\Haskell Platform\2011.2.0.1\lib\old-time-1.0.0.6\include" 
--cflag="-IC:\Program Files\Haskell 
Platform\2011.2.0.1\lib\Win32-2.2.0.1\include" --cflag="-IC:\Program 
Files\Haskell Platform\2011.2.0.1\lib\bytestring-0.9.1.10\include" 
--cflag="-IC:\Program Files\Haskell 
Platform\2011.2.0.1\lib\base-4.3.1.0\include" --cflag="-IC:\Program 
Files\Haskell Platform\2011.2.0.1\lib/include" --cflag="-IC:\Program 
Files\Haskell Platform\2011.2.0.1\lib/include" --lflag="-LC:\Program 
Files\Haskell Platform\2011.2.0.1\lib\directory-1.1.0.0" 
--lflag="-LC:\Program Files\Haskell 
Platform\2011.2.0.1\lib\old-time-1.0.0.6" --lflag="-LC:\Program 
Files\Haskell Platform\2011.2.0.1\lib\old-locale-1.0.0.2" 
--lflag="-LC:\Program Files\Haskell 
Platform\2011.2.0.1\lib\filepath-1.2.0.0" --lflag="-LC:\Program 
Files\Haskell Platform\2011.2.0.1\lib\Win32-2.2.0.1" --lflag=-luser32 
--lflag=-lgdi32 --lflag=-lwinmm --lflag=-ladvapi32 --lflag=-lshell32 
--lflag=-lshfolder --lflag="-LC:\Program Files\Haskell 
Platform\2011.2.0.1\lib\bytestring-0.9.1.10" --lflag="-LC:\Program 
Files\Haskell Platform\2011.2.0.1\lib\base-4.3.1.0" --lflag=-lwsock32 
--lflag=-luser32 --lflag=-lshell32 --lflag="-LC:\Program Files\Haskell 
Platform\2011.2.0.1\lib\integer-gmp-0.2.0.3" --lflag="-LC:\Program 
Files\Haskell Platform\2011.2.0.1\lib\ghc-prim-0.2.0.0" 
--lflag="-LC:\Program Files\Haskell Platform\2011.2.0.1\lib" --lflag=-lm 
--lflag=-lwsock32 --lflag="-LC:\Program Files\Haskell 
Platform\2011.2.0.1\lib" --no-compile -o Extensions.hs Extensions.hsc

2) create Extensions_hsc_make.o from Extensions_hsc_make.c:
"C:\Program Files\Haskell Platform\2011.2.0.1\mingw\bin\gcc.exe" -c 
Extensions_hsc_make.c -o Extensions_hsc_make.o -fno-stack-protector 
-D__GLASGOW_HASKELL__=700 -Dmingw32_BUILD_OS -Dmingw32_HOST_OS 
-Di386_BUILD_ARCH -Di386_HOST_ARCH -DMISSING_POSIX_TYPES -I"C:\Program 
Files\Haskell Platform\2011.2.0.1\lib\directory-1.1.0.0\include" 
-I"C:\Program Files\Haskell 
Platform\2011.2.0.1\lib\old-time-1.0.0.6\include" -I"C:\Program 
Files\Haskell Platform\2011.2.0.1\lib\Win32-2.2.0.1\include" 
-I"C:\Program Files\Haskell 
Platform\2011.2.0.1\lib\bytestring-0.9.1.10\include" -I"C:\Program 
Files\Haskell Platform\2011.2.0.1\lib\base-4.3.1.0\include" 
-I"C:\Program Files\Haskell Platform\2011.2.0.1\lib/include" 
-I"C:\Program Files\Haskell Platform\2011.2.0.1\lib/include" 
-I"C:/Program Files/Haskell Platform/2011.2.0.1/lib/include/"

3) create Extensions_hsc_make.exe from Extensions_hsc_make.o:
"C:\Program Files\Haskell Platform\2011.2.0.1\mingw\bin\gcc.exe" 
Extensions_hsc_make.o -o Extensions_hsc_make.exe -fno-stack-protector 
-L"C:\Program Files\Haskell Platform\2011.2.0.1\lib\directory-1.1.0.0" 
-L"C:\Program Files\Haskell Platform\2011.2.0.1\lib\old-time-1.0.0.6" 
-L"C:\Program Files\Haskell Platform\2011.2.0.1\lib\old-locale-1.0.0.2" 
-L"C:\Program Files\Haskell Platform\2011.2.0.1\lib\filepath-1.2.0.0" 
-L"C:\Program Files\Haskell Platform\2011.2.0.1\lib\Win32-2.2.0.1" 
-luser32 -lgdi32 -lwinmm -ladvapi32 -lshell32 -lshfolder -L"C:\Program 
Files\Haskell Platform\2011.2.0.1\lib\bytestring-0.9.1.10" -L"C:\Program 
Files\Haskell Platform\2011.2.0.1\lib\base-4.3.1.0" -lwsock32 -luser32 
-lshell32 -L"C:\Program Files\Haskell 
Platform\2011.2.0.1\lib\integer-gmp-0.2.0.3" -L"C:\Program Files\Haskell 
Platform\2011.2.0.1\lib\ghc-prim-0.2.0.0" -L"C:\Program Files\Haskell 
Platform\2011.2.0.1\lib" -lm -lwsock32 -L"C:\Program Files\Haskell 
Platform\2011.2.0.1\lib"

4) and creating Extensions.hs using Extensions_hsc_make.exe:
Extensions_hsc_make.exe >Extensions.hs

This generates a file with the intended contents. There are two other 
files in the unix-compat package, Files.hsc and User.hsc, which run into 
the same problem.

So what's the difference between running each step individually, which 
works, and running the combination of all steps, which gives me an empty 
file?

cheers!
Graham



------------------------------

Message: 3
Date: Mon, 29 Aug 2011 08:35:54 +0200
From: Alba Marchisio <alba.marchi...@gmail.com>
Subject: Re: [Haskell-beginners] Strange behavior
To: Luca Ciciriello <luca_cicirie...@hotmail.com>
Cc: beginners@haskell.org
Message-ID:
        <CAEf=7p1me4xfls2vb6nmoyrhe6f6syabt7cvzpt_kkgohfr...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Yes, I'm interested too in this problem.
Is any body able to answer to the Luca's question?

Alba

2011/8/25 Luca Ciciriello <luca_cicirie...@hotmail.com>

> I found a strange behavior in my code
>
> Here a (very) simplified version of my code:
>
> {-# LANGUAGE PArr #-}
> {-# OPTIONS -fdph-seq #-}
>
> module Main where
>
> import Control.Parallel
> import GHC.PArr
>
> parArr :: [:String:]
> parArr = [: "1", "2", "3", "4" :]
>
> isElement :: String -> Bool
> isElement x = x `elemP` parArr
>
> main :: IO ()
> main = do
>          putStrLn $ (show . isElement) "5"
>
> The aspected result is "False" ("5" isn't a member of parArr), but the
> result I get is "True".
>
> I've compiled this code with the command:
> ghc --make -Odph -threaded Test.hs -rtsopts -o test
>
> and launched with:
> test +RTS -N2
>
> My system is MacOS X 10.7.1 with Xcode 4.1 and GHC 7.0.4 (I've found the
> same behavior on Windows).
>
> Its obvious I'm missing something. Could someone help me?
>
> Thanks.
>
> Luca.
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20110829/2c7c965f/attachment-0001.htm>

------------------------------

Message: 4
Date: Mon, 29 Aug 2011 08:41:35 +0200
From: Luca Ciciriello <luca_cicirie...@hotmail.com>
Subject: Re: [Haskell-beginners] Strange behavior
To: Alba Marchisio <alba.marchi...@gmail.com>
Cc: beginners@haskell.org
Message-ID: <blu0-smtp14990e18272c8c4a17f66fc9a...@phx.gbl>
Content-Type: text/plain; charset="iso-8859-1"

Hi Alba.
Since I've got no answer to my question I think that my strange behavior  is a 
very deep problem. 
I let you know when I have news.

Bye.

Luca.

On Aug 29, 2011, at 8:35 AM, Alba Marchisio wrote:

> Yes, I'm interested too in this problem.
> Is any body able to answer to the Luca's question? 
> 
> Alba
> 
> 2011/8/25 Luca Ciciriello <luca_cicirie...@hotmail.com>
> I found a strange behavior in my code
> 
> Here a (very) simplified version of my code:
> 
> {-# LANGUAGE PArr #-}
> {-# OPTIONS -fdph-seq #-}
> 
> module Main where
> 
> import Control.Parallel
> import GHC.PArr
> 
> parArr :: [:String:]
> parArr = [: "1", "2", "3", "4" :]
> 
> isElement :: String -> Bool
> isElement x = x `elemP` parArr
> 
> main :: IO ()
> main = do
>          putStrLn $ (show . isElement) "5"
> 
> The aspected result is "False" ("5" isn't a member of parArr), but the result 
> I get is "True".
> 
> I've compiled this code with the command:
> ghc --make -Odph -threaded Test.hs -rtsopts -o test
> 
> and launched with:
> test +RTS -N2
> 
> My system is MacOS X 10.7.1 with Xcode 4.1 and GHC 7.0.4 (I've found the same 
> behavior on Windows).
> 
> Its obvious I'm missing something. Could someone help me?
> 
> Thanks.
> 
> Luca.
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20110829/7c883779/attachment-0001.htm>

------------------------------

Message: 5
Date: Mon, 29 Aug 2011 11:14:40 +0200
From: Daniel Fischer <daniel.is.fisc...@googlemail.com>
Subject: Re: [Haskell-beginners] Strange behavior
To: beginners@haskell.org
Message-ID: <201108291114.40476.daniel.is.fisc...@googlemail.com>
Content-Type: Text/Plain;  charset="utf-8"

On Monday 29 August 2011, 08:41:35, Luca Ciciriello wrote:
> Hi Alba.
> Since I've got no answer to my question I think that my strange behavior
>  is a very deep problem.

Well, perhaps it's not very deep, just not enough people on this list are 
familiar with dph.
In such cases, ask on haskell-cafe or #haskell to reach a wider audience.

Anyway, I'm pretty sure it's a bug in dph. If you change your code to avoid 
elemP:


isElement :: String -> Bool
isElement x = x `elemP1` parArr
  where
    elemP1 :: Eq a => a -> [:a:] -> Bool
    elemP1 v ar = lengthP (filterP (== v) ar) /= 0

you get the expected result(s) [but not with HEAD].

I've opened a ticket: http://hackage.haskell.org/trac/ghc/ticket/5438

>  I let you know when I have news.
> 
> Bye.
> 
> Luca.

Cheers,
Daniel



------------------------------

Message: 6
Date: Mon, 29 Aug 2011 11:57:05 +0200
From: Luca Ciciriello <luca_cicirie...@hotmail.com>
Subject: Re: [Haskell-beginners] Strange behavior
To: Daniel Fischer <daniel.is.fisc...@googlemail.com>
Cc: beginners@haskell.org
Message-ID: <blu0-smtp170808b1f977dd4e66cef4a9a...@phx.gbl>
Content-Type: text/plain; charset="us-ascii"

Ok, Thanks.
This works fine. I found out that also mapP and sumP are working as expected, 
but elemP and foldP do not behave correctly.

Luca.

On Aug 29, 2011, at 11:14 AM, Daniel Fischer wrote:

> On Monday 29 August 2011, 08:41:35, Luca Ciciriello wrote:
>> Hi Alba.
>> Since I've got no answer to my question I think that my strange behavior
>> is a very deep problem.
> 
> Well, perhaps it's not very deep, just not enough people on this list are 
> familiar with dph.
> In such cases, ask on haskell-cafe or #haskell to reach a wider audience.
> 
> Anyway, I'm pretty sure it's a bug in dph. If you change your code to avoid 
> elemP:
> 
> 
> isElement :: String -> Bool
> isElement x = x `elemP1` parArr
>  where
>    elemP1 :: Eq a => a -> [:a:] -> Bool
>    elemP1 v ar = lengthP (filterP (== v) ar) /= 0
> 
> you get the expected result(s) [but not with HEAD].
> 
> I've opened a ticket: http://hackage.haskell.org/trac/ghc/ticket/5438
> 
>> I let you know when I have news.
>> 
>> Bye.
>> 
>> Luca.
> 
> Cheers,
> Daniel
> 




------------------------------

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 38, Issue 46
*****************************************

Reply via email to