Send Beginners mailing list submissions to
[email protected]
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
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Strange behavior (Luca Ciciriello)
----------------------------------------------------------------------
Message: 1
Date: Thu, 25 Aug 2011 19:06:08 +0200
From: Luca Ciciriello <[email protected]>
Subject: [Haskell-beginners] Strange behavior
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"
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
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 38, Issue 44
*****************************************