[Haskell-cafe] what's the definition of satisfy and ? ?

2009-05-21 Thread z_a...@163.com
I cannot understand the following code very well as i donot know the 
definition of satisfy and ?.


-- | Case-insensitive variant of Parsec's 'char' function.
caseChar:: Char - GenParser Char a Char
caseChar c   = satisfy (\x - toUpper x == toUpper c)

-- | Case-insensitive variant of Parsec's 'string' function.
caseString  :: String - GenParser Char a ()
caseString cs= mapM_ caseChar cs ? cs

Would somebody mind to explain the code in detail ?

Sincerely!


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


Re: [Haskell-cafe] what's the definition of satisfy and ? ?

2009-05-21 Thread Lee Duhem
On Thu, May 21, 2009 at 2:10 PM, z_a...@163.com z_a...@163.com wrote:
 I cannot understand the following code very well as i donot know the
 definition of satisfy and ?.

Did you check out the document of parsec? You can find definitions for 'satisty'
and '?' in Text.ParserCombinators.Parsec.Char and Text.ParserCombinators.Prim,
respectively.

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


[Haskell-cafe] Re: what's the definition of satisfy and ? ?

2009-05-21 Thread Ertugrul Soeylemez
z_a...@163.com z_a...@163.com wrote:

 I cannot understand the following code very well as i donot know the
 definition of satisfy and ?.

Yes.  Just look at the Parsec documentation, preferably Parsec 3,
because Parsec versions prior to 3 were not well documented.


 -- | Case-insensitive variant of Parsec's 'char' function.
 caseChar:: Char - GenParser Char a Char
 caseChar c   = satisfy (\x - toUpper x == toUpper c)

 -- | Case-insensitive variant of Parsec's 'string' function.
 caseString  :: String - GenParser Char a ()
 caseString cs= mapM_ caseChar cs ? cs

This code looks incorrect to me.  It should read:

  caseString :: String - GenParser Char a ()
  caseString cs = Parsec.try (mapM_ caseChar cs) ? cs


Greets,
Ertugrul.


-- 
nightmare = unsafePerformIO (getWrongWife = sex)
http://blog.ertes.de/


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


Re: [Haskell-cafe] Haskell philosophy question

2009-05-21 Thread Yaakov Nemoy
2009/5/17 Vasili I. Galchin vigalc...@gmail.com:
 Hello,

  I am confused between Haskell as delineated in the Haskell Report VS
 ghc pragmas which extend Haskell beyond the Haskell Report. I am sure I am
 not the first to ask. Caveat: on my part, I am not against
 innovation/extensions, but I don't like to see language bloat. This is not
 a negative/pegorative statement  just a challenging one.

Let's say that pragmas strong type your code. With the Haskell Report,
you can parse a string into a certain block of code which does some
kind of functionality. With these, you will get a different type that
does prett ymuch the same thing. But these advanced types can also
handle certain other tricks too. The philosophy is to use the pragmas
then, as declarations so you know which parser to use, etc... It also
lets people pass around blocks of data and know what to do with it,
rather than relying on simple version numbers.

Languages do pick up features all the time. If you're looking for a
different perspective, it lets us strictly sort the extensions rather
than relying on vague notions such as version number, 'from __future__
import *' (from python) or any of the other weird things you get when
there are multiple revisions of a single language spec. In essence
it's not that the language is any more bloated than what is normal, or
you would still be using KR C to get your work done, because you were
afraid of bloat.

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


Re: [Haskell-cafe] Haskell in 3 Slides

2009-05-21 Thread Kalman Noel
Joe Fredette schrieb:
 3-4 slides imply 3-4 topics, so the question is what are the 3-4 biggest
 topics in haskell? I would think they would be:
 
 * Purity/Referential Transparency
 * Lazy Evaluation
 * Strong Typing + Type Classes
 * Monads

If the goal is to be able to talk about different examples of Haskell
code in the rest of the presentation, the big topic I'd choose would be
called »How function definitions look like in Haskell«.

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


Re: [Haskell-cafe] Haskell in 3 Slides

2009-05-21 Thread Lionel Barret de Nazaris

On 21/05/2009 09:40, Kalman Noel wrote:

Joe Fredette schrieb:
   

3-4 slides imply 3-4 topics, so the question is what are the 3-4 biggest
topics in haskell? I would think they would be:

* Purity/Referential Transparency
* Lazy Evaluation
* Strong Typing + Type Classes
* Monads
 


If the goal is to be able to talk about different examples of Haskell
code in the rest of the presentation, the big topic I'd choose would be
called »How function definitions look like in Haskell«.

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

My bet :
- type system without the type classes but with comparision with usual 
(c++) type systems.

- function definitions, with a hint at pattern matching
- lazyness. (see the searching a maybe list on the begineer list, it is 
a very good example).
- advanced topic : monads, type classes, etc - just to say they are 
here and describe what they allow (state, exception), etc.


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


Re: [Haskell-cafe] the problem of design by negation

2009-05-21 Thread Thomas ten Cate
On Thu, May 21, 2009 at 00:54, Michael Mossey m...@alumni.caltech.edu wrote:
 I call it design by negation. When asked to justify his design, the lead
 software architect explains everything that *wouldn't* work. We couldn't
 have a unique key for every entry because blah blah blah. We couldn't use a
 garbage collector because blah blah. We couldn't write a sugar layer because
 then you have to document it separately blah blah. So the chosen design
 seems to be the only thing left after eliminating everything you can't do.

 I want to aspire to positive design. I want to list the goals, and think
 of design as making clever choices that meet all the goals.

I think there is often a good default solution which is so obvious
that experienced software architects won't even bother to mention.
This is the case for both examples that you mention (unique keys in a
database, garbage collection). They then go on to give reasons why the
default solution would not work in their case.

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


[Haskell-cafe] ANN: EsotericBot 0.0.1

2009-05-21 Thread spoon
Hackage: 
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/esotericbot

See the homepage for online copy of README and example configuration 
file:
http://www.killersmurf.com/projects/esotericbot

Esotericbot is a sophisticated, lightweight IRC bot, written in Haskell.

