Re: [Haskell-cafe] Compilers

2008-11-27 Thread Brandon S. Allbery KF8NH

On 2008 Nov 26, at 16:58, Matthias Kilian wrote:

On Wed, Nov 26, 2008 at 09:35:01PM +, Andrew Coppin wrote:

It is a fork of the JHC compiler, which should be easier to look up.
There is also Hugs, as you mentioned. In addition, you may want to
look at YHC and NHC.


Yeah, the implementations page on the Wiki basically says that  
there's
GHC and Hugs, and there's also these things called YHC, NHC and  
JHC. All

the documentation I've read makes these latter compilers sound highly
experimental and unusable.


I would't call nhc experimental; it's quite usable, at least for
standard Haskell-98 stuff (plus some language extensions).



On a related topic:  whatever happened to the compiler shootout?   
(Aside from dons leaving unsw)


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Compilers

2008-11-27 Thread Don Stewart
allbery:
 On 2008 Nov 26, at 16:58, Matthias Kilian wrote:
 On Wed, Nov 26, 2008 at 09:35:01PM +, Andrew Coppin wrote:
 It is a fork of the JHC compiler, which should be easier to look up.
 There is also Hugs, as you mentioned. In addition, you may want to
 look at YHC and NHC.
 
 Yeah, the implementations page on the Wiki basically says that  
 there's
 GHC and Hugs, and there's also these things called YHC, NHC and  
 JHC. All
 the documentation I've read makes these latter compilers sound highly
 experimental and unusable.
 
 I would't call nhc experimental; it's quite usable, at least for
 standard Haskell-98 stuff (plus some language extensions).
 
 
 On a related topic:  whatever happened to the compiler shootout?   
 (Aside from dons leaving unsw)

Malcolm continues the tradition,

http://code.haskell.org/nobench/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] workarounds for Codec.Compression.Zlib errors in darcs

2008-11-27 Thread Ketil Malde
Jason Dagit [EMAIL PROTECTED] writes:

 That is, if you use the optional specification of a header file for each
 foreign import, and if your Haskell compiler can compile via C, then any
 checking that types match between Haskell and C can be performed
 automatically, by the backend C compiler.

 Would this method work with return types since C compilers tend to let you
 ignore those?  In this example that brought up this discussion it was in fact
 an ignored return value that caused the problem.

I've tried to look at GCC's warning options, but couldn't make it
emit a warning on an ignored result.  (Doesn't mean it isn't in there,
of course)

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Windows vs. Linux x64

2008-11-27 Thread Ketil Malde
Bartosz Wójcik [EMAIL PROTECTED] writes:

 Win32 Core2Duo 1.8GHz 1GB RAM 
17 Mb total memory in use
MUT   time   56.97s  ( 57.02s elapsed)
%GC time   0.5%

 Win32 Core2Duo 2.2GHz 2GB RAM
   17 Mb total memory in use
   MUT   time   57.44s  ( 57.53s elapsed)
   %GC time   0.7%  (0.8% elapsed)

So, despite the CPU being 25% faster, it's exactly as fast.  Memory
bound?

 Win32 P4 2.8GHz 1GB RAM
17 Mb total memory in use
MUT   time  171.64s  (175.78s elapsed)
%GC time   1.7%  (1.5% elapsed)

You're doing divisions, and I seem to remember division being an
operation that wreaked havoc with the P4's ALU or trace cache, or
something like that.

 Linux64 Core2Duo 2.2GHz 2GB RAM
41 MB total memory in use (1 MB lost due to fragmentation)
MUT   time   68.26s  ( 68.92s elapsed)
%GC time   0.9%  (1.1% elapsed)

 Linux32 Core2Duo 2.3GHz 4GB RAM
17 Mb total memory in use
    MUT   time   51.77s  ( 51.83s elapsed)
    %GC time       0.5%  (0.6% elapsed)

Interesting that Linux32 is actually faster than Win32. Different
cache sizes?

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Need machine for DPH benchmarking

2008-11-27 Thread Dominic Steinitz
 we, the DPH team, are at the moment in the very unfortunate situation  
 of not having a proper machine for running our benchmarks on. Could a  
 kind soul maybe give us (i.e., me) access to a quadcore or 2xquadcore  
 x86 Linux or OS X machine? I only need to build ghc on it and run  
 small benchmarks which never take more than a couple of minutes, maybe  
 once every couple of days or so. We do need to use all cores, though,  
 so no other CPU-intensive processes can be running during  
 benchmarking. This is only for a week or two, until we get our own  
 machine. We would be eternally grateful and won't forget you when DPH  
 takes over the world.
 
 Roman
 

Roman,

Graeme can set you up on an 8 core machine if you email him.

Dominic.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] workarounds for Codec.Compression.Zlib errors in darcs

2008-11-27 Thread Duncan Coutts
On Wed, 2008-11-26 at 23:16 +, Malcolm Wallace wrote:
  ... to work out the C types and then map them to Haskell ones, to
  check they're the same as the declared types in the .hs files.
 
 I'd like to point out that the FFI specification already has such a  
 mechanism.
 That is, if you use the optional specification of a header file for  
 each foreign import, and if your Haskell compiler can compile via C,  
 then any checking that types match between Haskell and C can be  
 performed automatically, by the backend C compiler.

Yes, it would have caught a similar problem in an argument position, but
not in the result.

 [ OK, so that is not the whole story, and there are good reasons why  
 it might not always work out, but I still think it was an important  
 principle in the original FFI design. ]

And covering those holes requires a tool that can grok C.

Duncan

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Philip Wadler video on Howard-Curry Correspondence ???

2008-11-27 Thread Benjamin L . Russell
Incidentally, Haskell is mentioned several times in the Dr. Dobbs
Journal article on the Wadler paper:

Dr. Dobb's | Old ideas form the basis of advancements in functional
programming | 12 1, 2000
http://www.ddj.com/showArticle.jhtml?articleID=184404384

Specifically:

Languages that took more direct inspiration from lambda calculus include:

...

Haskell, named for Haskell Curry (Hudak, Peyton Jones, Wadler, and others, 
1987; see http://haskell.org/). 

and

Standard ML is noted for its exploration of module types, Haskell for its type 
classes, and O'Caml for its object-oriented types. Standard ML, Haskell, and 
O'Caml are all continuing development, and innovation in their type systems is 
one of the principal directions of research.

and

Applications built on top of functional languages, and which themselves use 
type systems in innovative ways, include:  ... Lolita, a natural language 
understanding system (implemented in Haskell) ...

and

... Yarrow in Haskell (http://www.cs.kun.nl/~janz/ yarrow/) ...

The article discusses the impact of logic on functional programming,
citing examples including those involving Haskell, and mentions a
correspondence between types and proofs.

-- Benjamin L. Russell

On Thu, 27 Nov 2008 20:33:37 +0900, Benjamin L.Russell
[EMAIL PROTECTED] wrote:

On Wed, 26 Nov 2008 23:48:19 -0600, Galchin, Vasili
[EMAIL PROTECTED] wrote:

Hello,

I am reading re-reading Prof. Wadler paper Proofs are Programs: 19th
Century Logic and 21st Century Computing
but also want to re-read watch his video on same subject.

???

There is a reference to the video in question at the following site,
but the link seems to be broken:

Proofs are Programs: 19th Century Logic and 21st Century Computing |
Lambda the Ultimate
http://lambda-the-ultimate.org/node/1447

The same link is also mentioned at the following site as well:

Wadler: History of logic and programming languages
http://homepages.inf.ed.ac.uk/wadler/topics/history.html

The (broken) link mentioned at the above two sites is the following:

TechNetCast Archives
http://technetcast.ddj.com/tnc_catalog.html?item_id=1011

However, attempting to visit the above-mentioned site results in the
following error message:

 Query Failed1

Since the same URL is mentioned at both sites, this error is unlikely
to be the result of a typo.

Perhaps either the item was removed, or the hosting server is down?
You may wish to try reaching the contact person for the site hosting
the video, Dr. Dobb's TechNetCast (see http://technetcast.ddj.com/),
at [EMAIL PROTECTED]

-- Benjamin L. Russell

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Problem getting code from AFP08 parallel tutorial to run in parallel

2008-11-27 Thread Olivier Boudry
On Tue, Nov 25, 2008 at 11:07 PM, Don Stewart [EMAIL PROTECTED] wrote:
 What does the code look like?

It looks like that. Of course it doesn't compute the same number as
the initial code, but it starts 3 sparks and I get the expected 100%
CPU usage instead of 50%.

parSumFibEuler :: Int - Int - Int - Int
parSumFibEuler a b c
  = f `par` (e `par` (g `pseq` (f + e + g)))
where
  f = fib a
  e = sumEuler b
  g = sumEuler c

r1 :: Int
r1 = parSumFibEuler 40 7450 7449

Instead of:

parSumFibEuler :: Int - Int - Int
parSumFibEuler a b
  = f `par` (e `pseq` (f + e))
where
  f = fib a
  e = sumEuler b

r1 :: Int
r1 = parSumFibEuler 40 7450

Olivier.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Philip Wadler video on Howard-Curry Correspondence ???

2008-11-27 Thread Josef Svenningsson
2008/11/27 Galchin, Vasili [EMAIL PROTECTED]:
 Hello,

 I am reading re-reading Prof. Wadler paper

 Proofs are Programs: 19th Century Logic and 21st Century Computing

 but also want to re-read watch his video on same subject.

Is it this talk you're after?
http://video.google.com/videoplay?docid=-4167170843018186532ei=sI0uSZT7Faf22gKd9NTqDQq=wadler+philip

Cheers,

Josef
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Compilers

2008-11-27 Thread Adrian Neumann


Am 27.11.2008 um 09:23 schrieb Don Stewart:


allbery:

On 2008 Nov 26, at 16:58, Matthias Kilian wrote:

On Wed, Nov 26, 2008 at 09:35:01PM +, Andrew Coppin wrote:
It is a fork of the JHC compiler, which should be easier to  
look up.

There is also Hugs, as you mentioned. In addition, you may want to
look at YHC and NHC.


Yeah, the implementations page on the Wiki basically says that
there's
GHC and Hugs, and there's also these things called YHC, NHC and
JHC. All
the documentation I've read makes these latter compilers sound  
highly

experimental and unusable.


I would't call nhc experimental; it's quite usable, at least for
standard Haskell-98 stuff (plus some language extensions).



On a related topic:  whatever happened to the compiler shootout?
(Aside from dons leaving unsw)


Malcolm continues the tradition,

http://code.haskell.org/nobench/


All result links are broken.



PGP.sig
Description: Signierter Teil der Nachricht
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] haddock question

2008-11-27 Thread allan
Dear all

I'm trying to locally build the documentation for the haskell-src-exts package 
and running into a bit of bother.
If I run: cabal haddock
I get the error:
haddock: parse error in doc string

so: cabal haddock -v
Doesn't really provide any extra information, it gives me the exact haddock 
command-line used but there is still no way (I can see) of obtaining the source 
file containing the parse error.

So I downloaded via darcs the latest haddock source code and installed that but 
I get the exact same error message.
I tried grepping in the haddock source code for that particular error message 
(and portions of it) but I couldn't find it.

Finally I tried running haddock on a single source file:
haddock Language/Haskell/Exts.hs 
and even this gets the exact same error message, which is somewhat bizarre 
since that file does not contain any documentation strings.

Anyone have any ideas?

regards
allan

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


pbkdf2 on hackage Re: Re[2]: [Haskell-cafe] Password hashing

2008-11-27 Thread Thomas Hartman
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/PBKDF2

Since no one took up my code review request I just did the best I
could and uploaded to hackage. There were indeed some mistakes in my
initial post, fixed now. (Code review is still wished, though!)

Alas, documentation doesn't build with hackage, altough it does for me
locally. (Seems like almost everything I do these days -- what am I
doing wrong?!)

Also I'm open to folding this into a more established crypto package
if there are any takers... psst, dominic.

Also, dominic, shouldn't your crypto package be added to category
Cryptography (a cabal file change) so it lists aside the other crypto
packages?

thanks, thomas.
2008/11/26 Thomas Hartman [EMAIL PROTECTED]:
 Sorry about the hideous formatting above. Reattached as a text file.

 t.

 2008/11/26 Thomas Hartman [EMAIL PROTECTED]:
 OK, I went ahead and implemented pbkdf2, following the algorithm
 linked to by bulat and Michael.

 If there are any crypto gurus who can code-review this I would be much
 obliged, and when I'm confident enough that this does the right thing
 I'll put it up on hackage.

 I don't do much crypto so this *definitely* needs a review before it
 becomes a library?

 How's this looks, cafe?

 Thanks!

 Thomas.


 {-# LANGUAGE ScopedTypeVariables #-}
 module Crypto.PBKDF2 (pbkdf2, pbkdf2') where

 import qualified Data.ByteString.Char8 as B
 import qualified Data.ByteString.Lazy as L
 import GHC.Word
 import Control.Monad (foldM)
 import Random
 import Data.Digest.SHA512 (hash)
 import Data.Word
 import Data.Bits
 import Data.Binary

 newtype Password = Password [Word8]
 newtype Salt = Salt [Word8]
 newtype HashedPass = HashedPass [Word8]
  deriving Show
 {- | A reasonable default for rsa pbkdf2? Actually I'm not really
 sure, ask folk with more experience.

 pbkdf2 = pbkdf2' prfSHA512 512 512 512
 -}
 t = pbkdf2 ( Password . toWord8s $ meh ) ( Salt . toWord8s $ moo )
 pbkdf2 :: Password - Salt - HashedPass
 pbkdf2 = pbkdf2' prfSHA512 512 512 512

 {- | Password Based Key Derivation Function, from RSA labs.

 pbkdf2' prf hlen cIters dklen (Password pass) (Salt salt)
 -}
 pbkdf2' :: ([Word8] - [Word8] - [Word8]) - Integer - Integer -
 Integer - Password - Salt - HashedPass
 pbkdf2' prf hlen cIters dklen (Password pass) (Salt salt)
  | dklen  ( (2^32-1) * hlen) = error $ pbkdf2, (dklen,hlen) :  ++
 (show (dklen,hlen))
  | otherwise =
let --l,r :: Int
l = ceiling $ (fromIntegral dklen) / (fromIntegral hlen )
r = dklen - ( (l-1) * hlen)
ustream :: [Word8] - [Word8] - [[Word8]]
ustream p s = let x = prf p s
  in  x : ustream p x
--us :: Integer - [[Word8]]
us i = take (fromIntegral cIters) $ ustream pass ( salt `myor`
 ((intToFourWord8s i) ))
--f :: [Word8] - [Word8] - Integer - Integer - [Word8]
f pass salt cIters i = foldr1 myxor $ us i
ts :: [[Word8]]
ts = map (f pass salt cIters) ( [1..l] )
in HashedPass . take (fromIntegral dklen) . concat $ ts

 -- The spec says
 -- Here, INT (i) is a four-octet encoding of the integer i, most
 significant octet first.
 -- I'm reading from the right... is this the right thing?
 toWord8s x = L.unpack . encode $ x

 --intToFourWord8s :: Integer - [Word8]
 intToFourWord8s i = let w8s =  toWord8s $ i
in drop (length w8s -4) w8s

 myxor :: [Word8] - [Word8] - [Word8]
 myxor = zipWith xor

 myor :: [Word8] - [Word8] - [Word8]
 myor = zipWith (.|.)

 prfSHA512 :: [Word8] - [Word8] - [Word8]
 prfSHA512 x y = hash $ x ++ y


 2008/11/26 John Meacham [EMAIL PROTECTED]:
 What you are using there is not a salt, but rather a secret key. The
 important thing about a salt is that it is different for _every user_.
 and you actually store the salt unhashed along with the hash. (it is not
 secret information). A salt protects against a dictionary attack, for
 instance, you might have a dictionary of hash's and the common passwords
 they go to but if you add a 32 bit salt, you would need 2^32 entries for
 each dictionary word, making such an attack unworkable. You can also
 trivially tell if two users have the _same_ password just by comparing
 the hashes without a salt.

John

 --
 John Meacham - ⑆repetae.net⑆john⑈
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] haddock question [solved]

2008-11-27 Thread allan
Ross Paterson wrote:
 On Thu, Nov 27, 2008 at 11:52:04AM +, allan wrote:
 I'm trying to locally build the documentation for the haskell-src-exts 
 package and running into a bit of bother.
 If I run: cabal haddock
 I get the error:
 haddock: parse error in doc string
 
 The problem is that several of the modules (not Language.Haskell.Exts,
 but modules it imports) have headers containing a field Original
 that haddock doesn't recognize.
 

a ha, Thank you, that has fixed the problem.

regards
allan



-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] HaskellWiki image upload fails because of - probably - the filesize.

2008-11-27 Thread And1
Hey dear Haskell-Cafe-Readers,

I tried several times to upload several images - screenshots that is - to
my HaskellWiki/Xmonad site:

http://haskell.org/haskellwiki/Image:And1_xmonad.png

I always get the error, that the connection to the site/server was
reset.

I mailed both administrators of the HaskellWiki but I got, for about 2-4
weeks now, no reply.

I tried to upload the following images, maybe that's important:

http://and1.donnergurgler.net/misc/screen_2008-09-26.png
http://and1.donnergurgler.net/misc/screen_2008-11-02.png
http://and1.donnergurgler.net/misc/screen_2008-11-10.png

I was told, that the problem is maybe the filesize of the new images,
because it is bigger, then the filesize of the image already uploaded.

Thanks for reading this and hopefully finding the problem,

-- 
Regards, Andi R.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] haddock question