Esotericbot launches sub-processes to respond to commands issued by 
users over IRC.

Why would you use esotericbot?

For lambdabot-4.2.2.1:

sp...@utensil:~/esotericbot$ ps e v
  PID TTY  STAT   TIME  MAJFL   TRS   DRS   RSS %MEM COMMAND
23433 pts/3Sl+0:00  0  8228 84855 33476  1.6 lambdabot
15040 pts/5S+ 0:00  0  2171 28804  3292  0.1 ./esotericbot

I'm not insinuating that lambdabot sucks in any way, ( for lambdabot is 
most excellent ) however, my hope is that esotericbot could attain equal 
functionality through plugins, whilst maintaining its small memory footprint.

Esotericbot is small, designed to run on a server with 
limited memory - typically running at under 5mb of private memory.
Features:

* Advanced memory and time management options, utilizing POSIX resource 
management.  
For example, the memory used by all child processes, can be limited - 
commands be queued until the memory usage has dropped.

* Privileged channel operator commands ( Currently, can be disabled and 
enabled by channel operators, without kicking. )

* Easy to add new plugins.  A C library is included to make writing new 
plugins/adapting programs in C easy.

* Set up through a configuration file.

* Multiple channels.

* Multi-threaded

* Lightweight, typically running at under 5mb of private memory.

Cons:

* POSIX memory management, process forking, and chroot means that 
Esotericbot is POSIX only.

* Esotericbot is, due to the libraries and extensions used, restricted 
to being compiled by the Glorious Glasgow Haskell Compiler. 
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: EsotericBot 0.0.1

2009-05-21 Thread Gwern Branwen
On Thu, May 21, 2009 at 5:36 AM,  sp...@killersmurf.com wrote:
 Hackage:
 http://hackage.haskell.org/cgi-bin/hackage-scripts/package/esotericbot

 See the homepage for online copy of README and example configuration
 file:
 http://www.killersmurf.com/projects/esotericbot

 Esotericbot is a sophisticated, lightweight IRC bot, written in Haskell.

 Esotericbot launches sub-processes to respond to commands issued by
 users over IRC.

 Why would you use esotericbot?

 For lambdabot-4.2.2.1:

 sp...@utensil:~/esotericbot$ ps e v
  PID TTY      STAT   TIME  MAJFL   TRS   DRS   RSS %MEM COMMAND
 23433 pts/3    Sl+    0:00      0  8228 84855 33476  1.6 lambdabot
 15040 pts/5    S+     0:00      0  2171 28804  3292  0.1 ./esotericbot

 I'm not insinuating that lambdabot sucks in any way, ( for lambdabot is
 most excellent ) however, my hope is that esotericbot could attain equal
 functionality through plugins, whilst maintaining its small memory footprint.

 Esotericbot is small, designed to run on a server with
 limited memory - typically running at under 5mb of private memory.
 Features:

 * Advanced memory and time management options, utilizing POSIX resource
 management.
 For example, the memory used by all child processes, can be limited -
 commands be queued until the memory usage has dropped.

 * Privileged channel operator commands ( Currently, can be disabled and
 enabled by channel operators, without kicking. )

 * Easy to add new plugins.  A C library is included to make writing new
 plugins/adapting programs in C easy.

 * Set up through a configuration file.

 * Multiple channels.

 * Multi-threaded

 * Lightweight, typically running at under 5mb of private memory.

 Cons:

 * POSIX memory management, process forking, and chroot means that
 Esotericbot is POSIX only.

 * Esotericbot is, due to the libraries and extensions used, restricted
 to being compiled by the Glorious Glasgow Haskell Compiler.

Hm, no 'quotes' or Haskell evaluation functionality? I guess this
isn't a lambdabot killer yet!

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


Re: Re: [Haskell-cafe] what's the definition of satisfy and ? ?

2009-05-21 Thread Lee Duhem
On Thu, May 21, 2009 at 6:48 PM, z_axis z_a...@163.com wrote:
 Sorry! I am a haskell newbie.   then i will have a look at
 Text.ParserCombinators.Parsec.Char

Don't forget to CC your reply to the list, so other people on the thread
will see your reply.

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


Re: [Haskell-cafe] Haskell in 3 Slides

2009-05-21 Thread Brandon S. Allbery KF8NH

On May 21, 2009, at 03:40 , Kalman Noel wrote:

If the goal is to be able to talk about different examples of Haskell
code in the rest of the presentation, the big topic I'd choose would  
be

called »How function definitions look like in Haskell«.


That would be (or lead directly to) referential transparency.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell philosophy question

2009-05-21 Thread Brandon S. Allbery KF8NH

On May 21, 2009, at 03:13 , Yaakov Nemoy wrote:

you would still be using KR C to get your work done, because you were
afraid of bloat.



Actually you'd still be using BCPL. :)

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] ANN: feed2twitter 0.2 hackage2twitter 0.2.1

2009-05-21 Thread Tom Lokhorst
To all the cool kids using the Twitter (and to anyone else):

I'm happy to announce the first release of feed2twitter.
Build on top of the excellent feed and hs-twitter packages,
feed2twitter sends posts from a news feed to Twitter.

The hackage2twitter executable is build on top of the feed2twitter
library. It `tweets' the releases of new Hackage-packages.
In the 3 days it has been running, it has already posted 70+ releases:
http://twitter.com/Hackage

- Tom Lokhorst

http://hackage.haskell.org/cgi-bin/hackage-scripts/package/feed2twitter
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hackage2twitter
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: feed2twitter 0.2 hackage2twitter 0.2.1

2009-05-21 Thread John Van Enk
A bit off topic, but what's the chance we can get the Hackage RSS feed to
include some more information about the package? I'd like to see at least
the description, but it might be nice to see things like dependencies and
home pages.

/jve
On Thu, May 21, 2009 at 2:55 PM, Tom Lokhorst t...@lokhorst.eu wrote:

 To all the cool kids using the Twitter (and to anyone else):

 I'm happy to announce the first release of feed2twitter.
 Build on top of the excellent feed and hs-twitter packages,
 feed2twitter sends posts from a news feed to Twitter.

 The hackage2twitter executable is build on top of the feed2twitter
 library. It `tweets' the releases of new Hackage-packages.
 In the 3 days it has been running, it has already posted 70+ releases:
 http://twitter.com/Hackage

 - Tom Lokhorst

 http://hackage.haskell.org/cgi-bin/hackage-scripts/package/feed2twitter
 http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hackage2twitter
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe




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