2008-11-27 Thread Ross Paterson
On Thu, Nov 27, 2008 at 11:52:04AM +, allan wrote:
 I'm trying to locally build the documentation for the haskell-src-exts 
 package and running into a bit of bother.
 If I run: cabal haddock
 I get the error:
 haddock: parse error in doc string

The problem is that several of the modules (not Language.Haskell.Exts,
but modules it imports) have headers containing a field Original
that haddock doesn't recognize.

Of course the lack of any location information in the error message
is a deficiency in haddock.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Need machine for DPH benchmarking

2008-11-27 Thread Daniel Yokomizo
On Thu, Nov 27, 2008 at 5:45 AM, Roman Leshchinskiy [EMAIL PROTECTED] wrote:
 Hi all,

 we, the DPH team, are at the moment in the very unfortunate situation of not
 having a proper machine for running our benchmarks on. Could a kind soul
 maybe give us (i.e., me) access to a quadcore or 2xquadcore x86 Linux or OS
 X machine? I only need to build ghc on it and run small benchmarks which
 never take more than a couple of minutes, maybe once every couple of days or
 so. We do need to use all cores, though, so no other CPU-intensive processes
 can be running during benchmarking. This is only for a week or two, until we
 get our own machine. We would be eternally grateful and won't forget you
 when DPH takes over the world.

Another possibility is using the Amazon EC2 functionality and rent a
high-CPU instance (http://aws.amazon.com/ec2/#instance) for as long as
you need. An extra large high-CPU instance costs $0.80 per hour
(http://aws.amazon.com/ec2/#pricing), is an 8-core machine, you only
pay for the time used and it runs any kind of Linux you want (there
are dozens of already configured instances with different
configurations, it's also possible to configure your own). I've been
using it for a few months and have no complaints.

 Roman

Best regards,
Daniel Yokomizo
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


RE: [Haskell-cafe] Proposal for associated type synonyms in Template Haskell

2008-11-27 Thread Simon Peyton-Jones
I've been away.  I hope others will reply to this thread too; whatever you 
decide will end up in TH indefinitely.  I know that Roman is interested in this.


· You focus just on type families in class declarations (which is 
indeed where associated types started).  But I suggest you also allow them at 
top level, as GHC does using the syntax

type family T a :: *

Indeed, since you propose to add to Dec, that'll happen automatically.  But 
perhaps AssocTySynKindD is not a good name. Perhaps TySynFamilyD?



· GHC uses

type instance T [a] = Tree a
as the way to add an equation to the definition of T.  So perhaps 
TySynInstance rather than AssocTySynD?



· I agree that it'd be good to do data type/newtype families at the 
same time.  Roman needs this.


· Your proposal for kinds looks fine.


Simon

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of José Pedro 
Magalhães
Sent: 11 November 2008 11:11
To: Haskell Cafe
Subject: Re: [Haskell-cafe] Proposal for associated type synonyms in Template 
Haskell

Hello Thomas,

I see this is a proposal for a partial implementation of #1673 
(http://hackage.haskell.org/trac/ghc/ticket/1673). Maybe it would be good if 
the remaining syntax (associated datatypes and type families) would also be 
defined and implemented in TH. Or maybe there isn't much demand for this?...


Cheers,
Pedro
On Wed, Nov 5, 2008 at 15:57, Thomas van Noort [EMAIL PROTECTED]mailto:[EMAIL 
PROTECTED] wrote:
Hello,

Recently, we released a library on Hackage for generic rewriting (package 
rewriting if you are curious). The user of the library is expected to define 
type class instances to enable rewriting on his or her own datatypes. As these 
instances follow the datatype declarations closely, we tried to generate the 
instances using Template Haskell. Unfortunately, associated type synonyms are 
not yet supported by TH.

After a presentation at the WGP'08, Simon encouraged us to write a proposal 
about adding associated type synonyms to TH, so that it can be added to GHC. 
So, here is our proposal.

The TH AST must allow 1) kind declarations of associated type synonyms
in class declarations and 2) their definitions in instance declarations. For 
example,

class Foo a where
 type Bar a :: *

instance Foo Int where
 type Bar Int = String

The TH library defines a datatype Dec which contains a constructor for class 
declarations and instance declarations:

data Dec
= ...
| ClassD Cxt Name [Name] [FunDep] [Dec]
| InstanceD Cxt Type [Dec]
 ...

1) Associated type synonym kind declarations

We suggest to add a constructor to the Dec type:

 ...
| AssocTySynKindD Name [Name] (Maybe Kind)
 ...

assocTySynKindD :: Name - [Name] - Maybe KindQ - DecQ

The first field is the name of the associated type synonym, the second field is 
a list of type variables, and the third field is an optional kind. Since kinds 
are not yet defined in TH, we have to add some kind of kind definition (pun 
intended):

data Kind
= StarK
| ArrowK Kind Kind

type KindQ = Q Kind
starK :: KindQ
arrowK :: KindQ - KindQ - KindQ

We explicitly choose not to reuse the Type type to define kinds (i.e., type 
Kind = Type as in GHC) since we think a separation between the two worlds is 
much clearer to the users of TH.

2) Associated type synonym definitions

We suggest to add another constructor to the Dec type:

 ...
| AssocTySynD Name [Type] Type
 ...

assocTySynD :: Name - [TypeQ] - TypeQ - DecQ

The first field is the name of the type synonym, the second field is a list of 
type arguments, and the third field is the body of the type synonym.

We would like to hear your comments to this proposal.

Regards,
Thomas
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.orgmailto:Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: catting to cat gets stuck at 135K

2008-11-27 Thread Simon Marlow

Brandon S. Allbery KF8NH wrote:


On 2008 Nov 10, at 19:04, Jason Dusek wrote:


simple exe bytes args=  do
 (i, o, e, p)-  runInteractiveProcess exe args Nothing
Nothing
 hPut i bytes
 s   -  hGetContents o
 hClose i
 return s


Yep, that's your problem.  forkIO the hPut.


 Maybe I didn't do enough here -- just wrapping in `forkIO`
 does not seem to actually help.



*sigh* I hate the ghc runtime... it works in ghci, or compiled with 
-threaded.


Would you hate it less if -threaded were the default?

Otherwise you still get the deadlock because it only 
switches threads under limited circumstances (garbage collections?) 


No, the issue is that without real OS threads, a foreign call can't be 
pre-empted (pretty obvious when you think about it).  waitForProcess ends 
up making a blocking foreign call - non-obvious, but at least it's documented.


Cheers,
Simon

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: [darcs-users] workarounds for Codec.Compression.Zlib errors in darcs

2008-11-27 Thread Eric Kow
On Wed, Nov 26, 2008 at 14:38:33 +, Eric Kow wrote:
 In principle, the same advice applies for Windows users, with more
 details hopefully to follow on how the C libz in a GHC-accesible
 location.  Details to follow.

As promised, here are the details for installing darcs using our
old internal binding to libz on Windows.  Again, the instructions
are either to

  cabal configure -f -external-zlib

(Or to wait for darcs 2.1.2.3 to appear on hackage)

Thanks to Salvatore Insalaco, our Windows Czar!

--

There're two zlib versions for Windows: one compiled with ccall
convention, and one with stdcall convention. We need the ccall one, at
the address:
http://gnuwin32.sourceforge.net/packages/zlib.htm

The other one will *appear* to work, but darcs will segfault as soon
as the first call to zlib is made.

This is the step-by-step howto:
1) Download the binary from
http://gnuwin32.sourceforge.net/downlinks/zlib-bin-zip.php and unzip
it.
2) Copy the zlib1.dll file in bin directory in ghc's gcc-lib
directory, and then rename it libz.dll.
3a) Copy the zlib1.dll file in c:\windows directory, WITHOUT renaming it.
OR
3b) If you don't want to pollute your windows directory, just copy it
in whatever directory is in the search PATH, or in the one you'll
place darcs.exe binary.

That's all. The cabal install will then just work.
By the way: that's similar to the how-to for making curl work. Maybe
we can update the windows building instructions providing a
pre-install instructions to make cabal install darcs just work.

-- 
Eric Kow http://www.nltg.brighton.ac.uk/home/Eric.Kow
PGP Key ID: 08AC04F9


signature.asc
Description: Digital signature
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Philip Wadler video on Howard-Curry Correspondence ???

2008-11-27 Thread Benjamin L . Russell
On Wed, 26 Nov 2008 23:48:19 -0600, Galchin, Vasili
[EMAIL PROTECTED] wrote:

Hello,

I am reading re-reading Prof. Wadler paper Proofs are Programs: 19th
Century Logic and 21st Century Computing
but also want to re-read watch his video on same subject.

???

There is a reference to the video in question at the following site,
but the link seems to be broken:

Proofs are Programs: 19th Century Logic and 21st Century Computing |
Lambda the Ultimate
http://lambda-the-ultimate.org/node/1447

The same link is also mentioned at the following site as well:

Wadler: History of logic and programming languages
http://homepages.inf.ed.ac.uk/wadler/topics/history.html

The (broken) link mentioned at the above two sites is the following:

TechNetCast Archives
http://technetcast.ddj.com/tnc_catalog.html?item_id=1011

However, attempting to visit the above-mentioned site results in the
following error message:

 Query Failed1

Since the same URL is mentioned at both sites, this error is unlikely
to be the result of a typo.

Perhaps either the item was removed, or the hosting server is down?
You may wish to try reaching the contact person for the site hosting
the video, Dr. Dobb's TechNetCast (see http://technetcast.ddj.com/),
at [EMAIL PROTECTED]

-- Benjamin L. Russell

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Fun with type functions

2008-11-27 Thread Magnus Therning
On Thu, Nov 27, 2008 at 9:29 AM, Simon Peyton-Jones
[EMAIL PROTECTED] wrote:
 Friends

 GHC has embodied data type families since 6.8, and now type synonym families 
 (aka type functions) in 6.10.  However, apart from our initial papers there 
 isn't much published material about how to *use* type families.  But that 
 hasn't stopped you: quite a few people are using them already, and of course 
 there is a rich seam of work on using functional dependencies to express 
 type-level computation.

 Ken Shan and Oleg Kiselyov and I are collaborating to write a paper for an 
 upcoming workshop, under the general rubric of Fun with type functions (in 
 homage to Thomas Hallgren's paper Fun with functional dependencies and Ralf 
 Hinze's paper Fun with phantom types).

 So this message is to ask you:

can you tell us about the most persuasive, fun application
you've encountered, for type families or functional dependencies?

 Simple is good.  It doesn't have to be elaborate: just something that does 
 something useful you could not have done otherwise.  Pointers to email 
 threads are fine.  Don't assume we already know about them (even if we 
 participated in the thread :-)  Part of what we're interested in is that 
 *you* found the example compelling.

 Many thanks

I documented, [1] and [2], my first encounter with functional
dependencies.  Maybe not a persuasive example, but I felt it was a
fairly good introduction to them.

/M

[1]: http://therning.org/magnus/archives/354
[2]: http://therning.org/magnus/archives/355

-- 
Magnus Therning(OpenPGP: 0xAB4DFBA4)
magnus@therning.org  Jabber: magnus@therning.org
http://therning.org/magnus identi.ca|twitter: magthe
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Go Haskell!

2008-11-27 Thread Simon Marlow

Claus Reinke wrote:

Do you have an example of a mutable state/ IO bound application, like,
hmm, a window manager or a revision control system or a file system...?


If you're looking for a challenge, how about this one (there used to
be lots of Haskellers into this game, any of you still around?-):

http://computer-go.org/pipermail/computer-go/2008-October/016680.html


[ catching up with old haskell-cafe email ]

Interestingly, I did this a while ago.  Here's my results:

$ ./Bench 1 10
b: 14840, w: 17143 mercy: 67982
elapsed time: 3.42s
playouts/sec: 29208


so, nearly 30k/sec random playouts on 9x9.  That's using a hack that stops 
the game when the score is heavily in favour of one player, it drops to 
around 20k/sec with that turned off.


Not bad, but probably I'd guess an order of magnitude worse than you can do 
in tightly-coded C.  The Haskell implementation isn't nice, as you 
predicted.  Also the code is derived from some non-free internal MS code, 
so unfortunately I can't share it (but I could perhaps extract the free 
bits if anyone is really interested).


W wins slightly more often I think because komi 5.5 on a 9x9 board is a tad 
high.


It does parallelise too, of course:

$ ./Bench 8 10 +RTS -N8
b: 14872, w: 17488 mercy: 67584
elapsed time: 1.00s
playouts/sec: 99908

though still room for improvement there.

Cheers,
Simon
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re[2]: [Haskell-cafe] Need machine for DPH benchmarking

2008-11-27 Thread Bulat Ziganshin
Hello Daniel,

Thursday, November 27, 2008, 4:43:08 PM, you wrote:

 Another possibility is using the Amazon EC2 functionality and rent a
 high-CPU instance (http://aws.amazon.com/ec2/#instance) for as long as

these are virtual cores, which isn't appropriate for measuring
performance on real 4/8 core boxes


-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Possible issue with Hoogle and Haddock?

2008-11-27 Thread Neil Mitchell
Hi Stephen,

I've now worked around this bug in Hoogle - I'm just about to rebuild
the website, and hopefully the bug will have disappeared. (Rebuilding
the website could take a few days, as I'm currently hunting for the
right compiler etc...)

Thanks

Neil

On Fri, Nov 21, 2008 at 8:21 AM, Mitchell, Neil
[EMAIL PROTECTED] wrote:

  I was noticing recently that there seems to be a problem
 with Hoogle
  and Haddock.  In particular, I just hoogled bracket and got the
  following result:
  bracket :: IO a - a - IO b - a - IO c - IO c
 Clearly this is the
  wrong type, as it should be
  bracket :: IO a - (a - IO b) - (a - IO c) - IO c
 
  Is this a bug?  Is is something that's well-known?

 Yes, it's a known bug:
 http://hackage.haskell.org/trac/ghc/ticket/2584

 I can make a work around for Hoogle (well, I can write a workaround in
 the Hoogle specific code of Haddock), but was hoping that the bug would
 be fixed before 6.10. I guess its now worth making the Hoogle specific
 fix.

 Thanks

 Neil

 ==
 Please access the attached hyperlink for an important electronic 
 communications disclaimer:

 http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
 ==


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: Re[2]: [Haskell-cafe] Need machine for DPH benchmarking

2008-11-27 Thread Daniel Yokomizo
On Thu, Nov 27, 2008 at 12:25 PM, Bulat Ziganshin
[EMAIL PROTECTED] wrote:
 Hello Daniel,

 Thursday, November 27, 2008, 4:43:08 PM, you wrote:

 Another possibility is using the Amazon EC2 functionality and rent a
 high-CPU instance (http://aws.amazon.com/ec2/#instance) for as long as

 these are virtual cores, which isn't appropriate for measuring
 performance on real 4/8 core boxes

That's why I mentioned it as another possibility. It won't give you
performance numbers for a specific processor but you can run tests to
see parallelization behavior and get some food for thought. It's a
pretty cheap way to explore ideas if you don't have a equivalent
machine available.

 --
 Best regards,
  Bulatmailto:[EMAIL PROTECTED]

Best regards,
Daniel Yokomizo
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Go Haskell!

2008-11-27 Thread Claus Reinke

Do you have an example of a mutable state/ IO bound application, like,
hmm, a window manager or a revision control system or a file system...?

If you're looking for a challenge, how about this one (there used to
be lots of Haskellers into this game, any of you still around?-):
http://computer-go.org/pipermail/computer-go/2008-October/016680.html

Interestingly, I did this a while ago.  Here's my results:

$ ./Bench 1 10
b: 14840, w: 17143 mercy: 67982
elapsed time: 3.42s
playouts/sec: 29208

so, nearly 30k/sec random playouts on 9x9.  That's using a hack that stops 
the game when the score is heavily in favour of one player, it drops to 
around 20k/sec with that turned off.


Nice!-) 20k playouts/sec (without  the early cutoffs) is the rough number
usually mentioned for these light playouts, reachable even in Java. My own
Haskell code for that was a factor of 5 slower:-( 

Not bad, but probably I'd guess an order of magnitude worse than you 
can do in tightly-coded C.  


Yes, a few people have reported higher rates, but most hobby coders
seem happy with 20k/sec - after that, it seems more interesting to move
towards heavy playouts and combinations with tree-based search instead
of light playouts with simple statistics alone. But if you don't get at least
those 20k/sec, it is difficult to run the number of experiments needed to 
test presumed improvements in playing strength.


The Haskell implementation isn't nice, as you predicted.  


What is really annoying for me is that I'm no longer used to this low-level
style of coding, so every time I add something, performance goes down,
and I have to work to get it back (I modified my playout code to match
that reference bot specification - my bot does get the expected 50% wins
against jrefbot, but is now a factor of 8 slower (still using only half the
memory, though)). Not to mention that I'm throwing away many of the
advantages of Haskell. That is one reason why I mentioned this challenge.

Also the code is derived from some non-free internal MS code, 
so unfortunately I can't share it (but I could perhaps extract the free 
bits if anyone is really interested).


Interesting, can you tell what kind of code those internal bits are?
Of course, the fun is implementing it oneself, but it is very useful to
have reference points, such as the refbot spec, or the Java implementation
to play against. Your Haskell reference point will spur me to have another
look at my bot's performance!-) 

The Go programming folks have a lot of useful infrastructure, btw, 
including a server just for bot-vs-bot competition: http://cgos.boardspace.net/ 
Not to mention monthly tournaments, competions, etc.



It does parallelise too, of course:

$ ./Bench 8 10 +RTS -N8
b: 14872, w: 17488 mercy: 67584
elapsed time: 1.00s
playouts/sec: 99908

though still room for improvement there.


That is the other reason why I mentioned this challenge: the specs
people use for their competition bots are interestingly parallel. One
example, this year's Computer Go Olympiad results:

http://www.grappa.univ-lille3.fr/icga/tournament.php?id=181

Many Faces of Go, winner, currently maxes out at 32 cores, a 
limitation its author would like to remove (he's working with the 
Microsoft HPC group, btw).


For the exhibition game against a pro that made the news this year, 
MoGo used a cluster of 800 cores:


http://www.mail-archive.com/[EMAIL PROTECTED]/msg08692.html
http://www.mail-archive.com/[EMAIL PROTECTED]/msg08710.html

Of course, the simple reference bot implementations are a far cry
from MoGo or ManyFaces, but I thought this would be an interesting
non-trivial-but-doable challenge for Haskell performance and parallelism
fans, especially since there are still many people interested in Go here;-)

Claus

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: catting to cat gets stuck at 135K

2008-11-27 Thread Brandon S. Allbery KF8NH

On 2008 Nov 27, at 8:51, Simon Marlow wrote:

Brandon S. Allbery KF8NH wrote:

On 2008 Nov 10, at 19:04, Jason Dusek wrote:

simple exe bytes args=  do
(i, o, e, p)-  runInteractiveProcess exe args Nothing
Nothing
hPut i bytes
s   -  hGetContents o
hClose i
return s


Yep, that's your problem.  forkIO the hPut.


Maybe I didn't do enough here -- just wrapping in `forkIO`
does not seem to actually help.
*sigh* I hate the ghc runtime... it works in ghci, or compiled with  
-threaded.


Would you hate it less if -threaded were the default?

Otherwise you still get the deadlock because it only switches  
threads under limited circumstances (garbage collections?)


No, the issue is that without real OS threads, a foreign call can't  
be pre-empted (pretty obvious when you think about it).   
waitForProcess ends up making a blocking foreign call - non-obvious,  
but at least it's documented.


The way this is usually handled in the non-threaded case is to either  
use SIGCHLD or non-blocking waitpid() so that green threads can  
continue running.  I'm a little surprised this wasn't done.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] HaskellWiki image upload fails because of - probably - the filesize.

2008-11-27 Thread Gwern Branwen
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On Thu, Nov 27, 2008 at 8:11 AM, And1  wrote:
 Hey dear Haskell-Cafe-Readers,

 I tried several times to upload several images - screenshots that is - to
 my HaskellWiki/Xmonad site:

 http://haskell.org/haskellwiki/Image:And1_xmonad.png

 I always get the error, that the connection to the site/server was
 reset.

 I mailed both administrators of the HaskellWiki but I got, for about 2-4
 weeks now, no reply.

 I tried to upload the following images, maybe that's important:

 http://and1.donnergurgler.net/misc/screen_2008-09-26.png
 http://and1.donnergurgler.net/misc/screen_2008-11-02.png
 http://and1.donnergurgler.net/misc/screen_2008-11-10.png

 I was told, that the problem is maybe the filesize of the new images,
 because it is bigger, then the filesize of the image already uploaded.

 Thanks for reading this and hopefully finding the problem,

Size would not be the issue; I've uploaded multimegabyte tarballs in
the past. I tried uploading one of your images and the connection
fails immediately, so it looks to me also like there is a problem in
the MediaWiki server.

- --
gwern
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEAREKAAYFAkku0bIACgkQvpDo5Pfl1oKSBACdF02Vmze2gi4CSJmjswxxEnmj
orIAnRLzgng1xB6/urdCT4Kkb+e5Z0TR
=tatY
-END PGP SIGNATURE-
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] workarounds for Codec.Compression.Zlib errors in darcs

2008-11-27 Thread Ian Lynagh
On Wed, Nov 26, 2008 at 10:28:21PM +, Duncan Coutts wrote:
 On Wed, 2008-11-26 at 14:38 +, Eric Kow wrote:
  
  Older versions of darcs can to produce gzipped files with broken CRCs.
  We never noticed this because our homegrown wrapper around the C libz
  library does not pick up these errors.
 
 I should note that one moral of this story is to check that your FFI
 imports are correct. That is, check they import the foreign functions at
 the right Haskell types. In this case the mistake was that the foreign
 function returned a C int, but the Haskell foreign import declaration
 stated that the C function returned IO () rather than IO CInt.

While that's true, Haskell also makes it easy to make the same sort of
error with IO (or any other Monad) values, whether created with the FFI
or not. If you say

f = do x
   y
   z

and y has type IO CInt then you won't get an error (and I don't think
you can even ask for a warning with the current implementations).

Should we have
() :: (Monad m) = m () - m a - m a
and force you to write
_ - y
?

Thanks
Ian

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] workarounds for Codec.Compression.Zlib errors in darcs

2008-11-27 Thread Luke Palmer
On Thu, Nov 27, 2008 at 10:20 AM, Ian Lynagh [EMAIL PROTECTED] wrote:
 On Wed, Nov 26, 2008 at 10:28:21PM +, Duncan Coutts wrote:
 On Wed, 2008-11-26 at 14:38 +, Eric Kow wrote:
 
  Older versions of darcs can to produce gzipped files with broken CRCs.
  We never noticed this because our homegrown wrapper around the C libz
  library does not pick up these errors.

 I should note that one moral of this story is to check that your FFI
 imports are correct. That is, check they import the foreign functions at
 the right Haskell types. In this case the mistake was that the foreign
 function returned a C int, but the Haskell foreign import declaration
 stated that the C function returned IO () rather than IO CInt.

 While that's true, Haskell also makes it easy to make the same sort of
 error with IO (or any other Monad) values, whether created with the FFI
 or not. If you say

f = do x
   y
   z

 and y has type IO CInt then you won't get an error (and I don't think
 you can even ask for a warning with the current implementations).

 Should we have
() :: (Monad m) = m () - m a - m a
 and force you to write
_ - y
 ?

I'd like that (though I certainly didn't like that prospect when I
started learning).  I think the option of turning on a warning would
be a nice happy medium.

Luke
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] followedBy parser in Parsec

2008-11-27 Thread Paul Keir
Hi,

Is there a way in Parsec to check what the next token is, and if it is what 
you're hoping for, leave it there.

This is an example of something which doesn't work at all:

testpar =  try $
   do ae - array_element
  option [] $ try $ satisfy (\c - c /= '(')  unexpected 
  return ae

I'm finding this totally confusing by now %0 Can I invert notFollowedBy 
somehow, or maybe there's a peek function I don't know about? Help!

Thanks,
Paul
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Go Haskell!

2008-11-27 Thread Claus Reinke

http://computer-go.org/pipermail/computer-go/2008-October/016680.html

Interestingly, I did this a while ago.  Here's my results:

$ ./Bench 1 10
b: 14840, w: 17143 mercy: 67982
elapsed time: 3.42s
playouts/sec: 29208

so, nearly 30k/sec random playouts on 9x9.  That's using a hack that stops 
the game when the score is heavily in favour of one player, it drops to 
around 20k/sec with that turned off.