Re: [Haskell-cafe] ANN: feed2twitter 0.2 hackage2twitter 0.2.1

2009-05-21 Thread Gwern Branwen
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On Thu, May 21, 2009 at 2:59 PM, John Van Enk  wrote:
 A bit off topic, but what's the chance we can get the Hackage RSS feed to
 include some more information about the package? I'd like to see at least
 the description, but it might be nice to see things like dependencies and
 home pages.

 /jve
 On Thu, May 21, 2009 at 2:55 PM, Tom Lokhorst  wrote:

 To all the cool kids using the Twitter (and to anyone else):

 I'm happy to announce the first release of feed2twitter.
 Build on top of the excellent feed and hs-twitter packages,
 feed2twitter sends posts from a news feed to Twitter.

 The hackage2twitter executable is build on top of the feed2twitter
 library. It `tweets' the releases of new Hackage-packages.
 In the 3 days it has been running, it has already posted 70+ releases:
 http://twitter.com/Hackage

 - Tom Lokhorst

 http://hackage.haskell.org/cgi-bin/hackage-scripts/package/feed2twitter
 http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hackage2twitter
 ___
 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



Someone coding it? The repo for Hackage is:
http://code.haskell.org/hackage-server
The relevant file seems to be: Distribution/Server/Pages/Recent.hs

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

iEYEAREKAAYFAkoVplEACgkQvpDo5Pfl1oI3SACglwKSDOyVMnO7XM8xNMEWs3fW
7k8An2p77xOiM+/phCJ5oq00odgqjlbw
=Bn8E
-END PGP SIGNATURE-
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: feed2twitter 0.2 hackage2twitter 0.2.1

2009-05-21 Thread Tom Lokhorst
Oh, and while we're talking off topic.
I don't know who's in charge of this, but I think it would be nice to
have urls like: http://hackage.haskell.org/feed2twitter

It would allow me to type in a url from memory instead of having to
copy-paste it. As well as not requiring a url-shortener on Twitter.
This could be done with something like Apache's mod-rewrite.

- Tom

On Thu, May 21, 2009 at 8:59 PM, John Van Enk vane...@gmail.com wrote:
 A bit off topic, but what's the chance we can get the Hackage RSS feed to
 include some more information about the package? I'd like to see at least
 the description, but it might be nice to see things like dependencies and
 home pages.

 /jve
 On Thu, May 21, 2009 at 2:55 PM, Tom Lokhorst t...@lokhorst.eu wrote:

 To all the cool kids using the Twitter (and to anyone else):

 I'm happy to announce the first release of feed2twitter.
 Build on top of the excellent feed and hs-twitter packages,
 feed2twitter sends posts from a news feed to Twitter.

 The hackage2twitter executable is build on top of the feed2twitter
 library. It `tweets' the releases of new Hackage-packages.
 In the 3 days it has been running, it has already posted 70+ releases:
 http://twitter.com/Hackage

 - Tom Lokhorst

 http://hackage.haskell.org/cgi-bin/hackage-scripts/package/feed2twitter
 http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hackage2twitter
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe



 --
 /jve

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


[Haskell-cafe] Function Returning Type?

2009-05-21 Thread jrw4

I wrote this function as I am just learning Haskell.  What it does is it
generates a list of all rational numbers between 0 and 1, but I only have it
show the first 20.

rationals n :: Integer - String
rationals n = (putStr . unlines . map show) (take n (nub [x % y | y -
[1..], x - [1..y], x  y]))

Now my problem is the type declaration, the first line.  I get the error
Invalid type signature.  I googled this error and I was not able to find
out why it is giving it to me.  I have also tried:

rationals n :: Integer - [Ratio]

but it gives me the same error.

Please someone point me in the right direction.  Thanks.
-- 
View this message in context: 
http://www.nabble.com/Function-Returning-Type--tp23658819p23658819.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

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


Re: [Haskell-cafe] ANN: feed2twitter 0.2 hackage2twitter 0.2.1

2009-05-21 Thread John Van Enk
Hmm, or even: http://hackage.haskell.org/?p=feed2twitter