Nice!-) 20k playouts/sec (without  the early cutoffs) is the rough number
usually mentioned for these light playouts, reachable even in Java. My own
Haskell code for that was a factor of 5 slower:-( 


actually, that 5x is relative to jrefbot on my machine (Pentium M760, 2Ghz),
which doesn't quite reach 20k/sec, so if your code would run at 20k/sec on
my laptop, it would be 10x as fast as my bot:-(( Since you can't release your
code, could you perhaps time the jrefbot from the url above on your machine 
as a reference point, so that I know how far I've yet to go? Something like:


   $ time ((echo genmove b;echo quit) | 
   d:/Java/jre6/bin/java -jar refbots/javabot/jrefgo.jar 2)

   = E5

   real0m2.539s
   user0m0.030s
   sys 0m0.031s

Btw, I just realised where my bot dropped from 5x to 8x: to work around

   http://hackage.haskell.org/trac/ghc/ticket/2669

all my array accesses were wrapped in exception handlers, to get
useful error messages while I adapted my code to the refbot spec..

That's not the only bug that got in the way: 


   http://hackage.haskell.org/trac/ghc/ticket/2727

forced me to move from functional to imperative arrays much sooner 
than I wanted, and due to 


   http://hackage.haskell.org/trac/ghc/ticket/1216

I did not even consider 2d arrays (the tuple allocations might have gotten
in the way anyhow, but still..).

What do those folks working on parallel Haskell arrays think about the
sequential Haskell array baseline performance?

Claus

-- my slow bot's current time (for 20k playouts on a 2Ghz laptop):

   $ time ((echo genmove b;echo quit) | ./SimpleGo.exe 2)
   TEXT e5 - amaf-score: 0.127
   TEXT e6 - amaf-score: 0.126
   TEXT d5 - amaf-score: 0.126
   TEXT f5 - amaf-score: 0.118
   TEXT d6 - amaf-score: 0.116
   TEXT f4 - amaf-score: 0.115
   TEXT e7 - amaf-score: 0.115
   TEXT f6 - amaf-score: 0.114
   TEXT d4 - amaf-score: 0.110
   TEXT d3 - amaf-score: 0.108
   TEXT e5 - amaf-score: 0.127
   = e5

   =

   real0m10.711s
   user0m0.030s
   sys 0m0.031s


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Building QuickCheck 2 Under GHC 6.10.1

2008-11-27 Thread Dominic Steinitz
Having been a happy user of QuickCheck 2 for many years, I now find it 
won't build under ghc 6.10.1. Before I investigate further, has anyone 
encountered this problem and has a fix?


Thanks, Dominic.


C:\Users\Dom\QuickCheckSetup build
Preprocessing library QuickCheck-2.0...
Building QuickCheck-2.0...
[2 of 9] Compiling Test.QuickCheck.Exception ( Test\QuickCheck\Exception.hs, dis
t\build\Test\QuickCheck\Exception.o )

Test\QuickCheck\Exception.hs:12:31:
Class `Exception' used as a type
In the type `Exception'
In the type `Either Exception a'
In the type `IO (Either Exception a)'

Test\QuickCheck\Exception.hs:15:36:
Class `Exception' used as a type
In the type `Exception'
In the type `Either Exception a'
In the type `IO (Either Exception a)'




___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] followedBy parser in Parsec

2008-11-27 Thread Stephan Friedrichs
Paul Keir wrote:
 Is there a way in Parsec to check what the next token is, and if it is
 what you're hoping for, leave it there.

Maybe you're looking for 'lookAhead'?

 
 [...]

//Stephan

-- 

Früher hieß es ja: Ich denke, also bin ich.
Heute weiß man: Es geht auch so.

 - Dieter Nuhr
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Go Haskell!

2008-11-27 Thread Don Stewart
claus.reinke:
 http://computer-go.org/pipermail/computer-go/2008-October/016680.html
 Interestingly, I did this a while ago.  Here's my results:
 
 $ ./Bench 1 10
 b: 14840, w: 17143 mercy: 67982
 elapsed time: 3.42s
 playouts/sec: 29208
 
 so, nearly 30k/sec random playouts on 9x9.  That's using a hack that 
 stops the game when the score is heavily in favour of one player, it 
 drops to around 20k/sec with that turned off.
 
 Nice!-) 20k playouts/sec (without  the early cutoffs) is the rough number
 usually mentioned for these light playouts, reachable even in Java. My own
 Haskell code for that was a factor of 5 slower:-( 
 
 actually, that 5x is relative to jrefbot on my machine (Pentium M760, 2Ghz),
 which doesn't quite reach 20k/sec, so if your code would run at 20k/sec on
 my laptop, it would be 10x as fast as my bot:-(( Since you can't release 
 your
 code, could you perhaps time the jrefbot from the url above on your machine 
 as a reference point, so that I know how far I've yet to go? Something like:
 
$ time ((echo genmove b;echo quit) | 
d:/Java/jre6/bin/java -jar refbots/javabot/jrefgo.jar 2)
= E5
 
real0m2.539s
user0m0.030s
sys 0m0.031s
 
 Btw, I just realised where my bot dropped from 5x to 8x: to work around
 
http://hackage.haskell.org/trac/ghc/ticket/2669
 
 all my array accesses were wrapped in exception handlers, to get
 useful error messages while I adapted my code to the refbot spec..
 
 That's not the only bug that got in the way: 
 
http://hackage.haskell.org/trac/ghc/ticket/2727
 
 forced me to move from functional to imperative arrays much sooner 
 than I wanted, and due to 
 
http://hackage.haskell.org/trac/ghc/ticket/1216
 
 I did not even consider 2d arrays (the tuple allocations might have gotten
 in the way anyhow, but still..).
 
 What do those folks working on parallel Haskell arrays think about the
 sequential Haskell array baseline performance?

Try using a fast array library like uvector? (With no serious overhead for
tuples too, fwiw)...

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Building QuickCheck 2 Under GHC 6.10.1

2008-11-27 Thread Don Stewart
Indeed. The base3/base4 simultaneous install.

http://haskell.org/haskellwiki/Upgrading_packages#runhaskell

Two solutions:

cabal install quickcheck

(will determine the base dependency correct). or:

runhaskell Setup.hs configure --constraint='base4'

dominic.steinitz:
 Having been a happy user of QuickCheck 2 for many years, I now find it 
 won't build under ghc 6.10.1. Before I investigate further, has anyone 
 encountered this problem and has a fix?
 
 Thanks, Dominic.
 
 C:\Users\Dom\QuickCheckSetup build
 Preprocessing library QuickCheck-2.0...
 Building QuickCheck-2.0...
 [2 of 9] Compiling Test.QuickCheck.Exception ( 
 Test\QuickCheck\Exception.hs, dis
 t\build\Test\QuickCheck\Exception.o )
 
 Test\QuickCheck\Exception.hs:12:31:
 Class `Exception' used as a type
 In the type `Exception'
 In the type `Either Exception a'
 In the type `IO (Either Exception a)'
 
 Test\QuickCheck\Exception.hs:15:36:
 Class `Exception' used as a type
 In the type `Exception'
 In the type `Either Exception a'
 In the type `IO (Either Exception a)'
 
 
 
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Suggestion: Syntactic sugar for Maps!

2008-11-27 Thread Don Stewart
bulat.ziganshin:
 Hello circ,
 
 Thursday, November 27, 2008, 9:59:08 PM, you wrote:
  So why not {hello: 1, there: 2} ?
 
 mymap hello:1 there:2
 
 where mymap implementation is left to the reader :)

Hey, well, even easier:

{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleInstances #-}

import Data.Map
import Data.String
import Text.JSON

instance IsString (Map Int Bool) where
fromString = fromList . read

-- or, say, JSON syntax for assoc lists.
{-
fromString s = case resultToEither (decode s) of
Right a - a
Left s  - error s
-}

test :: Map Int Bool
test = [(7, True), (1, False)]

main = print test

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Go Haskell!

2008-11-27 Thread Claus Reinke

What do those folks working on parallel Haskell arrays think about the
sequential Haskell array baseline performance?


Try using a fast array library like uvector? (With no serious overhead for
tuples too, fwiw)...


I downloaded uvector a while ago, but haven't got round to trying it
(yet another array API?). Mostly, I'd like to know a little more than just 
fast array lib:


- in which ways is it supposed to be faster? why?
- for which usage patterns is it optimised? how?
- if it is faster in general, why hasn't it replaced the default arrays?

In general, I think Haskell has too many array libraries, with too
many APIs. And that doesn't even take account the overuse of
unsafe APIs, or the non-integrated type-level safety tricks - if 
array accesses were properly optimized, there should be a lot 
less need for the extreme all-or-nothing checks or home-grown

alternative special-purpose APIs:

- type-level code for watermarking indices belonging to certain 
   index sets is one step to eliminate index checks, but hasn't been

   integrated into any of the standard libs
- one could also associate index subsets with operations that do 
   not leave the index superset belonging to an array (eg, if 
   minimax, then min=i+-1=max, still safe without checks)

- GHC does seem to common up index checks only if they are
   identical, but if minii+1i+2..i+jmax, only the outer checks 
   are really necessary (as long as we know about '+')

- whole-array ops allow to avoid index checks without type-level
   tricks, leaving the indexing implicit; but the corresponding ops
   in Data.Array.MArray claim to construct new arrays, contrary
   to the intended inplace updating for which one uses MArrays?
- etc. etc.

At least, uvector seems to take multi-element ops more seriously.
But with so many people working on sequential and parallel Haskell
array libraries, I was hoping for someone to take a big ax and clear
out all that sick and half-dead wood, to give a small number of healthy 
arrays libs room to grow. Would be a lot easier for us poor naive

Haskell array users who otherwise tend to get lost in that forrest!-)

Just my 2c,-)
Claus


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


RE: [Haskell-cafe] followedBy parser in Parsec

2008-11-27 Thread Paul Keir
'lookAhead' is exactly what I needed:

try $ array_element = \ae - lookAhead (reservedOp ()  return ae

Many thanks,
Paul

Maybe you're looking for 'lookAhead'?

 
 [...]

//Stephan

-- 

Früher hieß es ja: Ich denke, also bin ich.
Heute weiß man: Es geht auch so.

 - Dieter Nuhr
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Go Haskell!

2008-11-27 Thread Andrew Coppin

Claus Reinke wrote:

In general, I think Haskell has too many array libraries, with too
many APIs. And that doesn't even take account the overuse of
unsafe APIs, or the non-integrated type-level safety tricks - if array 
accesses were properly optimized, there should be a lot less need for 
the extreme all-or-nothing checks or home-grown

alternative special-purpose APIs:

- type-level code for watermarking indices belonging to certain
index sets is one step to eliminate index checks, but hasn't been

   integrated into any of the standard libs
- one could also associate index subsets with operations that do
not leave the index superset belonging to an array (eg, if
minimax, then min=i+-1=max, still safe without checks)

- GHC does seem to common up index checks only if they are
   identical, but if minii+1i+2..i+jmax, only the outer checks 
   are really necessary (as long as we know about '+')

- whole-array ops allow to avoid index checks without type-level
   tricks, leaving the indexing implicit; but the corresponding ops
   in Data.Array.MArray claim to construct new arrays, contrary
   to the intended inplace updating for which one uses MArrays?
- etc. etc.

At least, uvector seems to take multi-element ops more seriously.
But with so many people working on sequential and parallel Haskell
array libraries, I was hoping for someone to take a big ax and clear
out all that sick and half-dead wood, to give a small number of 
healthy arrays libs room to grow. Would be a lot easier for us poor naive

Haskell array users who otherwise tend to get lost in that forrest!-)


+3

The current array situation is unecessarily messy - and I prefer 
mathematical elegance to ad-hoc mess. (And you think I use Haskell, why 
exactly?)


Of course, it's all very well complaining about it... somebody still has 
to *do* all this wonderful stuff. :-/


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Go Haskell!

2008-11-27 Thread Jason Dagit
On Thu, Nov 27, 2008 at 1:20 PM, Claus Reinke [EMAIL PROTECTED]wrote:

 What do those folks working on parallel Haskell arrays think about the
 sequential Haskell array baseline performance?


 Try using a fast array library like uvector? (With no serious overhead for
 tuples too, fwiw)...


 I downloaded uvector a while ago, but haven't got round to trying it
 (yet another array API?). Mostly, I'd like to know a little more than just
 fast array lib:

 - in which ways is it supposed to be faster? why?
 - for which usage patterns is it optimised? how?
 - if it is faster in general, why hasn't it replaced the default arrays?

 In general, I think Haskell has too many array libraries, with too
 many APIs. And that doesn't even take account the overuse of
 unsafe APIs, or the non-integrated type-level safety tricks - if array
 accesses were properly optimized, there should be a lot less need for the
 extreme all-or-nothing checks or home-grown
 alternative special-purpose APIs:

 - type-level code for watermarking indices belonging to certain   index
 sets is one step to eliminate index checks, but hasn't been
   integrated into any of the standard libs
 - one could also associate index subsets with operations that do   not
 leave the index superset belonging to an array (eg, if   minimax, then
 min=i+-1=max, still safe without checks)
 - GHC does seem to common up index checks only if they are
   identical, but if minii+1i+2..i+jmax, only the outer checks   are
 really necessary (as long as we know about '+')
 - whole-array ops allow to avoid index checks without type-level
   tricks, leaving the indexing implicit; but the corresponding ops
   in Data.Array.MArray claim to construct new arrays, contrary
   to the intended inplace updating for which one uses MArrays?
 - etc. etc.


This library would satisfy most of your requirements I suspect:
http://ofb.net/~frederik/vectro/draft-r2.pdf

My understanding is that the author's code could be turned into a real
library fairly easily if it hasn't been already.  I only read the paper; I
didn't go looking for the library on hackage, but the author does provide
the code for the library.

The author also says their Haskell code is faster than the same algorithm in
Matlab.

But, I have to say.  Whenever you're faking dependent types in Haskell
things get harder to understand for the programmer.  Checkout the section in
the above paper about type checking.  Dependent types, even simulated ones,
come with lots of cool static guarantees but understanding how to program
with them comes with a high barrier to entry.  I think this cognitive load
is even higher in Haskell where dependent types have to simulated by doing
seemingly bizarre things.  I think it is this usability aspect that prevents
the techniques from becoming more common in Haskell.




 At least, uvector seems to take multi-element ops more seriously.
 But with so many people working on sequential and parallel Haskell
 array libraries, I was hoping for someone to take a big ax and clear
 out all that sick and half-dead wood, to give a small number of healthy
 arrays libs room to grow. Would be a lot easier for us poor naive
 Haskell array users who otherwise tend to get lost in that forrest!-)


Sometimes a good library design is an evolutionary process.  Maybe it's time
to apply a fitness function.

Jason
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Fun with type functions

2008-11-27 Thread Toby Hutton
On Thu, Nov 27, 2008 at 8:29 PM, Simon Peyton-Jones
[EMAIL PROTECTED] wrote:
 So this message is to ask you:

can you tell us about the most persuasive, fun application
you've encountered, for type families or functional dependencies?

I only just discovered functional dependencies a week or two ago, and
when it solved my problem it absolutely made my day.

I was reading 'Bananas, Lenses, etc.' and wanted to implement
paramorphic recursion with a type class.  My initial attempt:

class Paramorphic p where
   term :: p - Bool
   this :: p - a
   next ::: p - p

para :: (Paramorphic p) = t - (a - (p, t) - t) -p - t
para a f p | term p = a
   | otherwise = f (this p) (next p, para a f (next p))

instance Paramorphic Int where
term = (== 0)
this = id
next = subtract 1

This is broken, since 'a' in 'this' is loose.  Then I found multiple
class parameters:

class Paramorphic p a where
   ...

But 'a' was still too loose--para's type became

para :: (Paramorphic p a, Paramorphic p a1, Paramorphic p a2,
Paramorphic p a3) = t - (a1 - (p, t) - t) - p - t

But a fundep solved it for me:

class Paramorphic p a | p - a where
   ...

I could now pretty much do factorial and tails from the paper.

fact = para 1 (\a (_, b) - a * b)

instance Paramorphic [a] a where
term = null
this = head
next = tail

tails = para [[]] (\a (as, b) - (a : as) : b)

Not exactly a 'fun' example, but I was smiling for hours after
discovering this. :)

Toby.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Suggestion: Syntactic sugar for Maps!

2008-11-27 Thread Jason Dusek
  In all fairness, this basically forces you to say trust me
  to the compiler for something that should be verifiable
  statically. A typo results in a runtime error -- in a way,
  this is worse than Perl.

  Quasi-quotes are really the right answer but hardly simple
  in this case...

--
_jsn
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Shared modification inside lambdas

2008-11-27 Thread Andrew Hunter
I'm developing an embedded DSL in Haskell (for exact real arithmetic
work, but that's irrelevant right now.)  Among other things, the
language contains functions and application, as well as various
terms. In one iteration, the abstract syntax looked kinda like this
(in spirit, don't worry about the actually available terms...)

data Expr = Var String
  | Const Int
  | Plus Expr Expr
  | Quantified Range String Expr
  | Lambda String Expr
  | App Expr Expr

Here, lambda-terms just have the name of their bound variable and the
RHS.  Quantified terms are much like specialized lambdas; one note is
that you *will* have to evaluate the RHS of the quantified term with
many values for the argument.

It's obvious how to write an evaluator on these--just keep an
environment, etc.  All well and good, but it seems to me that if I'm
embedding the DSl, shouldn't I be able to use the host language's
facilities--for example, function abstractions and
applications--directly?

Well, I tried this, and it seems it works OK, like so:
   
data Expr = Var String
  | Const Int
  | Plus Expr Expr
  | Quantified Range (Int - Expr)

I replaced Lambda terms and applications with Haskell-level functions.
Note that my quantifiers still need internal functions, but I replaced
them in the same fashion.  However, I have a problem; one thing I
often have to do with expressions is refine them, where refine has
type:

refine :: Expr - Expr

and transforms expressions into more interesting ones via certain,
mostly simple rules.  The problem comes with functions, either just
plain lambdas or quantified ones.  The rule for refining functions
boils down to just refining (recursively) the RHS; in the old version,
that was easy!

refine (Lambda var rhs) = Lambda var (refine rhs)

I only refine while evaluating terms of type Expr, so top level
functions aren't important--by the time I'm evaluating them, I've
applied them to arguments--but quantified terms are a problem.  I
could write something like:

refine (Quantified range pred) = Quantified range pred' 
  where
pred' = \c - refine (pred c)

But the problem is that this refines the term, again, every time I
apply an argument to pred': I know I'm going to apply arguments many
times to that new pred, and I want to refine it /once/: refinement is
argument-agnostic, it only rearranges the structure of the AST, so in
theory it'd be nice if I could refine that structure, just duplicating
references to the appropriate free variable where I would have
duplicated refences to the appropriate (Var String) before.  Am I sore
out of luck here?

Is there a reasonable way I can implement my internal functions via
Haskell functions, but apply argument-agnostic transformations to the
RHS in a shared fashion?  Or, is there some optimization in GHC that
means I don't need to worry about this?

Thanks,
AHH
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Fun with type functions

2008-11-27 Thread Ryan Ingram
My work on lightweight session types (modeled after this year's ICFP
paper on the same subject) used type and data families extensively for
an elegant way of connecting communicating coroutines:

Empty types are used for sessions:

 data Eps  -- empty session
 data a :?: s -- read an a followed by session s
 data a :!: s -- write an a followed by session s
 -- etc.

These have kind *, which makes them easy to use in other type-level
code; my first formulation had the session types as functors directly,
but that led to needing kind signatures elsewhere and made working
with these types much more difficult..

Type families are used to represent the dual of a session; that is, a
session that reads an Int can connect with a session that writes an
Int.

 type family Dual s
 type instance Dual Eps = Eps
 type instance Dual (a :?: s) = a :!: Dual s
 type instance Dual (a :!: s) = a :?: Dual s
 -- etc.

Then data families give structure to the session:

 data family Rep s a
 newtype instance Rep Eps a = Done a
 data instance Rep (x :!: s) a = Send x (Rep s a)
 newtype instance Rep (x :?: s) a = Receive (x - Rep s a)
 -- etc.

Rep s converts a sessions (kind *) into a functor (kind * - *).  It
also allows easy experimentation with alternate formulations of the
problem that potentially have different kinds.

Finally, a typeclass allows interpretation of these types, connecting
two sessions together to run as coroutines:

 class Coroutine s where
connect :: (Dual s ~ c, Dual c ~ s) = Rep s a - Rep c b - (a,b)

 instance Coroutine Eps where
connect (Done a) (Done b) = (a,b)
 instance Coroutine s = Coroutine (x :!: s) where
connect (Send x s) (Receive k) = connect s (k x)
 instance Coroutine s = Coroutine (x :?: s) where
connect (Receive k) (Send x c) = connect (k x) c

The proof that two routines can safely connect is done entirely at
compile time; the connection routine just takes care of routing data
between the two processes.

  -- ryan

On Thu, Nov 27, 2008 at 1:29 AM, Simon Peyton-Jones
[EMAIL PROTECTED] wrote:
 Friends

 GHC has embodied data type families since 6.8, and now type synonym families 
 (aka type functions) in 6.10.  However, apart from our initial papers there 
 isn't much published material about how to *use* type families.  But that 
 hasn't stopped you: quite a few people are using them already, and of course 
 there is a rich seam of work on using functional dependencies to express 
 type-level computation.

 Ken Shan and Oleg Kiselyov and I are collaborating to write a paper for an 
 upcoming workshop, under the general rubric of Fun with type functions (in 
 homage to Thomas Hallgren's paper Fun with functional dependencies and Ralf 
 Hinze's paper Fun with phantom types).

 So this message is to ask you:

can you tell us about the most persuasive, fun application
you've encountered, for type families or functional dependencies?

 Simple is good.  It doesn't have to be elaborate: just something that does 
 something useful you could not have done otherwise.  Pointers to email 
 threads are fine.  Don't assume we already know about them (even if we 
 participated in the thread :-)  Part of what we're interested in is that 
 *you* found the example compelling.

 Many thanks

 Simon, Ken, Oleg

 PS: I'm broadcasting this message to GHC-users and Haskell-cafe, but to avoid 
 deluging ghc-users, please reply just to us and Haskell cafe.  (Interested 
 ghc-users can follow the threads there from the archives if they want.)
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Need machine for DPH benchmarking

2008-11-27 Thread Roman Leshchinskiy

Hi again,

a big thank you to all the people who offered us machines. I think we  
should be fine now. World domination is just around the corner!


Roman

On 27/11/2008, at 18:45, Roman Leshchinskiy wrote:


Hi all,

we, the DPH team, are at the moment in the very unfortunate  
situation of not having a proper machine for running our benchmarks  
on. Could a kind soul maybe give us (i.e., me) access to a quadcore  
or 2xquadcore x86 Linux or OS X machine? I only need to build ghc on  
it and run small benchmarks which never take more than a couple of  
minutes, maybe once every couple of days or so. We do need to use  
all cores, though, so no other CPU-intensive processes can be  
running during benchmarking. This is only for a week or two, until  
we get our own machine. We would be eternally grateful and won't  
forget you when DPH takes over the world.


Roman


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Go Haskell!

2008-11-27 Thread Manuel M T Chakravarty

Claus Reinke:

What do those folks working on parallel Haskell arrays think about the
sequential Haskell array baseline performance?


You won't like the answer.  We are not happy with the existing array  
infrastructure and hence have our own.  Roman recently extracted some  
of it as a standalone package:


  http://hackage.haskell.org/cgi-bin/hackage-scripts/package/vector

In the longer run, we would like to factor our library into DPH- 
specific code and general-purpose array library that you can use  
independent of DPH.


Manuel
 
___

Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] I have forgotten .. ghci question