On Thu, May 21, 2009 at 3:10 PM, Tom Lokhorst t...@lokhorst.eu wrote:

 Oh, and while we're talking off topic.
 I don't know who's in charge of this, but I think it would be nice to
 have urls like: http://hackage.haskell.org/feed2twitter

 It would allow me to type in a url from memory instead of having to
 copy-paste it. As well as not requiring a url-shortener on Twitter.
 This could be done with something like Apache's mod-rewrite.

 - Tom

 On Thu, May 21, 2009 at 8:59 PM, John Van Enk vane...@gmail.com wrote:
  A bit off topic, but what's the chance we can get the Hackage RSS feed to
  include some more information about the package? I'd like to see at least
  the description, but it might be nice to see things like dependencies and
  home pages.
 
  /jve
  On Thu, May 21, 2009 at 2:55 PM, Tom Lokhorst t...@lokhorst.eu wrote:
 
  To all the cool kids using the Twitter (and to anyone else):
 
  I'm happy to announce the first release of feed2twitter.
  Build on top of the excellent feed and hs-twitter packages,
  feed2twitter sends posts from a news feed to Twitter.
 
  The hackage2twitter executable is build on top of the feed2twitter
  library. It `tweets' the releases of new Hackage-packages.
  In the 3 days it has been running, it has already posted 70+ releases:
  http://twitter.com/Hackage
 
  - Tom Lokhorst
 
  http://hackage.haskell.org/cgi-bin/hackage-scripts/package/feed2twitter
 
 http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hackage2twitter
  ___
  Haskell-Cafe mailing list
  Haskell-Cafe@haskell.org
  http://www.haskell.org/mailman/listinfo/haskell-cafe
 
 
 
  --
  /jve
 




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


[Haskell-cafe] The Computer Language Benchmarks Game: pidigits

2009-05-21 Thread Arnaud Payement
Hi all, 

I recently decided to rewrite the pidigits benchmark of the debian shootout 
(shootout.alioth.debian.org) as toy project.
However, it seems that on my machine, the code seems to be more performant than 
both the current entry and the proposed replacement (see 
http://www.haskell.org/haskellwiki/Shootout/Pidigits) for the same number of 
lines. 
Do you think it might be worth submitting my entry? Here is my code,:

{-# OPTIONS -O2 -optc-O3 #-}
--
-- The Great Computer Language Shootout
-- http://shootout.alioth.debian.org/
-- by Arnaud Payement
--

import System

data F = F Integer Integer Integer Integer

extract s@(F k n a d) = ((n*3+a) `div` d, (n*4+a) `div` d, s)

update (F k n a d) = F (k+1) (n*k) ((a+n*2)*y) (d*y) where y = 2*k+1

next state = let (u, v, s'@(F k n a d)) = extract (update state) in
  if (n  a || (u /= v)) then next s' else (show u, F k (n*10) ((a-d*u)*10) d)
  
digits = (, (F 1 1 0 1)):[next state | state - map snd digits]

pr (d:t) k n | k  n = putStr 
 | k `mod` 10 /= 0 = putStr d  pr t (k+1) n
 | otherwise = putStrLn (d ++ \t: ++ show k)  pr t (k+1) n

main = pr (map fst (tail digits)) 1 . read . head = getArgs

Best,
Arnaud

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


Re: [Haskell-cafe] Function Returning Type?

2009-05-21 Thread Jochem Berndsen
jrw4 wrote:
 I wrote this function as I am just learning Haskell.  What it does is it
 generates a list of all rational numbers between 0 and 1, but I only have it
 show the first 20.
 
 rationals n :: Integer - String
 rationals n = (putStr . unlines . map show) (take n (nub [x % y | y -
 [1..], x - [1..y], x  y]))
 
 Now my problem is the type declaration, the first line.  I get the error
 Invalid type signature.  I googled this error and I was not able to find
 out why it is giving it to me.  I have also tried:
 
 rationals n :: Integer - [Ratio]
 
 but it gives me the same error.
 
 Please someone point me in the right direction.  Thanks.

Just
rationals :: Integer - String

suffices. (Without the argument 'n'.)

This makes sense, since rationals has type Integer. rationals n has
type String. (But you still cannot declare that in toplevel that way.)

Regards,

-- 
Jochem Berndsen | joc...@functor.nl
GPG: 0xE6FABFAB
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Function Returning Type?

2009-05-21 Thread Jochem Berndsen
Jochem Berndsen wrote:
 This makes sense, since rationals has type Integer

I meant Integer - String obviously.

Regards,

-- 
Jochem Berndsen | joc...@functor.nl
GPG: 0xE6FABFAB
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: feed2twitter 0.2 hackage2twitter 0.2.1

2009-05-21 Thread John Goerzen
On Thu, May 21, 2009 at 09:10:23PM +0200, Tom Lokhorst wrote:
 Oh, and while we're talking off topic.
 I don't know who's in charge of this, but I think it would be nice to
 have urls like: http://hackage.haskell.org/feed2twitter

YES!

Also a /package/doc link.  So we could have a static link that would
always go the latest version of the API docs for a given package.

-- John

 
 It would allow me to type in a url from memory instead of having to
 copy-paste it. As well as not requiring a url-shortener on Twitter.
 This could be done with something like Apache's mod-rewrite.
 
 - Tom
 
 On Thu, May 21, 2009 at 8:59 PM, John Van Enk vane...@gmail.com wrote:
  A bit off topic, but what's the chance we can get the Hackage RSS feed to
  include some more information about the package? I'd like to see at least
  the description, but it might be nice to see things like dependencies and
  home pages.
 
  /jve
  On Thu, May 21, 2009 at 2:55 PM, Tom Lokhorst t...@lokhorst.eu wrote:
 
  To all the cool kids using the Twitter (and to anyone else):
 
  I'm happy to announce the first release of feed2twitter.
  Build on top of the excellent feed and hs-twitter packages,
  feed2twitter sends posts from a news feed to Twitter.
 
  The hackage2twitter executable is build on top of the feed2twitter
  library. It `tweets' the releases of new Hackage-packages.
  In the 3 days it has been running, it has already posted 70+ releases:
  http://twitter.com/Hackage
 
  - Tom Lokhorst
 
  http://hackage.haskell.org/cgi-bin/hackage-scripts/package/feed2twitter
  http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hackage2twitter
  ___
  Haskell-Cafe mailing list
  Haskell-Cafe@haskell.org
  http://www.haskell.org/mailman/listinfo/haskell-cafe
 
 
 
  --
  /jve
 
 ___
 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] ANN: feed2twitter 0.2 hackage2twitter 0.2.1

2009-05-21 Thread Don Stewart
vanenkj:
 A bit off topic, but what's the chance we can get the Hackage RSS feed to
 include some more information about the package? I'd like to see at least the
 description, but it might be nice to see things like dependencies and home
 pages.

what you really want is a way to query hackage programmatically.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] The Computer Language Benchmarks Game: pidigits

2009-05-21 Thread Don Stewart
arnaud.payement:
 Hi all,
  
 I recently decided to rewrite the pidigits benchmark of the debian shootout
 (shootout.alioth.debian.org) as toy project.
 However, it seems that on my machine, the code seems to be more performant 
 than
 both the current entry and the proposed replacement (see 
 http://www.haskell.org
 /haskellwiki/Shootout/Pidigits) for the same number of lines.
 Do you think it might be worth submitting my entry? Here is my code,:

If it is faster, and correct, please submit it
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Function Returning Type?

2009-05-21 Thread Stefan Holdermans

Jochem,

rationals n = (putStr . unlines . map show) (take n (nub [x % y |  
y -

[1..], x - [1..y], x  y]))



rationals n :: Integer - [Ratio]



I meant Integer - String obviously.


Er... what about

  rationals :: Int - IO ()

? ;-)

To the original poster: next time, just leave the function definition  
without the signature and query GHCi for the correct type:


  Prelude :m + List
  Prelude List :m + Ratio
  Prelude List Ratio let rationals n = (putStr . unlines . map show) \
(take n (nub [x % y | y - [1..], x - [1..y], x  y]))
  Prelude List Ratio :t rationals
  rationals :: Int - IO ()

Cheers,

  Stefan


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


Re: [Haskell-cafe] Function Returning Type?

2009-05-21 Thread Thomas Davie


Op 21 May 2009, om 21:52 heeft Stefan Holdermans het volgende  
geschreven:



Jochem,

rationals n = (putStr . unlines . map show) (take n (nub [x % y |  
y -

[1..], x - [1..y], x  y]))



rationals n :: Integer - [Ratio]



I meant Integer - String obviously.


Er... what about

 rationals :: Int - IO ()


Of note here though, the original type Integer - String is more  
desirable – the Int/Integer part doesn't matter so much, what matters  
is the IO type – we can no longer pass the value that rationals  
generates into another function, because it printed it and dumped it.


Lets fix the function instead:

rationals :: Int - [Rational]
rationals n = take n $ nub [x % y | y - [1..], x - 1..], x  y]

showLines :: Show a = [a] - String
showLines = unlines . map show

rationalsS :: Int - String
rationalsS = showLines . rationals

Now we can chose to use the actual rationals we got out of the  
function, we can chose to use the string we get back, we can reuse our  
function for showing multiple showable values, and we can print any of  
these if we chose :).


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


Re: [Haskell-cafe] Function Returning Type?

2009-05-21 Thread Mark Wassell




To the original poster: next time, just leave the function definition 
without the signature and query GHCi for the correct type:

Remember that the type checker is your friend; let it work for you :)

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


Re: [Haskell-cafe] Haskell programmers in São Carlo s - SP - Brazil?

2009-05-21 Thread Fernando Henrique Sanches
São Caetano, SP, Brazil - right next to São Paulo. UFABC Student.

Fernando Henrique Sanches


2009/5/19 Maurí­cio briqueabra...@yahoo.com

 Anybody else around here?

 Best,
 Maurício

 ___
 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] ANN: Haskell Hackathon in Philadelphia

2009-05-21 Thread Brent Yorgey
Hi all!

We are in the early stages of planning a Haskell hackathon/get
together, Hac φ, to be held this summer at the University of
Pennsylvania, in Philadelphia.  Right now we're looking at two
possible dates:

  June 19-21or   July 24-26

If you might be interested in attending, please add your name on the
wiki page:

  http://www.haskell.org/haskellwiki/Hac_%CF%86

You can also note whether either of those dates absolutely doesn't
work for you.  (If you don't have an account on the wiki, you can
email Ashley Yakeley for an account [1], or feel free to just respond
to this email.)  Expect more details (such as a nailed-down date)
soon, once we have gauged the level of interest.

Hope to see you in Philadelphia!

Brent (byorgey)
Daniel Wagner (dmwit)

[1] http://haskell.org/haskellwiki/HaskellWiki:New_accounts
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Introducing Instances in GHC point releases

2009-05-21 Thread John Goerzen
So this is annoying (CCing -cafe)

I need NominalDiffTime and UTCTime to have Typeable instances.  In
6.10.1, they didn't ship with them out of the box, so I added them.
Apparently, in 6.10.3, they DO ship with those instances out of the box.

Annoyingly, that means that my code breaks on 6.10.3.

Even more annoyingly, __GLASGOW_HASKELL__ is still 610, so I can't even
work around this via cpphs.  There appears to be no way to make code
that requires those Typeable instances work with both 6.10.1 and 6.10.3.

Yet another reason to avoid API incompatibilities in point releases.

Does anybody have an idea on the best way to handle this?

-- John

Don Stewart wrote:
 convertible appears broken with 6.10.3. Any thoughts?
 
 Writing new package config file... done.
 Downloading convertible-1.0.1...
 Configuring convertible-1.0.1...
 Preprocessing library convertible-1.0.1...
 Preprocessing executables for convertible-1.0.1...
 Building convertible-1.0.1...
 [1 of 8] Compiling Data.Convertible.Base ( Data/Convertible/Base.hs, 
 dist/build/Data/Convertible/Base.o )
 [2 of 8] Compiling Data.Convertible.Utils ( Data/Convertible/Utils.hs, 
 dist/build/Data/Convertible/Utils.o )
 [3 of 8] Compiling Data.Convertible.Instances.Map ( 
 Data/Convertible/Instances/Map.hs, 
 dist/build/Data/Convertible/Instances/Map.o )
 [4 of 8] Compiling Data.Convertible.Instances.Num ( 
 Data/Convertible/Instances/Num.hs, 
 dist/build/Data/Convertible/Instances/Num.o )
 [5 of 8] Compiling Data.Convertible.Instances.C ( 
 Data/Convertible/Instances/C.hs, dist/build/Data/Convertible/Instances/C.o )
 [6 of 8] Compiling Data.Convertible.Instances.Time ( 
 Data/Convertible/Instances/Time.hs, 
 dist/build/Data/Convertible/Instances/Time.o )
 
 Data/Convertible/Instances/Time.hs:61:9:
 Duplicate instance declarations:
   instance Typeable NominalDiffTime
 -- Defined at Data/Convertible/Instances/Time.hs:61:9-32
   instance Typeable NominalDiffTime
 -- Defined in time-1.1.3:Data.Time.Clock.UTC
 
 Data/Convertible/Instances/Time.hs:64:9:
 Duplicate instance declarations:
   instance Typeable UTCTime
 -- Defined at Data/Convertible/Instances/Time.hs:64:9-24
   instance Typeable UTCTime
 -- Defined in time-1.1.3:Data.Time.Clock.UTC
 cabal: Error: some packages failed to install:
 HDBC-2.1.0 depends on convertible-1.0.1 which failed to install.
 convertible-1.0.1 failed during the building phase. The exception was:
 
 

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


Re: [Haskell-cafe] Introducing Instances in GHC point releases

2009-05-21 Thread Alexander Dunlap
Since those types come out of the time library, and that library's
version *has* been bumped (I assume), couldn't you use Cabal to
condition on the version of the time library to determine whether or
not to have CPP set a -DTYPEABLE_IN_TIME flag, and then #ifdef out
your versions of the instances?

I suppose a nice compiler extension would be recessive instances
which would take effect only if they did not overlap with another
instance. Probably a lot of corner cases involving multiple recessive
instances to work out, though.

Alex

On Thu, May 21, 2009 at 2:53 PM, John Goerzen jgoer...@complete.org wrote:
 So this is annoying (CCing -cafe)

 I need NominalDiffTime and UTCTime to have Typeable instances.  In
 6.10.1, they didn't ship with them out of the box, so I added them.
 Apparently, in 6.10.3, they DO ship with those instances out of the box.

 Annoyingly, that means that my code breaks on 6.10.3.

 Even more annoyingly, __GLASGOW_HASKELL__ is still 610, so I can't even
 work around this via cpphs.  There appears to be no way to make code
 that requires those Typeable instances work with both 6.10.1 and 6.10.3.

 Yet another reason to avoid API incompatibilities in point releases.

 Does anybody have an idea on the best way to handle this?

 -- John

 Don Stewart wrote:
 convertible appears broken with 6.10.3. Any thoughts?

     Writing new package config file... done.
     Downloading convertible-1.0.1...
     Configuring convertible-1.0.1...
     Preprocessing library convertible-1.0.1...
     Preprocessing executables for convertible-1.0.1...
     Building convertible-1.0.1...
     [1 of 8] Compiling Data.Convertible.Base ( Data/Convertible/Base.hs, 
 dist/build/Data/Convertible/Base.o )
     [2 of 8] Compiling Data.Convertible.Utils ( Data/Convertible/Utils.hs, 
 dist/build/Data/Convertible/Utils.o )
     [3 of 8] Compiling Data.Convertible.Instances.Map ( 
 Data/Convertible/Instances/Map.hs, 
 dist/build/Data/Convertible/Instances/Map.o )
     [4 of 8] Compiling Data.Convertible.Instances.Num ( 
 Data/Convertible/Instances/Num.hs, 
 dist/build/Data/Convertible/Instances/Num.o )
     [5 of 8] Compiling Data.Convertible.Instances.C ( 
 Data/Convertible/Instances/C.hs, dist/build/Data/Convertible/Instances/C.o )
     [6 of 8] Compiling Data.Convertible.Instances.Time ( 
 Data/Convertible/Instances/Time.hs, 
 dist/build/Data/Convertible/Instances/Time.o )

     Data/Convertible/Instances/Time.hs:61:9:
         Duplicate instance declarations:
           instance Typeable NominalDiffTime
             -- Defined at Data/Convertible/Instances/Time.hs:61:9-32
           instance Typeable NominalDiffTime
             -- Defined in time-1.1.3:Data.Time.Clock.UTC

     Data/Convertible/Instances/Time.hs:64:9:
         Duplicate instance declarations:
           instance Typeable UTCTime
             -- Defined at Data/Convertible/Instances/Time.hs:64:9-24
           instance Typeable UTCTime
             -- Defined in time-1.1.3:Data.Time.Clock.UTC
     cabal: Error: some packages failed to install:
     HDBC-2.1.0 depends on convertible-1.0.1 which failed to install.
     convertible-1.0.1 failed during the building phase. The exception was:



 ___
 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] ghc ./configure stalls on docbook DTD

2009-05-21 Thread Duncan Coutts
On Mon, 2009-05-18 at 12:09 +0100, Simon Marlow wrote:

 I have the following complaint from Roman in my inbox, which I think is 
 about the same thing:
 
   one big nuisance when building ghc is that configure tries to connect 
   to the internet. The culprit is the FP_GEN_DOCBOOK_XML macro in
   aclocal.m4 which is used when checking for DocBook DTD. It generates
   an XML file which references http://www.oasis-open.org/docbook/xml/4.2
   /docbookx.dtd and then runs xmllint which, naturally, wants to load
   the dtd. Depending on the quality of my internet connection and on
   the availability of oasis-open.org this check sometimes (infrequently
   but very annoyingly) takes up to a 2 or 3 minutes for me. Given that
   the DTD in question can be freely copied, why not redistribute it
   with ghc?
 
   Another www reference is in FP_GEN_FO (to
   http://www.w3.org/1999/XSL/Format) but that never seems to bite me.
 
 I know almost but not quite exactly nothing about how to find DTDs.  But 
 I do recall that Duncan mentioned to me recently that there's a much 
 better way to do this - Duncan?

Oh, yes, use --nonet to both xmllint and xsltproc. That's what we do for
the Cabal user guide which is still using xml docbook, along with:

?xml version=1.0 encoding=US-ASCII?
!DOCTYPE article PUBLIC -//OASIS//DTD DocBook XML V4.2//EN
  http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd; 

I expect the uri -//OASIS//DTD DocBook XML V4.2//EN is required so
that it can match the uri in the local catalog.

Duncan

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


Re: [Haskell-cafe] Introducing Instances in GHC point releases

2009-05-21 Thread Duncan Coutts
On Thu, 2009-05-21 at 15:22 -0700, Alexander Dunlap wrote:
 Since those types come out of the time library, and that library's
 version *has* been bumped (I assume), couldn't you use Cabal to
 condition on the version of the time library to determine whether or
 not to have CPP set a -DTYPEABLE_IN_TIME flag, and then #ifdef out
 your versions of the instances?

I was about to suggest this:

#if MIN_VERSION_time(1,1,2)
...
#endif

because Cabal 1.6+ generates these cpp macros for you. Note that relying
on the value of __GLASGOW_HASKELL__ would be wrong because the version
of the time library is not directly related to the version of ghc.

However, I note that all the recent versions of time are 1.1.2.x which
means it didn't bump the API version when it added the instances. 

The PVP says:

A.B is known as the major version number, and C the minor
version number. When a package is updated, the following rules
govern how the version number must change relative to the
previous version:

 1. If any entity was removed, or the types of any entities
or the definitions of datatypes or classes were changed,
or instances were added or removed, then the new A.B
must be greater than the previous A.B.

Duncan

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


[Haskell-cafe] HUnit

2009-05-21 Thread Vasili I. Galchin
Hello,

I have some code with several test cases that use HUnit. I added hunit
as one of my cabal dependencies but cabal complained with:

Setup: At least the following dependencies are missing:
hutil -any

What am I doing incorrectly?

Thanks,

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


Re: [Haskell-cafe] HUnit

2009-05-21 Thread Don Stewart
vigalchin:
 Hello,
 
 I have some code with several test cases that use HUnit. I added hunit as
 one of my cabal dependencies but cabal complained with:
 
 Setup: At least the following dependencies are missing:
 hutil -any
  ^

Typo.

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


[Haskell-cafe] generic filter through MonadPlus

2009-05-21 Thread Jason Dusek
  It seems reasonable that filter should be generic. The
  underlying container need only support some kind of traversal,
  a zero element and a concatenation that eliminates zeroes.

  A `Monad` provides traversal via `join` and `fmap`; the
  remaining qualities are satisfied by `MonadPlus`. I've put
  together an implementation of `filter` for `MonadPlus` that
  works well enough for lists (though it presents somewhat
  greater obstacles to efficient compilation).

  I'm not sure whether `filter` is important enough to warrant
  its own generics package -- it's one of many collection
  operations that need to be generified. I'd like to know what
  folks think about the use of `MonadPlus` in this case.

--
Jason Dusek


 |...an implementation of `filter`...|
  
http://github.com/jsnx/genfil/blob/246026b975ec13587186681b7b346ae1e440d0c9/Data/Filter.hs
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Introducing Instances in GHC point releases

2009-05-21 Thread John Goerzen
Duncan Coutts wrote:
 On Thu, 2009-05-21 at 15:22 -0700, Alexander Dunlap wrote:
 Since those types come out of the time library, and that library's
 version *has* been bumped (I assume), couldn't you use Cabal to
 condition on the version of the time library to determine whether or
 not to have CPP set a -DTYPEABLE_IN_TIME flag, and then #ifdef out
 your versions of the instances?
 
 I was about to suggest this:
 
 #if MIN_VERSION_time(1,1,2)
 ...
 #endif

That would be slick.  I'll give that a whirl.  What version of Cabal
does GHC 6.8 come from, and where can I read about the above feature?  I
imagine I may have to wrap the above in a __GLASGOW_HASKELL__ test for
GHC 6.8 or something.

Though if *cabal* and not GHC generates it, isn't that a bit hurting to
my portability?  (Can't just ghc --make with it, or ghci on it directly
anymore, etc.)

May be a needed tradeoff though.

 
 because Cabal 1.6+ generates these cpp macros for you. Note that relying
 on the value of __GLASGOW_HASKELL__ would be wrong because the version
 of the time library is not directly related to the version of ghc.

Yeah, but when you've got nothing else to go on, it sometimes works in a
pinch.

 However, I note that all the recent versions of time are 1.1.2.x which
 means it didn't bump the API version when it added the instances. 

Ashley, I'll forgive you this time ;-)

I guess my larger point is just a plea to the community: please be
really careful about what you do to GHC in point releases.  This is not
the first issue that has screwed me in the GHC 6.10.x point releases.

GHC (and the community) used to be really good about this.  Is there
something causing a regression here, or is it my imagination?


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


Re: [Haskell-cafe] Introducing Instances in GHC point releases

2009-05-21 Thread Don Stewart
 I guess my larger point is just a plea to the community: please be
 really careful about what you do to GHC in point releases.  This is not
 the first issue that has screwed me in the GHC 6.10.x point releases.

I hope that the Haskell Platform will solve a lot of these issues.
Clear, planned releases. Careful attention to versioning. And GHC can
stop shipping custom lib variants, and instead just take the latest
platform bundle.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] A problem with par and modules boundaries...

2009-05-21 Thread Mario Blažević
I'll cut to the chase. The short program below works perfectly: when I compile 
it
with -O2 -threaded and run with +RTS -N2 command-line options, I get a nearly 
50%
real-time improvement:

$ time ./primes-test +RTS -N2
5001

real0m9.307s
user0m16.581s
sys 0m0.200s

However, if I move the `parallelize' definition into another module and import
that module, the performance is completely lost:

$ time ./primes-test +RTS -N2
5001

real0m15.282s
user0m15.165s
sys 0m0.080s

I'm confused. I know that `par` must be able work across modules boundaries,
because Control.Parallel.Strategies is a module and presumably it works. What am
I doing wrong?


 module Main where
 
 import Control.Parallel
 import Data.List (find)
 import Data.Maybe (maybe)
 
 --import Parallelizable
 parallelize a b = a `par` (b `pseq` (a, b))
 
 test :: Integer - Integer - Integer
 test n1 n2 = let (p1, p2) = parallelize
(product $ factors $ product [1..n1])
(product $ factors $ product [1..n2])
  in p2 `div` p1
 
 factors n = maybe [n] (\k- (k : factors (n `div` k)))
   (find (\k- n `mod` k == 0) [2 .. n - 1])
 
 main = print (test 5000 5001)


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


Re: [Haskell-cafe] HUnit

2009-05-21 Thread Vasili I. Galchin
my bad ... what about:

vigalc...@ubuntu:~/FTP/Haskell/Swish-0.2.1$ cabal configure
Configuring swish-0.2.1...
cabal: At least the following dependencies are missing:
hunit -any


On Thu, May 21, 2009 at 6:20 PM, Don Stewart d...@galois.com wrote:

 vigalchin:
  Hello,
 
  I have some code with several test cases that use HUnit. I added
 hunit as
  one of my cabal dependencies but cabal complained with:
 
  Setup: At least the following dependencies are missing:
  hutil -any
   ^

 Typo.

 -- Don

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


[Haskell-cafe] Re: ANN: TxtSushi 0.1

2009-05-21 Thread Keith Sheppard
Hello,

I just released TxtSushi 0.2 with the following updates:

1) Improved type coercion. Some of the rules I was using before did
not make sense. At some point I will document what the rules are.
2) Added some extra functions/operators including a regex matcher.
Here is the full list: SUBSTRING, UPPER, LOWER, TRIM, *, /, +, -
(binary and unary), =,  (not equal test), , =, , =, AND, OR, ||
(string concatination), =~ (regex matching)

I expect updates to be pretty frequent (at least pre-1.0) so in order
to avoid spamming you all with my announcements I'll just announce
major updates from now on and if you want to follow progress more
closely I'll post all updates to this feed.

http://blog.keithsheppard.name/feeds/posts/default/-/TxtSushi

Thanks,
Keith

On Sun, May 17, 2009 at 11:07 AM, Keith Sheppard keiths...@gmail.com wrote:
 Hello Haskell Cafe

 I have released the first version of TxtSushi which is a collection of
 command line utils (written in haskell of course) for processing
 tab-delimited and CSV files. It includes a util for doing SQL SELECTs
 on flat files. This is my first haskell project and feedback of all
 kinds is appreciated.

 Home Page: http://www.keithsheppard.name/txt-sushi
 Darcs Repository: http://patch-tag.com/r/txt-sushi/home
 Issue Tracking: http://code.google.com/p/txt-sushi

 I would like to say thanks to the haskell-beginners contributors, the
 author of Learn you a Haskell and the author of the parsec library
 all of which were very helpful.

 Regards
 Keith

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


Re: [Haskell-cafe] HUnit

2009-05-21 Thread Alexander Dunlap
I believe you need to capitalize it correctly: HUnit.

Alex

On Thu, May 21, 2009 at 8:52 PM, Vasili I. Galchin vigalc...@gmail.com wrote:
 my bad ... what about:

 vigalc...@ubuntu:~/FTP/Haskell/Swish-0.2.1$ cabal configure
 Configuring swish-0.2.1...
 cabal: At least the following dependencies are missing:
 hunit -any


 On Thu, May 21, 2009 at 6:20 PM, Don Stewart d...@galois.com wrote:

 vigalchin:
  Hello,
 
      I have some code with several test cases that use HUnit. I added
  hunit as
  one of my cabal dependencies but cabal complained with:
 
  Setup: At least the following dependencies are missing:
  hutil -any
  ^

 Typo.

 -- Don


 ___
 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] the problem of design by negation

2009-05-21 Thread Conal Elliott
Hi Michael,

I'm going to hazard a guess.  Please let me know how accurate it is.

When asked to justify his design, the lead software architect explains
 everything that *wouldn't* work. We couldn't have a unique key for every
 entry because blah blah blah. We couldn't use a garbage collector because
 blah blah. We couldn't write a sugar layer because then you have to document
 it separately blah blah. So the chosen design seems to be the only thing
 left after eliminating everything you can't do.


My guess is that your software architect is making flimsy arguments.  It's
usually very difficult to prove that something *wouldn't* work.  In my
experience, people make blanket statements about what cannot work, when the
truth is that they just don't know how and don't have the imagination or
will even to entertain the possibility of ways that they can't yet see.
Instead of using logic and evidence, these people bolster their claims
(often mistakenly called arguments) by putting across confident language
(obviously, clearly, without a doubt), body posture, facial
expression, and voice tone.  When someone is on solid ground, these bravado
tactics are unnecessary.  (I think of obviously, etc as words that are
useful only when inaccurate.  See
http://conal.net/blog/posts/fostering-creativity-by-relinquishing-the-obvious/.)

One flimsy argument I often hear is It wouldn't work because how ..., or
because what   As if a question were an argument.  I call this rather
popular tactic proof by ignorance or proof by lack of imagination. I
don't know where people get the idea that this sort of thing is rational.
If I'm ever tempted to give it any weight, I think of Arthur Hoppe's proof
of the existence of God: If there's no God, then who pops up the next
kleenex?

Some of my favorite quotes on this dynamic:

Doubt is not a pleasant condition, but certainty is absurd. - Voltaire

They are ill discoverers that think there is no land, when they can see
nothing but sea. - Francis Bacon

To be positive: To be mistaken at the top of one's voice. Ambrose
Bierce

The greatest obstacle to discovering the shape of the earth, the
continents, and the oceans was not ignorance but the illusion of knowledge.
- Daniel J. Boorstin

advice
One thing you may try is to ask the architect for evidence and/or logical
proof of his claims that something cannot work.  As much as you can, ask
from a place of curiosity and even awe.  After all, existence can often be
proved by demonstrating an example, while non-existence proofs tend to be
much more profound.  And stick to your open-minded disbelief until you
really see evidence or logical rigor.  If the architect gets flustered and
embarrassed, he may well go on the attack.  After all, bravado signals weak
ego, which can quickly become a cornered animal.  So pay attention to his
stress level, and help his salvage his ego, by suggesting he let you know
more about the evidence and/or logic when he's worked it out.  Be careful to
stay in your integrity, neither going along with someone's forcefulness, nor
representing yourself as having more grounds for confidence than you really
do.
/advice

Whether or not my guess is accurate or my advice relevant, good luck!  I'd
love to hear how this situation develops.

   - Conal


On Wed, May 20, 2009 at 3:54 PM, Michael Mossey m...@alumni.caltech.eduwrote:

 This is not directly related to Haskell, but it's a thought that occurred
 to me after exposure to the Haskell community.

 I've spent most of the past 15 years doing scientific programming. The lead
 software architect and software managers are using good software engineering
 practice, though (this is *scientific* programming, not *programming by
 scientists*, ha ha). But, there is a particular culture in my company that
 has become more obvious to me by contrast to the Haskell community.

 I call it design by negation. When asked to justify his design, the lead
 software architect explains everything that *wouldn't* work. We couldn't
 have a unique key for every entry because blah blah blah. We couldn't use a
 garbage collector because blah blah. We couldn't write a sugar layer because
 then you have to document it separately blah blah. So the chosen design
 seems to be the only thing left after eliminating everything you can't do.

 I want to aspire to positive design. I want to list the goals, and think
 of design as making clever choices that meet all the goals.

 I don't mean to suggest that design is never constrained. It often is. But
 it's a mindset I'm talking about. I don't like this mindset of design by
 negation.

 -Mike
 ___
 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