2008-11-27 Thread Galchin, Vasili
Hello,

I have an experimental version of a package ~/FTP/Haskell/blah.  Who I
point ghci ath this experimental package version so I can poke around?

Kind regards, Vasili
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] ANNOUNCE: Haskell Communities and Activities Report (15th ed., November 2008)

2008-11-27 Thread Janis Voigtlaender

On behalf of the many, many contributors, I am pleased to announce
that the

Haskell Communities and Activities Report
  (15th edition, November 2008)

   http://www.haskell.org/communities/

is now available from the Haskell Communities home page in PDF and
HTML formats.

Many thanks go to all the people that contributed to this report,
both directly, by sending in descriptions, and indirectly, by doing
all the interesting things that are reported. I hope you will find
it as interesting a read as I did.

If you have not encountered the Haskell Communities and Activities
Reports before, you may like to know that the first of these reports
was published in November 2001. Their goal is to improve the
communication between the increasingly diverse groups, projects, and
individuals working on, with, or inspired by Haskell. The idea behind
these reports is simple:

  Every six months, a call goes out to all of you enjoying Haskell to
  contribute brief summaries of your own area of work. Many of you
  respond (eagerly, unprompted, and sometimes in time for the actual
  deadline ;-) to the call. The editor collects all the contributions
  into a single report and feeds that back to the community.

When I try for the next update, six months from now, you might want
to report on your own work, project, research area or group as well.
So, please put the following into your diaries now:

  
 End of April 2009:
  target deadline for contributions to the
  May 2009 edition of the HCA Report
  

Unfortunately, many Haskellers working on interesting projects are so
busy with their work that they seem to have lost the time to follow
the Haskell related mailing lists and newsgroups, and have trouble even
finding time to report on their work. If you are a member, user or
friend of a project so burdened, please find someone willing to make
time to report and ask them to register with the editor for a simple
e-mail reminder in April (you could point me to them as well, and I can
then politely ask if they want to contribute, but it might work better
if you do the initial asking). Of course, they will still have to find
the ten to fifteen minutes to draw up their report, but maybe we can
increase our coverage of all that is going on in the community.

Feel free to circulate this announcement further in order to
reach people who might otherwise not see it. Enjoy!

Janis Voigtlaender
hcar at haskell.org

--
Dr. Janis Voigtlaender
http://wwwtcs.inf.tu-dresden.de/~voigt/
mailto:[EMAIL PROTECTED]

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Suggestion: Syntactic sugar for Maps!

2008-11-27 Thread Jules Bean

Don Stewart wrote:

bulat.ziganshin:

Hello circ,

Thursday, November 27, 2008, 9:59:08 PM, you wrote:

So why not {hello: 1, there: 2} ?

mymap hello:1 there:2

where mymap implementation is left to the reader :)


I can't see the context of the beginning of this thread, but I've always 
found:


fromList [(hello,1),(there,2)]

to be a relatively simple syntax, and still checked at compile time.

Anonymous sum + product types plus lists are a pretty good approximation 
for lots of concrete syntax, and they're type checks.


(Anonymous sum, Either, is slightly more syntactically heavy than you'd 
like, though...)


Jules
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Suggestion: Syntactic sugar for Maps!

2008-11-27 Thread Luke Palmer
On Fri, Nov 28, 2008 at 12:04 AM, Jules Bean [EMAIL PROTECTED] wrote:
 I can't see the context of the beginning of this thread, but I've always
 found:

 fromList [(hello,1),(there,2)]

 to be a relatively simple syntax, and still checked at compile time.

I never liked that.  Too much syntax overhead.  But this clears it right up:

foo = fromList [ hello : 1, there : 2 ]
  where (:) = (,)

And also I haven't been following the thread, so this may not be any
kind of answer.

Luke
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe