Re: [GHC] #2953: deriving Functor, Foldable, Traversable

2009-01-18 Thread GHC
#2953: deriving Functor, Foldable, Traversable
--+-
 Reporter:  twanvl|  Owner:  twanvl  
 Type:  feature request   | Status:  new 
 Priority:  normal|  Milestone:  
Component:  Compiler  |Version:  6.11
 Severity:  normal| Resolution:  
 Keywords:|   Testcase:  
   Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
--+-
Comment (by twanvl):

 Deriving Foldable and Traversable instances is now also possible. The code
 is very similar, so I abstracted it a bit.

 The patch is still too large to attach, it can be found at
 [http://twan.home.fmf.nl/files/deriving-functor3.patch.gz].

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/2953#comment:3
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #2953: deriving Functor, Foldable, Traversable

2009-01-18 Thread GHC
#2953: deriving Functor, Foldable, Traversable
--+-
 Reporter:  twanvl|  Owner:  igloo   
 Type:  feature request   | Status:  new 
 Priority:  normal|  Milestone:  
Component:  Compiler  |Version:  6.11
 Severity:  normal| Resolution:  
 Keywords:|   Testcase:  
   Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
--+-
Changes (by twanvl):

  * owner:  twanvl = igloo

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/2953#comment:4
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #1377: GHCi debugger tasks

2009-01-18 Thread GHC
#1377: GHCi debugger tasks
-+--
Reporter:  simonmar  |Owner:  
Type:  task  |   Status:  new 
Priority:  normal|Milestone:  6.10 branch 
   Component:  GHCi  |  Version:  6.7 
Severity:  normal|   Resolution:  
Keywords:|   Difficulty:  Unknown 
Testcase:|   Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |  
-+--
Changes (by mnislaih):

 * cc: mnisl...@gmail.com (added)

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/1377#comment:6
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: Build difficulties with HEAD

2009-01-18 Thread Conal Elliott
Worked for me this time.  Thanks!

On Wed, Jan 14, 2009 at 2:29 PM, Ian Lynagh ig...@earth.li wrote:

 On Sun, Jan 11, 2009 at 09:42:22AM -0800, Conal Elliott wrote:
  Thanks, Ian.  That tweak helped.  Now make succeeds, but sudo make
  install dies, as shown below.   - Conal
 
 
 /home/conal/downloads/ghc-6.11.20090109/utils/ghc-pkg/dist-install/build/ghc-pkg/ghc-pkg
  --global-conf /usr/local/lib/ghc-6.11.20090109/package.conf update -
 --force
  ghc-pkg: /usr/local/lib/ghc-6.11.20090109/package.conf: openFile: does
 not
  exist (No such file or directory)

 Now fixed.


 Thanks
 Ian


___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #2962: Reduce space usage of genericLength for common Num instances

2009-01-18 Thread GHC
#2962: Reduce space usage of genericLength for common Num instances
--+-
 Reporter:  thorkilnaur   |  Owner:  thorkilnaur 
 Type:  bug   | Status:  new 
 Priority:  normal|  Milestone:  
Component:  libraries/base|Version:  6.11
 Severity:  normal| Resolution:  
 Keywords:|   Testcase:  
   Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
--+-
Changes (by thorkilnaur):

  * owner:  = thorkilnaur
  * summary:  Fix space leak in genericLength = Reduce space usage of
  genericLength for common Num instances

Comment:

 Thank you very much. I will look into this.

 Best regards
 Thorkil

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/2962#comment:2
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Questions regarding uvector 0.1.0.3

2009-01-18 Thread Tyson Whitehead
I've been looking at uvector and had some questions (hopefully this is the 
right mailing list for this, if not, sorry, and please direct me properly).

First, is there any design thing deeper than just supporting things like the 
unit and pair arrays for layering UArr on top of the underlying BUArr?

Second, the STG code and the native and via-C assembler generated by ghc 6.8.2 
with -O2 for

test :: UArr Int - Int - Int
test = indexU

where

indexU :: UA e = UArr e - Int - e
indexU arr n = indexS (streamU arr) n

is a loop that simultaneously increments the offset while decrementing the 
index until it reaches the desired position.

If I understand correctly, this indexU definition was used instead of just 
bring indexU from UArr into scope in order to cancel any possible unstreamU in 
arr, and this is a big part of the whole streamU/unstreamU magic.  It replaces 
what would other require N^2 rules to avoid a bunch of temporaries with one.

I wonder if a rule code be added to change any outstanding indexS (streamU 
arr) n into an UArr indexU after streamU/unstreamU fusion?  Such rules for 
each of these type of functions (i.e., ones that aren't of the form = 
unstreamU . ...) would also not be N^2 and would eliminate temporary streams.

Thanks!  -Tyson

PS:  Nice code by the way.  : )



signature.asc
Description: This is a digitally signed message part.
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


[Haskell] How to define gunfold on List?

2009-01-18 Thread haihualin
Hi,

Does some one know how to define gunfold on recursive data struction like List?

The ghc doc only give the example for non-recursive data like below.

 data T a b = C1 a b | C2 deriving (Typeable, Data)

GHC will generate an instance that is equivalent to

 instance (Data a, Data b) = Data (T a b) where
 gfoldl k z (C1 a b) = z C1 `k` a `k` b
 gfoldl k z C2   = z C2

 gunfold k z c = case constrIndex c of
 1 - k (k (z C1))
 2 - z C2

 toConstr (C1 _ _) = con_C1
 toConstr C2   = con_C2

 dataTypeOf _ = ty_T

 con_C1 = mkConstr ty_T C1 [] Prefix
 con_C2 = mkConstr ty_T C2 [] Prefix
 ty_T   = mkDataType Module.T [con_C1, con_C2]



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


Re: [Haskell] How to define gunfold on List?

2009-01-18 Thread José Pedro Magalhães
Hi there,

There's no difference. See
http://hackage.haskell.org/packages/archive/base/4.0.0.0/doc/html/src/Data-Data.html#line-1034

You can also see many other instances there.


Cheers,
Pedro

On Sun, Jan 18, 2009 at 10:50, haihualin haihua...@163.com wrote:

 Hi,

 Does some one know how to define gunfold on recursive data struction like
 List?

 The ghc doc only give the example for non-recursive data like below.

  data T a b = C1 a b | C2 deriving (Typeable, Data)

 GHC will generate an instance that is equivalent to

  instance (Data a, Data b) = Data (T a b) where
 gfoldl k z (C1 a b) = z C1 `k` a `k` b
 gfoldl k z C2   = z C2

 gunfold k z c = case constrIndex c of
 1 - k (k (z C1))
 2 - z C2

 toConstr (C1 _ _) = con_C1
 toConstr C2   = con_C2

 dataTypeOf _ = ty_T

  con_C1 = mkConstr ty_T C1 [] Prefix
  con_C2 = mkConstr ty_T C2 [] Prefix
  ty_T   = mkDataType Module.T [con_C1, con_C2]



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

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


[Haskell] ICLP 2009: Call for workshop proposals

2009-01-18 Thread cfp

 *** CALL FOR WORKSHOP PROPOSALS ***

  ICLP 2009
   
 25th International Conference on Logic Programming

  Pasadena, California, USA
   July 14-17, 2009

  URL: http://www.ist.unomaha.edu/iclp2009/



ICLP 2009, the 25th International Conference on Logic Programming,
will
be held in Pasadena (USA), from July 14 to 17, 2009.

Workshops  co-located with  international conferences  are one  of the
best venue  for the presentation  and discussion of  preliminary work,
novel ideas, and new open  problems to a wide and interested audience.
Co-located  workshops  also  provide  an  opportunity  for  presenting
specialized  topics and  opportunities for  intensive  discussions and
project collaboration.   The topics  of the workshops  co-located with
ICLP 2009  can cover  any areas related  to logic  programming, (e.g.,
theory,  implementation,  environments,  language issues,  alternative
paradigms,   applications),including   cross-disciplinary   areas.
However, any workshop proposal will be considered.

The format of the workshop will be decided by the workshop organizers,
but ample time  must be allowed for general  discussion. Workshops can
vary in length, but the optimal duration  will be half a day or a full
day.


Workshop Proposal:
==

Those interested in organizing a workshop at ICLP 2009 are invited
to submit a workshop proposal. Proposals should be in English and
about two pages in length. They should contain:

  * The title of the workshop.

  * A  brief  technical  description  of  the topics  covered  by  the
workshop.

  * A discussion of the timeliness and relevance of the workshop.

  * A list of some related workshops held in the last years.

  * The  (preliminary) required  number of  half-days allotted  to the
workshop and an estimate of the number of expected attendees.

  * The  names, affiliation,  and  contact details  (email, web  page,
phone,  fax)   of  the  workshop  organizer(s)   together  with  a
designated contact person.

  * The previous  experience of  the workshop organizing  committee in
workshop/conference organization.

Proposals are expected in ASCII or PDF format. All proposals should be
submitted to  the Workshop Chair  (Manuel Carro) by email  by February
9th, 2009.


Reviewing Process:
==

Each submitted  proposal is  reviewed by the  Workshops Chair  and the
Conference  Program Chairs. Proposals  that appear  well-organized and
that fit the  goals and scope of ICLP will  be selected.  The decision
will be  notified by  email to the  responsible organizer  by February
23rd, 2009.

The definitive length of the workshop will be planned according to the
number of submissions received  by the different workshops.  For every
accepted workshop,  the ICLP local  organizers will prepare  a meeting
place and arrange the  distribution of the workshop proceedings, whose
preparation  is however  in charge  to the  workshop  organizers.  The
workshop  registration   fees  will  be  handled   together  with  the
conference fees.


Workshop Organizers' Tasks:
===

  * Producing a Call  for Papers for the workshop  and posting it on
the net and/or  other means.  Please provide a  web page URL which
can be linked into the ICLP 2009 home page by March 9th, 2009.

  * Providing a brief description of the workshop for the conference
program.

  * Reviewing/accepting submitted papers.

  * Scheduling workshop activities in collaboration with the local
organizers and the workshop chair.

  * Sending workshop program and workshop proceedings in pdf format to
the workshop chair for distribution at the conference.

  * The  use  of the  Computing  Research  Repository  (CoRR) for  the
workshop proceedingsis strongly suggested. See
http://www.logicprogramming.org/  for  guidelines.   We  encourage
reading these  instructions in advance  so that you can  ask paper
authors to prepare accordingly the final versions of their papers.


Location:
=

All workshops will take place in Pasadena at the site of the main
conference. See the ICLP 2009 web site for location details.


Important Dates:


February  9,   2009: Proposal submission deadline.
February 23,   2009: Notification.
March 9,   2009: Deadline to receive the CFP and URL for the web
 page of the workshop
June  1,   2009: Deadline for preliminary proceedings.
July  14-17,   2009: ICLP 2009 workshops.


Workshop Chair:
===

Manuel Carro  [mcarro AT fi dot upm dot es] (www.clip.dia.fi.upm.es/~mcarro)
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] ANNOUNCE: Turbinado V0.4

2009-01-18 Thread Alson Kemp
Turbinado (http://www.turbinado.com) is an easy to use
Model-View-Controller-ish web framework for Haskell.

The source for the framework can be found at:
 http://github.com/alsonkemp/turbinado

The source for the website turbinado.org can be found at:
 http://github.com/alsonkemp/turbinado-website
   (see the /App directory for the code for www.turbinado.org)

Release 0.4 contains:
  * A dramatically improved ORM (or Type-Relation Mapper) which
handles foreign keys.  Still PostgreSQL only at this point.
  * All dependencies in tmp/dependencies to ease building the application.
  * In code documentation (not complete, but starting).
  * Documentation (see http://turbinado.org/Architecture).

Release 0.5 will focus on:
  * Ease of installation!
  * Moving to GHC 6.10 (whenever Debian shifts).  Diego Eche provided
a port from plugins to ghc-api.
  * Additional functionality (e.g. sessions, authentication, etc).
  * Tutorials.
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] ANNOUNCE: Turbinado V0.4

2009-01-18 Thread Sebastian Sylvan

--
From: Alson Kemp al...@alsonkemp.com
Sent: Sunday, January 18, 2009 6:06 PM
To: haskell@haskell.org
Subject: [Haskell] ANNOUNCE: Turbinado V0.4


Turbinado (http://www.turbinado.com) is an easy to use
Model-View-Controller-ish web framework for Haskell.


You mean http://www.turbinado.org ? 


:-)


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


[Haskell] Re: ANNOUNCE: Turbinado V0.4

2009-01-18 Thread Alson Kemp
Turbinado (http://www.turbinado.com) is an easy to use
Oops.  That should be !! http://www.turbinado.org. !!

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


[Haskell] Re: HaskellWiki Update

2009-01-18 Thread Benjamin L . Russell
On Sat, 17 Jan 2009 20:47:39 -0800, Ashley Yakeley
ash...@semantic.org wrote:

There has been a lot of spam on HaskellWiki. Since anonymous edits have 
been switched off, a spammer tactic has been to create hundreds of 
accounts to evade individual account blocks.

To combat this, I have

1. deleted all user accounts that have made no edits;
2. switched off account creation;
3. blocked at least some of the remaining spam accounts.

This is obviously not ideal, as there is now no way for new users to 
edit the wiki. I will investigate appropriate ways to allow account 
creation.

Instead of switching off all new account creation, perhaps you could
shut off account creation/access for just those domains for which
spammers have been creating accounts?

-- Benjamin L. Russell
-- 
Benjamin L. Russell  /   DekuDekuplex at Yahoo dot com
http://dekudekuplex.wordpress.com/
Translator/Interpreter / Mobile:  +011 81 80-3603-6725
Furuike ya, kawazu tobikomu mizu no oto. 
-- Matsuo Basho^ 

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


[Haskell] ANN: curl-1.3.4

2009-01-18 Thread Sigbjorn Finne

Hi,

a new version 'curl', a complete Haskell binding to the libcurl API,
is now available and have been uploaded to Hackage:

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

Git repo at  git://code.galois.com/curl.git

Appended is the list of changes since the previous release.
Most notable is the overloading of representation of response
buffers (and headers), allowing for the use of ByteStrings.
Speedups might be had as a result...

enjoy
--sigbjorn


Version 1.3.4: released 2009-01-18; changes from 1.3.3

 * Overloaded Network.Curl operations over response representation
   of payloads and headers. Controlled via CurlBuffer and CurlHeader
   classes. New actions:
  - curlGetString_, curlGetResponse_,
perform_with_response_, do_curl_, curlHead_

 * Provided ByteString instances (strict and lazy)
 * No modification in calling interface to existing exports,
   so backwards compatible.
 * Added Show instance for Network.Curl.Opts.CurlOption
 * curl_version_string, curl_version_number now gives you access
   to version info of underlying lib you _compiled_ the package with.
 * Sync'ed wrt libcurl-7.19.2, so bunch of new options added to
   Network.Curl.Opts. Use version functions to determine if they
   are supported though.


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


Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-18 Thread Robin Green
On Sun, 18 Jan 2009 08:51:10 +0100
david48 dav.vire+hask...@gmail.com wrote:

 On Sat, Jan 17, 2009 at 11:19 PM, Dan Piponi dpip...@gmail.com
 wrote:
  On Sat, Jan 17, 2009 at 1:47 AM, david48
  dav.vire+hask...@gmail.com wrote:
 
  why would I
  need to write a running count this way instead of, for example, a
  non monadic fold, which would probably result in clearer and
  faster code?
 
  Maybe my post here will answer some questions like that:
  http://sigfpe.blogspot.com/2009/01/haskell-monoids-and-their-uses.html
 
 Just wow. Very very nice post. one to keep in the wikis.
 Thank you *very* much, Dan, for writing this.

Seconded. And I hope, Dan, that you will find time at some point to
write about those other things you said at the end that you didn't have
time to write about!

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


[Haskell-cafe] Re: Functors [Comments from OCaml Hacker Brian Hurt]

2009-01-18 Thread Heinrich Apfelmus
Andrew Coppin wrote:
 instance (Monad m) = Functor m where
   fmap f ma = do a - ma; return (f a)
   
 
 While that's quite interesting from a mathematical point of view, how is
 this useful for programming purposes?

Surely, you agree that  liftM  is useful? Because that's the same thing.


Regards,
apfelmus

-- 
http://apfelmus.nfshost.com

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


Re: [Haskell-cafe] Re: Comments from OCaml Hacker Brian Hurt

2009-01-18 Thread wren ng thornton

John Lato wrote:

Here is the current complete documentation for Data.Monoid 'mappend',
which happens to be a good example of which I speak:

An associative operation

That could mean anything.  There are lots of associative operations.


Yes. In combination with the definition of mempty (the identity for 
mappend) that's exactly what a monoid is.



I'm not (just) being flippant. This particular example actually 
highlights the limitations of type classes. There are, in fact, too many 
monoids. Too many to be able to define it based only on the carrier, 
i.e. the type that mempty belongs to and that mappend operates over. For 
example every (semi-)ring has at least two of them[1]. For more 
complicated mathematical structures there can be even more than that. 
This isn't to say that we should get rid of Monoid, just that using it 
can be... troublesome. But this has been mentioned already on a few 
other recent threads.


The notion of appending only really applies to the free monoid on a set 
A, aka strings of elements drawn from A. It bears highlighting that I 
said strings (in the mathematical sense) and not (linked) lists. The 
concatenation involved is mathematical juxtaposition, and the empty 
element is the empty string (which is subtly different than the empty 
list which is also used to terminate the datatype's recursion). These 
monoids are called free because they make no requirements on the 
underlying set, no requirements other than the monoid laws. All other 
monoids use some sort of structure in the underlying set in order to 
simplify expressions (e.g. 1+1 == 2, whereas a+a == aa). Because the 
free monoid doesn't simplify anything, all it does is append.



[1] For example,
Natural numbers:
(Nat,+,0)
(Nat,*,1)
Boolean algebra:
(Bool,or,False)
(Bool,and,True)
Bit-vector algebra:
(Bits,bitOr,0)
(Bits,bitAnd,-1)
Any lattice L:
(L,join,Bottom)
(L,meet,Top)
Any total ordering O:
(O,max,NegativeInfinity)
(O,min,Infinity)
Any set universe U:
(Power(U),union,EmptySet)
(Power(U),intersection,U)
...let alone getting into fun things like the log-semiring, polynomials 
with natural coefficients, and so on.


--
Live well,
~wren
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Comments from OCaml Hacker Brian Hurt

2009-01-18 Thread Heinrich Apfelmus
Paul Moore wrote:
 Apfelmus, Heinrich wrote:

 How to learn? The options are, in order of decreasing effectiveness

  university course  teacher in person
  book   irc
 mailing list
  online tutorial
  haskell wiki
  haddock documentation
 
 Reason by analogy from known/similar areas. I think the point here is
 that for Haskell, this is more possible for mathematicians than for
 programmers. And that's an imbalance that may need to be addressed
 (depending on who you want to encourage to learn).

 But I agree that reasoning by analogy is not a very good way of
 learning. And I think it's been established that the real issue here
 is the documentation - complete explanations and better
 discoverability[1] are needed.

Yes, agreed. However, I would say that the word documentation does not
apply anymore, it's more subject of study. What I want to say is that
to some extend, Haskell is not only similar to mathematics, it /is/
mathematics, so programmers have to learn mathematics. Traditionally,
this is done in university courses or with books, I'm not sure whether
learning mathematics via internet tutorials on the computer screen works.


Regards,
apfelmus

-- 
http://apfelmus.nfshost.com

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


Re: [Haskell-cafe] Slow Text.JSON parser

2009-01-18 Thread Levi Greenspan
On Sun, Jan 18, 2009 at 6:07 AM, Sigbjorn Finne
sigbjorn.fi...@gmail.com wrote:

 Maybe. Handling the common cases reasonably well is
 probably worth doing first (+profiling) before opting for
 a heartlung transplant..

 To wit, I've trivially improved the handling of string and
 integer lits in version 0.4.3 (just released.) It cuts down
 the running times by a factor of 2-3 on larger inputs --

Indeed, I have just tried version 0.4.3 and my previous test which
took about 3 seconds to run is now running in about one second. Very
nice improvement. Thanks for all your work Sigbjorn.

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


Re: [Haskell-cafe] Re: Functors [Comments from OCaml Hacker Brian Hurt]

2009-01-18 Thread Andrew Coppin

Heinrich Apfelmus wrote:

Andrew Coppin wrote:
  

instance (Monad m) = Functor m where
  fmap f ma = do a - ma; return (f a)
  
  

While that's quite interesting from a mathematical point of view, how is
this useful for programming purposes?



Surely, you agree that  liftM  is useful? Because that's the same thing.
  


Then why not just use liftM? (That way, you know what it does...)

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


[Haskell-cafe] Re: Functors [Comments from OCaml Hacker Brian Hurt]

2009-01-18 Thread Heinrich Apfelmus
Andrew Coppin wrote:
 Heinrich Apfelmus wrote:
 Andrew Coppin wrote:
  
 instance (Monad m) = Functor m where
   fmap f ma = do a - ma; return (f a)
 
 While that's quite interesting from a mathematical point of view, how is
 this useful for programming purposes?
 

 Surely, you agree that  liftM  is useful? Because that's the same
 thing.
   
 
 Then why not just use liftM? (That way, you know what it does...)

   liftM (*1) [1..10]

 = [2,4,6,8,10,12,14,16,18,20]


Regards,
apfelmus

-- 
http://apfelmus.nfshost.com

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


Re: [Haskell-cafe] Re: Comments from OCaml Hacker Brian Hurt

2009-01-18 Thread Andrew Coppin

Ertugrul Soeylemez wrote:

Andrew Coppin andrewcop...@btinternet.com wrote:

  

I would suggest that ExistentiallyQuantifiedTypeVariables would be an
improvement [...]



That must be a joke.  Typing the long extension names in LANGUAGE
pragmas over and over again is tiring and annoying enough already.  We
really don't need even longer names, and your improvement fills up
almost half of the width of an 80 characters terminal.
  


Which is why I personally prefer HiddenTypeVariables. (This has the 
advantage of using only pronouncible English words, which means you can 
use it when speaking out loud.)


But, as I say, nobody is going to rename anything, so it's moot.


I can't await the next Haskell standard, where at last all those
extensions are builtin.


This frightens me.

At the moment, I understand how Haskell 98 works. There are lots of 
extensions out there, but I don't have to care about that because I 
don't use them. If I read somebody else's code and it contains a 
LANGUAGE pragma, I can immediately tell that the code won't be 
comprehendable, so I don't need to waste time trying to read it. But 
once Haskell' becomes standard, none of this holds any more. Haskell' 
code will use obscure lanuage features without warning, and unless I 
somehow learn every extension in the set, I'll never be able to read 
Haskell again! (One presumes that they won't add any extensions which 
actually *break* backwards compatibility, so hopefully I can still 
pretend these troublesome extensions don't exist when writing my own 
code...)


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


Re: [Haskell-cafe] Functors [Comments from OCaml Hacker Brian Hurt]

2009-01-18 Thread Andrew Coppin

Jonathan Cast wrote:

On Sat, 2009-01-17 at 12:04 +, Andrew Coppin wrote:
  



instance (Monad m) = Functor m where
  fmap f ma = do a - ma; return (f a)
  
  
While that's quite interesting from a mathematical point of view, how is 
this useful for programming purposes?



Good Lord.  fmap (as above) is *at least* useful enough to be in the
standard library!  (Control.Monad.liftM).


Given that liftM exists, why is having an identical implementation for 
fmap useful?


The example that leaps out at me is that (=) is identical to concatMap 
within the list monad. But using lists as a monad is a generally useful 
thing to do, and being able to substitute arbitrary monads has obvious 
utility. I'm not seeing how being able to treat something that isn't a 
container as if it was a container is useful.


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


Re: [Haskell-cafe] Functors [Comments from OCaml Hacker Brian Hurt]

2009-01-18 Thread Ryan Ingram
On Sun, Jan 18, 2009 at 3:23 AM, Andrew Coppin
andrewcop...@btinternet.com wrote:
 Given that liftM exists, why is having an identical implementation for fmap
 useful?

For many structures, it's easier to define (=) in terms of fmap and
join.  For these objects, often the generic implementation of liftM
is far less efficient than fmap.

That is to say, given a monad T and these functions:

returnT :: a - T a
fmapT :: (a - b) - T a - T b
joinT :: T (T a) - T a

We can create Haskell instances as follows

instance Functor T where fmap = fmapT
instance Monad T where
   return = returnT
   m = f = joinT (fmap f m)

Then,

liftM f m
 = m = \x - return (f x)
 = joinT (fmapT (\x - return (f x)) m)

Now, we know (by the monad  functor laws) that this is equivalent to
(fmap f m), but it's a lot harder for the compiler to spot that.

The list monad is a great example; I'd expect that using fmap (== map)
in the list monad is significantly more efficient than liftM which
constructs a singleton list for each element of the input and
concatenates them all together.

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


[Haskell-cafe] Optimistic evaluation

2009-01-18 Thread Andrew Coppin

Hi folks.

I just read a rather interesting paper about a fork of GHC that performs 
optimistic evaluation. This shows big wins in some cases.


The authors claim to have implemented this in a fork of GHC and promised 
that it would be integrated into the production compiler in the near 
future. Curios, I investigated the GHC wiki...


Well, let's see now. The front page has links to out release plans for 
6.8.3 and what will be in 6.10. The latter page,


http://hackage.haskell.org/trac/ghc/wiki/Status/Releases

mentions that a beta has just been released... and seems oblivious to 
the fact that 6.10.1 is production now. Clearly, any hopes I might have 
had of getting a handle on the current status of GHC from this wiki were 
dashed somewhat. ;-)


Does anybody have any suggestions for a more reliable way of figuring 
out what the current activities and plans for GHC are?


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


Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-18 Thread Ross Paterson
On Sat, Jan 17, 2009 at 09:12:32PM -0500, a...@spamcop.net wrote:
 And FWIW, I agree with everyone who has commented that the documentation
 is inadequate.  It'd be nice if there was some way to contribute better
 documentation without needing checkin access to the libraries.

There is.  The current state of the docs may be viewed at

http://www.haskell.org/ghc/dist/current/docs/libraries/

Anyone can check out the darcs repos for the libraries, and post
suggested improvements to the documentation to librar...@haskell.org
(though you have to subscribe).  It doesn't even have to be a patch.

Sure, it could be smoother, but there's hardly a flood of contributions.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: Re[2]: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-18 Thread Duncan Coutts
On Sat, 2009-01-17 at 13:36 -0800, David Leimbach wrote:
 
 
 On Sat, Jan 17, 2009 at 9:16 AM, david48 dav.vire+hask...@gmail.com
 wrote:
 On Sat, Jan 17, 2009 at 4:08 PM, David Leimbach
 leim...@gmail.com wrote:
 
  So you're saying it should be better documented in Haskell
 what a Monoid is.
   Did you say you searched for C++ class why not Haskell
 Monoid then?
   The first correct google hit that didn't think I meant
 Monads, takes you
  straight to the GHC documentation for Data.Monoid.
 
 Read my first post on the thread, that's exactly what I did
 ( and then
 complained that the doc for Data.Monoid was close to useless )
 
 
 Sorry missed it!  This is an exceptionally long thread! :-)  I agree
 Data.Monoid's docs don't give you much to work with. 

Do you think they look better now:

http://www.haskell.org/ghc/dist/current/docs/libraries/base/Data-Monoid.html

Any other improvements you'd make?

Duncan

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


Re: [Haskell-cafe] real haskell difficulties (at least for me)

2009-01-18 Thread Duncan Coutts
Interesting and thoughtful, thanks.

I think we need to file these ideas in the hackage trac. They've been
floating about for a while but we need to get them properly recorded.

On Sun, 2009-01-18 at 01:06 -0500, wren ng thornton wrote:

 Minimally these aggregated reports should indicate the package and 
 version, the problem, the Haskell compiler and its version, as well as 
 the OS. Since some packages have many dependencies or make heavy use of 
 the FFI, CPP, or have architecture dependent differences, it would be 
 nice to be able to set per-package preferences to get additional 
 information like OS version, dependency versions, CPU info, build logs, 
 etc.

The information we would collect for anonymous reports would be just:

package: HTTP-4000.0.2
os: linux
arch: x86_64
compiler: ghc-6.10.1
client: cabal-install-0.6.1
flags: -old-base
dependencies: array-0.2.0.0 base-3.0.3.0 bytestring-0.9.1.5
  mtl-1.1.0.2 network-2.2.0.1 parsec-2.1.0.1
install-outcome: InstallOk
docs-outcome: NotTried
tests-outcome: NotTried

This is all machine readable of course so we can aggregate information
from 1000s of reports.

 Since it can be hard to set up sandboxes for every configuration, 
 it'd also be nice if clients could opt in to send contact email as well, 
 if they're willing to back-and-forth with the developer to fix things in 
 the event of bugs.

Non-anonymous reports with build logs will have to be associated with
registered accounts. I expect that would provide a way to get in touch
with some testers. Some of the testers of course will just be automated
build clients.

 Second, and this would take more work, I would like it if the Haddock 
 documentation for packages could be given a wiki-like and/or reddit-like 
 interface so that people could make comments about what is unclear or 
 needs better documentation as well as offering 
 spelling/grammar/punctuation suggestions[2]. Viewers should be able to 
 set preferences for whether they want to see the real/current 
 documentation, or whether they want to see the commented/modified 
 version (hiding things below a certain depth or rank for reddit-like).

We had a thread on this the other day with similar ideas.


Duncan

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


Re: Re[2]: [Haskell-cafe] ANN: HTTPbis / HTTP-4000.x package available

2009-01-18 Thread Duncan Coutts
On Sat, 2009-01-17 at 20:34 -1000, Tim Newsham wrote:
  Speaking of proxies, I've been looking into how to find the right proxy
  to use on Windows systems. Turns out that to do it properly you need a
  JavaScript interpreter! Yes, really.
 
 Uhh.. What!?  That's not right.

I think you mean it should not be right! :-) Of course it's possible to
specify a list of proxies in Windows and that info is kept in the
registry. It's also common in corporate networks to use proxy
auto-configuration. The client gets told the URL of the these (.pac)
files and the client downloads it to work out what proxy to use. You'll
notice a space to specify an auto-configuration URL (.pac file) in the
proxy setting dialog of any web browser.

Proxy auto-configuration files are JavaScript. It uses more or less the
full JavaScript language (ECMA these days), though with a small subset
of the standard library.

Web browsers are ok because they've got a JavaScript interpreter. The MS
WinHTTP library uses the Windows scripting host service. The open source
pacparser C library links to the Mozilla SpiderMonkey JavaScript engine.
Apparently we have Netscape to thank for this mess.

Duncan

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


Re: [Haskell-cafe] Re: Comments from OCaml Hacker Brian Hurt

2009-01-18 Thread Cory Knapp

Andrew Coppin wrote:

I can't await the next Haskell standard, where at last all those
extensions are builtin.


This frightens me.

The example he had had the uses keyword, so I assume it's built in in 
the same way Perl pragma are built in. So you can happily ignore code 
when you see uses at the top of the file. ;)


Although I could be wrong.

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


Re: [Haskell-cafe] ANNOUNCE: Coadjute 0.0.1, generic build tool

2009-01-18 Thread Henning Thielemann
Matti Niemenmaa schrieb:
 Announcing the release of Coadjute, version 0.0.1!
 
 Web site: http://iki.fi/matti.niemenmaa/coadjute/
 Hackage:
 http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Coadjute
 
 Coadjute is a generic build tool, intended as an easier to use and more
 portable replacement for make. It’s not tailored toward any particular
 language, and is not meant to replace tools which target a specific
 environment (such as ghc --make or Cabal, taking Haskell as an example).
 
 I've been sitting on this for a couple of months now and figured I might
 as well push it out since it seems to be in relative working order. I've
 used it on my web site since July and it hasn't resulted in data loss yet.

How does it compare to
   http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hake

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


Re: [Haskell-cafe] Re: Comments from OCaml Hacker Brian Hurt

2009-01-18 Thread Robert Greayer




- Original Message 
From: Andrew Coppin andrewcop...@btinternet.com
 Which is why I personally prefer HiddenTypeVariables. (This has the advantage 
 of using only pronouncible English 
words, which means you can use it when speaking out loud.)

Existential  - English, easy to pronounce
Quantify - English, easy to pronounce

I know I've been seeing those backwards E's and upside down A's in 
not-so-advanced Maths courses for a long time (since high school, I'm sure) and 
I certainly encountered them before 'Boolean'.  If you could do a geometry 
proof in high school, you have the Maths background need to understand the 
ideas.  (How they apply to types is another story, but the words shouldn't be 
scary.)

 I can't await the next Haskell standard, where at last all those
 extensions are builtin.

 This frightens me.

 At the moment, I understand how Haskell 98 works. There are lots of extensions
 out there, but I don't have to care about that because I don't use them. If I 
 read 
 somebody else's code and it contains a LANGUAGE pragma, I can immediately
 tell that the code won't be comprehendable, so I don't need to waste time 
 trying 
 to read it. But once Haskell' becomes standard, none of this holds any more.
 Haskell' code will use obscure lanuage features without warning, and unless I 
 somehow learn every extension in the set, I'll never be able to read Haskell
 again! (One presumes that they won't add any extensions which actually 
 *break* 
 backwards compatibility, so hopefully I can still pretend these troublesome
 extensions don't exist when writing my own code...)

Some of the most useful libraries (e.g. parsec, generics) use these type system 
extensions (higher rank polymorphism, existentials).  It would be great if 
these could be considered 'standard Haskell'.

___
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: ANN: leapseconds-announced-2009

2009-01-18 Thread Bjorn Buckwalter
On Sun, Jan 18, 2009 at 00:37, Ashley Yakeley ash...@semantic.org wrote:
 On Sun, 2009-01-18 at 00:34 -0500, Bjorn Buckwalter wrote:
 Thanks for the pointer. My source is the Earth Orientation Parameter
 (EOP) data at http://www.celestrak.com/SpaceData/; specifically I
 autogenerate the module from
 http://www.celestrak.com/SpaceData/eop19620101.txt. Probably looks
 more complicated than necessary but I'm parsing the file anyway for
 other purposes.

 With tz, though, you could discover the table at run-time and so be more
 likely to be up to date.

Ah yes. However, just like time this library does not attempt to
solve that particular problem. The purpose of leapseconds-announced is
to be dead easy to use (no IO and treading of the LeapSecondTable to
the usage point), at the cost of longevity. Of course, as I pointed
out in the announcement this trade-off isn't suitable for all
applications.

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


[Haskell-cafe] Re: Comments from OCaml Hacker Brian Hurt

2009-01-18 Thread Ertugrul Soeylemez
Andrew Coppin andrewcop...@btinternet.com wrote:

 Ertugrul Soeylemez wrote:
  Andrew Coppin andrewcop...@btinternet.com wrote:
 
  I would suggest that ExistentiallyQuantifiedTypeVariables would be
  an improvement [...]
 
  That must be a joke.  Typing the long extension names in LANGUAGE
  pragmas over and over again is tiring and annoying enough already.
  We really don't need even longer names, and your improvement fills
  up almost half of the width of an 80 characters terminal.

 Which is why I personally prefer HiddenTypeVariables. (This has the
 advantage of using only pronouncible English words, which means you
 can use it when speaking out loud.)

 But, as I say, nobody is going to rename anything, so it's moot.

Well, yes, unfortunately, unless someone proposes extension renamings
together with a long paper about the psychological implications and
advantages of using shorter names.


  I can't await the next Haskell standard, where at last all those
  extensions are builtin.

 This frightens me.

 At the moment, I understand how Haskell 98 works. There are lots of
 extensions out there, but I don't have to care about that because I
 don't use them. If I read somebody else's code and it contains a
 LANGUAGE pragma, I can immediately tell that the code won't be
 comprehendable, so I don't need to waste time trying to read it. But
 once Haskell' becomes standard, none of this holds any more. Haskell'
 code will use obscure lanuage features without warning, and unless I
 somehow learn every extension in the set, I'll never be able to read
 Haskell again! (One presumes that they won't add any extensions which
 actually *break* backwards compatibility, so hopefully I can still
 pretend these troublesome extensions don't exist when writing my own
 code...)

I think, the list of accepted extensions is well chosen.  And don't
worry, the extensions I'm talking about mainly, are easy to comprehend
and very useful, for example multi-parameter type classes and rank-n
types.


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] runghc Setup.hs doitall

2009-01-18 Thread Sebastian Sylvan
Is there some sort of bundle that you can use to install cabal-install 
easily? Because it looks to me like I'd have to spend the better part of an 
evening manually downloading and installing the gazillion of dependencies it 
has, which is far too much work when I just wanted to spend ten minutes 
playing with some package...


--
From: Daniel Fischer daniel.is.fisc...@web.de
Sent: Saturday, January 17, 2009 10:35 PM
To: Alberto G. Corona  agocor...@gmail.com; haskell-cafe@haskell.org
Subject: Re: [Haskell-cafe] runghc Setup.hs doitall


Am Samstag, 17. Januar 2009 23:20 schrieb Alberto G. Corona:

Hi guys:

I don´t know how difficult really is, but it seens that it could be done
because all the necessary elements are there (except perhaps the mapping
package name-hackage url): Why hasn´t been done yet Is unknown to me.
It would be very useful and a big save of time  to have a cabal commad
chech-dependencies-and-install-them-by-downloading-them-from-hackage-then-
configure-build-and-install-this-package?. The unix installers do is t 
from
binaries and are obsolete, so I have to do it manually with cabal 
everytime

 when i download a new compiler version from haskell.org.

Cheers
  Alberto.


Use cabal-install:

cabal update  cabal install foo

checks for dependencies, downloads and builds them automatically (if
possible).

___
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] runghc Setup.hs doitall

2009-01-18 Thread Jeff Wheeler
On Sun, 2009-01-18 at 16:22 +, Sebastian Sylvan wrote:

 Is there some sort of bundle that you can use to install cabal-install 
 easily? Because it looks to me like I'd have to spend the better part of an 
 evening manually downloading and installing the gazillion of dependencies it 
 has, which is far too much work when I just wanted to spend ten minutes 
 playing with some package...

There's a bootstrap.sh file in root of the cabal-install that can do
this automatically.

In my experience, it usually fails because of missing dependencies like
zlib-dev on my own system, but those are easy to fix, at which point I
can rerun the bootstrap script.

Jeff Wheeler

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


Re: [Haskell-cafe] runghc Setup.hs doitall

2009-01-18 Thread Peter Robinson
2009/1/18 Sebastian Sylvan sebastian.syl...@gmail.com:
 Is there some sort of bundle that you can use to install cabal-install
 easily?

Newer versions contain a bootstrap.sh script that works just fine for me.

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


Re: [Haskell-cafe] runghc Setup.hs doitall

2009-01-18 Thread Sebastian Sylvan

Doesn't work on windows.

--
From: Jeff Wheeler j...@nokrev.com
Sent: Sunday, January 18, 2009 4:27 PM
To: haskell-cafe@haskell.org
Subject: Re: [Haskell-cafe] runghc Setup.hs doitall


On Sun, 2009-01-18 at 16:22 +, Sebastian Sylvan wrote:


Is there some sort of bundle that you can use to install cabal-install
easily? Because it looks to me like I'd have to spend the better part of 
an
evening manually downloading and installing the gazillion of dependencies 
it

has, which is far too much work when I just wanted to spend ten minutes
playing with some package...


There's a bootstrap.sh file in root of the cabal-install that can do
this automatically.

In my experience, it usually fails because of missing dependencies like
zlib-dev on my own system, but those are easy to fix, at which point I
can rerun the bootstrap script.

Jeff Wheeler

___
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


Improved documentation for Bool (Was: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt)

2009-01-18 Thread roconnor

On Sun, 18 Jan 2009, Ross Paterson wrote:


Anyone can check out the darcs repos for the libraries, and post
suggested improvements to the documentation to librar...@haskell.org
(though you have to subscribe).  It doesn't even have to be a patch.

Sure, it could be smoother, but there's hardly a flood of contributions.


I noticed the Bool datatype isn't well documented.  Since Bool is not a 
common English word, I figured it could use some haddock to help clarify 
it for newcomers.


-- |The Bool datatype is named after George Boole (1815-1864).
-- The Bool type is the coproduct of the terminal object with itself.
-- As a coproduct, it comes with two maps i : 1 - 1+1 and j : 1 - 1+1
-- such that for any Y and maps u: 1 - Y and v: 1 - Y, there is a unique 
-- map (u+v): 1+1 - Y such that (u+v) . i = u, and (u+v) . j = v

-- as shown in the diagram below.
--
--  1 -- u -- Y
--  ^ ^^
--  |/ |
--  i  u + v   v
--  | /|
-- 1+1 - j -- 1
--
-- In Haskell we call we define 'False' to be i(*) and 'True' to be j(*) 
-- where *:1.
-- Furthermore, if Y is any type, and we are given a:Y and b:Y, then we 
-- can define u(*) = a and v(*) = b.

-- From the above there is a unique map (u + v) : 1+1 - Y,
-- or in other words, (u+v) : Bool - Y.
-- Haskell has a built in syntax for this map:
-- @if z then a else b@ equals (u+v)(z).
--
-- From the commuting triangle in the diagram we see that
-- (u+v)(i(*)) = u(*).
--  Translated into Haskell notation, this law reads
-- @if True then a else b = a...@.
-- Similarly from the other commuting triangle we see that
-- (u+v)(j(*)) = v(*), which means
-- @if False then a else b = b@

--
Russell O'Connor  http://r6.ca/
``All talk about `theft,''' the general counsel of the American Graphophone
Company wrote, ``is the merest claptrap, for there exists no property in
ideas musical, literary or artistic, except as defined by statute.''
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] runghc Setup.hs doitall

2009-01-18 Thread Daniel Fischer
Am Sonntag, 18. Januar 2009 17:22 schrieb Sebastian Sylvan:
 Is there some sort of bundle that you can use to install cabal-install
 easily? Because it looks to me like I'd have to spend the better part of an
 evening manually downloading and installing the gazillion of dependencies
 it has, which is far too much work when I just wanted to spend ten minutes
 playing with some package...


Wait, 'gazillion of dependencies'? If you have the extralibs bundle built, 
there are only three dependencies to take care of
- a recent Cabal library
- HTTP
- zlib
Of course, downloading and building them manually may take half an hour or so, 
but it's time well spent, cabal-install makes playing around for ten minutes 
with some other package so much easier.
And of course, as has already been mentioned, there's now a bootstrap.sh 
included which takes care of the above dependencies for you.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: Improved documentation for Bool (Was: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt)

2009-01-18 Thread Cory Knapp

rocon...@theorem.ca wrote:

On Sun, 18 Jan 2009, Ross Paterson wrote:


Anyone can check out the darcs repos for the libraries, and post
suggested improvements to the documentation to librar...@haskell.org
(though you have to subscribe).  It doesn't even have to be a patch.

Sure, it could be smoother, but there's hardly a flood of contributions.


I noticed the Bool datatype isn't well documented.  Since Bool is not 
a common English word, I figured it could use some haddock to help 
clarify it for newcomers.


-- |The Bool datatype is named after George Boole (1815-1864).
-- The Bool type is the coproduct of the terminal object with itself.
-- As a coproduct, it comes with two maps i : 1 - 1+1 and j : 1 - 1+1
-- such that for any Y and maps u: 1 - Y and v: 1 - Y, there is a 
unique -- map (u+v): 1+1 - Y such that (u+v) . i = u, and (u+v) . j = v

-- as shown in the diagram below.
--
--  1 -- u -- Y
--  ^ ^^
--  |/ |
--  i  u + v   v
--  | /|
-- 1+1 - j -- 1
--
-- In Haskell we call we define 'False' to be i(*) and 'True' to be 
j(*) -- where *:1.
-- Furthermore, if Y is any type, and we are given a:Y and b:Y, then 
we -- can define u(*) = a and v(*) = b.

-- From the above there is a unique map (u + v) : 1+1 - Y,
-- or in other words, (u+v) : Bool - Y.
-- Haskell has a built in syntax for this map:
-- @if z then a else b@ equals (u+v)(z).
--
-- From the commuting triangle in the diagram we see that
-- (u+v)(i(*)) = u(*).
--  Translated into Haskell notation, this law reads
-- @if True then a else b = a...@.
-- Similarly from the other commuting triangle we see that
-- (u+v)(j(*)) = v(*), which means
-- @if False then a else b = b@

I'm going to go ahead and assume this was a joke and crack up... The sad 
part is I didn't actually find this difficult to read...


Cory lost touch with the real world Knapp
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: Improved documentation for Bool (Was: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt)

2009-01-18 Thread Daniel Fischer
Am Sonntag, 18. Januar 2009 17:48 schrieb rocon...@theorem.ca:
 On Sun, 18 Jan 2009, Ross Paterson wrote:
  Anyone can check out the darcs repos for the libraries, and post
  suggested improvements to the documentation to librar...@haskell.org
  (though you have to subscribe).  It doesn't even have to be a patch.
 
  Sure, it could be smoother, but there's hardly a flood of contributions.

 I noticed the Bool datatype isn't well documented.  Since Bool is not a
 common English word, I figured it could use some haddock to help clarify
 it for newcomers.

Thanks. Really helpful. A few minor typos, though.


 -- |The Bool datatype is named after George Boole (1815-1864).
 -- The Bool type is the coproduct of the terminal object with itself.
 -- As a coproduct, it comes with two maps i : 1 - 1+1 and j : 1 - 1+1
 -- such that for any Y and maps u: 1 - Y and v: 1 - Y, there is a unique
 -- map (u+v): 1+1 - Y such that (u+v) . i = u, and (u+v) . j = v
 -- as shown in the diagram below.
 --
 --  1 -- u -- Y
 --  ^ ^^
 --  |/ |
 --  i  u + v   v
 --  | /|
 -- 1+1 - j -- 1

You have the arrows i and j pointing in the wrong direction.

 --
 -- In Haskell we call we define 'False' to be i(*) and 'True' to be j(*)

Delete we call.

 -- where *:1.
 -- Furthermore, if Y is any type, and we are given a:Y and b:Y, then we
 -- can define u(*) = a and v(*) = b.
 -- From the above there is a unique map (u + v) : 1+1 - Y,
 -- or in other words, (u+v) : Bool - Y.
 -- Haskell has a built in syntax for this map:
 -- @if z then a else b@ equals (u+v)(z).
 --
 -- From the commuting triangle in the diagram we see that
 -- (u+v)(i(*)) = u(*).
 --  Translated into Haskell notation, this law reads
 -- @if True then a else b = a...@.
 -- Similarly from the other commuting triangle we see that
 -- (u+v)(j(*)) = v(*), which means
 -- @if False then a else b = b@

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


Re: [Haskell-cafe] runghc Setup.hs doitall

2009-01-18 Thread David Leimbach
On Sun, Jan 18, 2009 at 8:22 AM, Sebastian Sylvan 
sebastian.syl...@gmail.com wrote:

 Is there some sort of bundle that you can use to install cabal-install
 easily? Because it looks to me like I'd have to spend the better part of an
 evening manually downloading and installing the gazillion of dependencies it
 has, which is far too much work when I just wanted to spend ten minutes
 playing with some package...


You typically need HTTP and zlib.  Perhaps cabal-install could have it's own
minimal implementations to be standalone?

However I don't find needing to cabal build and install 2 packages to be so
difficult.

And once you have cabal-install, you've got it ;-)  It should be able to
update itself.

Maybe adding cabal-install to the ghc packaging solves all the problems,
then they just need zlib and http in the main distribution.

Dave




 --
 From: Daniel Fischer daniel.is.fisc...@web.de
 Sent: Saturday, January 17, 2009 10:35 PM
 To: Alberto G. Corona  agocor...@gmail.com; haskell-cafe@haskell.org
 Subject: Re: [Haskell-cafe] runghc Setup.hs doitall


  Am Samstag, 17. Januar 2009 23:20 schrieb Alberto G. Corona:

 Hi guys:

 I don´t know how difficult really is, but it seens that it could be done
 because all the necessary elements are there (except perhaps the mapping
 package name-hackage url): Why hasn´t been done yet Is unknown to me.
 It would be very useful and a big save of time  to have a cabal commad

 chech-dependencies-and-install-them-by-downloading-them-from-hackage-then-
 configure-build-and-install-this-package?. The unix installers do is t
 from
 binaries and are obsolete, so I have to do it manually with cabal
 everytime
  when i download a new compiler version from haskell.org.

 Cheers
  Alberto.


 Use cabal-install:

 cabal update  cabal install foo

 checks for dependencies, downloads and builds them automatically (if
 possible).

 ___
 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 mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: Improved documentation for Bool (Was: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt)

2009-01-18 Thread Eugene Kirpichov
2009/1/18 Daniel Fischer daniel.is.fisc...@web.de:
 Am Sonntag, 18. Januar 2009 17:48 schrieb rocon...@theorem.ca:
 On Sun, 18 Jan 2009, Ross Paterson wrote:
  Anyone can check out the darcs repos for the libraries, and post
  suggested improvements to the documentation to librar...@haskell.org
  (though you have to subscribe).  It doesn't even have to be a patch.
 
  Sure, it could be smoother, but there's hardly a flood of contributions.

 I noticed the Bool datatype isn't well documented.  Since Bool is not a
 common English word, I figured it could use some haddock to help clarify
 it for newcomers.

 Thanks. Really helpful. A few minor typos, though.


 -- |The Bool datatype is named after George Boole (1815-1864).
 -- The Bool type is the coproduct of the terminal object with itself.
 -- As a coproduct, it comes with two maps i : 1 - 1+1 and j : 1 - 1+1
 -- such that for any Y and maps u: 1 - Y and v: 1 - Y, there is a unique
 -- map (u+v): 1+1 - Y such that (u+v) . i = u, and (u+v) . j = v
 -- as shown in the diagram below.
 --
 --  1 -- u -- Y
 --  ^ ^^
 --  |/ |
 --  i  u + v   v
 --  | /|
 -- 1+1 - j -- 1

 You have the arrows i and j pointing in the wrong direction.

 --
 -- In Haskell we call we define 'False' to be i(*) and 'True' to be j(*)

 Delete we call.

 -- where *:1.
 -- Furthermore, if Y is any type, and we are given a:Y and b:Y, then we
 -- can define u(*) = a and v(*) = b.
 -- From the above there is a unique map (u + v) : 1+1 - Y,
 -- or in other words, (u+v) : Bool - Y.
 -- Haskell has a built in syntax for this map:
 -- @if z then a else b@ equals (u+v)(z).
Also, equals (a+b)(z) should be here.

 --
 -- From the commuting triangle in the diagram we see that
 -- (u+v)(i(*)) = u(*).
 --  Translated into Haskell notation, this law reads
 -- @if True then a else b = a...@.
 -- Similarly from the other commuting triangle we see that
 -- (u+v)(j(*)) = v(*), which means
 -- @if False then a else b = b@

 ___
 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: Improved documentation for Bool (Was: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt)

2009-01-18 Thread Benja Fallenstein
On Sun, Jan 18, 2009 at 5:48 PM,  rocon...@theorem.ca wrote:
 I noticed the Bool datatype isn't well documented.  Since Bool is not a
 common English word, I figured it could use some haddock to help clarify it
 for newcomers.

 -- |The Bool datatype is named after George Boole (1815-1864).
 -- The Bool type is the coproduct of the terminal object with itself.

Russell, this does seem like it might be very helpful, but it might be
useful to include a note about what category you are working in.
People may sometimes naively assume that one is working in the
category of Haskell/Hugs/GHC data types and Haskell functions, in
which there are no terminal -- or initial -- objects ('undefined' and
'const undefined' are distinct maps between any two objects X and Y),
or else in the similar category without lifted bottoms, in which the
empty type is terminal and the unit type isn't ('undefined' and 'const
()' are both maps from any object X to the unit type). These niceties
will not confuse the advanced reader, but it may help the beginner if
you are more explicit.

- Benja


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


Re: [Haskell-cafe] Functors [Comments from OCaml Hacker Brian Hurt]

2009-01-18 Thread David Leimbach
On Sun, Jan 18, 2009 at 3:23 AM, Andrew Coppin
andrewcop...@btinternet.comwrote:

 Jonathan Cast wrote:

 On Sat, 2009-01-17 at 12:04 +, Andrew Coppin wrote:



  instance (Monad m) = Functor m where
  fmap f ma = do a - ma; return (f a)


 While that's quite interesting from a mathematical point of view, how is
 this useful for programming purposes?



 Good Lord.  fmap (as above) is *at least* useful enough to be in the
 standard library!  (Control.Monad.liftM).


 Given that liftM exists, why is having an identical implementation for fmap
 useful?


Because liftM works on Monads and fmap works on Functors?

I believe you can make data that are Functors but are not Monads.




 The example that leaps out at me is that (=) is identical to concatMap
 within the list monad. But using lists as a monad is a generally useful
 thing to do, and being able to substitute arbitrary monads has obvious
 utility. I'm not seeing how being able to treat something that isn't a
 container as if it was a container is useful.



 ___
 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: Improved documentation for Bool (Was: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt)

2009-01-18 Thread Sterling Clover
This is a great effort, but the root of the problem isn't just poor  
documentation, but an insistence on some obscure name. How about  
renaming Bool to YesOrNoDataVariable? I think this would help novice  
programmers a great deal.


It would also make the documentation flow much more naturally:

The Bool type is the coproduct of the terminal object with itself.

--huh?

The YesOrNoDataVariable is the coproduct of the terminal object with  
itself.


--Oh! Of course!

--S

On Jan 18, 2009, at 12:17 PM, Benja Fallenstein wrote:


On Sun, Jan 18, 2009 at 5:48 PM,  rocon...@theorem.ca wrote:
I noticed the Bool datatype isn't well documented.  Since Bool is  
not a
common English word, I figured it could use some haddock to help  
clarify it

for newcomers.

-- |The Bool datatype is named after George Boole (1815-1864).
-- The Bool type is the coproduct of the terminal object with itself.


Russell, this does seem like it might be very helpful, but it might be
useful to include a note about what category you are working in.
People may sometimes naively assume that one is working in the
category of Haskell/Hugs/GHC data types and Haskell functions, in
which there are no terminal -- or initial -- objects ('undefined' and
'const undefined' are distinct maps between any two objects X and Y),
or else in the similar category without lifted bottoms, in which the
empty type is terminal and the unit type isn't ('undefined' and 'const
()' are both maps from any object X to the unit type). These niceties
will not confuse the advanced reader, but it may help the beginner if
you are more explicit.

- Benja


P.S. :-)
___
Libraries mailing list
librar...@haskell.org
http://www.haskell.org/mailman/listinfo/libraries


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


Re: [Haskell-cafe] ANN: hledger 0.3 released

2009-01-18 Thread Sebastian Sylvan
I was interested in actually using this for real, but unfortunately it seems 
like you have a dependency on the unix package. Would it be possible to use 
something portable (specifically to windows) instead?


From: Simon Michael 
Sent: Saturday, January 17, 2009 11:42 PM
To: hled...@googlegroups.com ; haskell-cafe@haskell.org 
Subject: [Haskell-cafe] ANN: hledger 0.3 released


I'm pleased to announce another hledger release. Happy new year, all!




hledger is a partial haskell clone of John Wiegley's ledger text-based

accounting tool.  It generates transaction  balance reports from a plain

text ledger file, and demonstrates a functional implementation of ledger.

For more information, see hledger's home page: http://joyful.com/hledger




News for 0.3






Fixes:




  * count timelog sessions on the day they end, like ledger, for now

  * when options are repeated, use the last instead of the first

  * builds with ghc 6.10 as well as 6.8

  * runs much faster than 0.2::





$ bench hledger-0.2 hledger ledger
  || hledger-0.2 | hledger | ledger
==++=+=+===
-f 2008.ledger -s balance ||2.59 |0.26 |   0.11
-f 1entries.ledger -s balance ||  566.68 |2.72 |   0.96



Features:




  * a simple ui for interactive report browsing: hledger ui

  * accept smart dates everywhere (MMDD, Y/M/D, Y, M/D, D, jan,

today, last week etc.)

  * --period/-p flag accepting period expressions like in 2008, 

weekly from last month..

  * -W/-M/-Y convenience flags to summarise register weekly, monthly,

 yearly

  * --depth and -E flags also affect summarised register reports

(including depth=0)

  * --display/-d flag supporting date predicates (like d[DATE],

d=[DATE])

  * !include directive to include additional ledger files

  * !account directive to set a default parent account

  * Added support for reading historical prices from files

  * timelog and ledger entries can be intermixed in one file

  * modifier and periodic entries can appear anywhere (but are still

ignored)

  * help and readme improvements




Contributors:




  * Simon Michael

  * Nick Ingolia

  * Tim Docker

  * Corey O'Connor  the vty team




Stats:




  * Known errors: 1

  * Tests: 58

  * Lines of non-test code: 2123




Installation






hledger requires GHC. It is known to build with 6.8 and 6.10.

If you have cabal-install, do::




 cabal update

 cabal install hledger




Otherwise, unpack the latest tarball from

http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hledger and do::




 runhaskell Setup.hs configure

 runhaskell Setup.hs build

 sudo runhaskell Setup.hs install 




This will complain about any missing libraries, which you can download and

install manually from hackage.haskell.org. (The Build-Depends: in

hledger.cabal has the full package list.)




To get the latest development code do::




 darcs get http://joyful.com/repos/hledger









___
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] Functors [Comments from OCaml Hacker Brian Hurt]

2009-01-18 Thread Jonathan Cast
On Sun, 2009-01-18 at 11:23 +, Andrew Coppin wrote:
 Jonathan Cast wrote:
  On Sat, 2009-01-17 at 12:04 +, Andrew Coppin wrote:

 
  instance (Monad m) = Functor m where
fmap f ma = do a - ma; return (f a)


  While that's quite interesting from a mathematical point of view, how is 
  this useful for programming purposes?
  
 
  Good Lord.  fmap (as above) is *at least* useful enough to be in the
  standard library!  (Control.Monad.liftM).
 
 Given that liftM exists, why is having an identical implementation for 
 fmap useful?

What?

jcc


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


Re: [Haskell-cafe] Re: Functors [Comments from OCaml Hacker Brian Hurt]

2009-01-18 Thread Jonathan Cast
On Sun, 2009-01-18 at 11:11 +, Andrew Coppin wrote:
 Heinrich Apfelmus wrote:
  Andrew Coppin wrote:

  instance (Monad m) = Functor m where
fmap f ma = do a - ma; return (f a)


  While that's quite interesting from a mathematical point of view, how is
  this useful for programming purposes?
  
 
  Surely, you agree that  liftM  is useful? Because that's the same thing.

 
 Then why not just use liftM? (That way, you know what it does...)

I'd be willing to say *you* don't `know what it does', if you haven't
figured out that it's an acceptable implementation of fmap first.

jcc


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


[Haskell-cafe] Re: ANN: hledger 0.3 released

2009-01-18 Thread Simon Michael

On 1/18/09 9:39 AM, Sebastian Sylvan wrote:

I was interested in actually using this for real, but unfortunately it seems 
like you have a dependency on the unix package. Would it be possible to use something 
portable (specifically to windows) instead?



Darn, thanks for the heads up. I guess we need to make the vty 
requirement (and ui command) optional. (I thought vty was 
cross-platform. :/)

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


Re: [Haskell-cafe] Optimistic evaluation

2009-01-18 Thread Don Stewart
andrewcoppin:
 Hi folks.
 
 I just read a rather interesting paper about a fork of GHC that performs 
 optimistic evaluation. This shows big wins in some cases.
 
 The authors claim to have implemented this in a fork of GHC and promised 
 that it would be integrated into the production compiler in the near 
 future. Curios, I investigated the GHC wiki...
 
 Well, let's see now. The front page has links to out release plans for 
 6.8.3 and what will be in 6.10. The latter page,
 
 http://hackage.haskell.org/trac/ghc/wiki/Status/Releases
 
 mentions that a beta has just been released... and seems oblivious to 
 the fact that 6.10.1 is production now. Clearly, any hopes I might have 
 had of getting a handle on the current status of GHC from this wiki were 
 dashed somewhat. ;-)
 
 Does anybody have any suggestions for a more reliable way of figuring 
 out what the current activities and plans for GHC are?

I'm assuming you're talking about the 'eager evaluation' papers? (There
were a few). I think the verdict was that the runtime machinery was
too complex for the performance gain.

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


[Haskell-cafe] Re: ANN: hledger 0.3 released

2009-01-18 Thread Sebastian Sylvan
Yeah looks like it depends on unix. Also, looks like the terminfo package 
isn't cross-platform either.


Perhaps we need a better tool to mark packages which are platform-specific, 
so people don't accidentally use them, especially if they're a few levels 
away in the dependency graph.


--
From: Simon Michael si...@joyful.com
Sent: Sunday, January 18, 2009 6:08 PM
To: Sebastian Sylvan sebastian.syl...@gmail.com
Cc: hled...@googlegroups.com; haskell-cafe@haskell.org
Subject: Re: ANN: hledger 0.3 released


On 1/18/09 9:39 AM, Sebastian Sylvan wrote:
I was interested in actually using this for real, but unfortunately it 
seems like you have a dependency on the unix package. Would it be 
possible to use something portable (specifically to windows) instead?



Darn, thanks for the heads up. I guess we need to make the vty requirement 
(and ui command) optional. (I thought vty was cross-platform. :/)



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


Re: [Haskell-cafe] runghc Setup.hs doitall

2009-01-18 Thread Duncan Coutts
On Sun, 2009-01-18 at 16:48 +, Sebastian Sylvan wrote:
 Doesn't work on windows.

http://haskell.org/~duncan/cabal/cabal.exe

It's not the latest version but you can use it to self-update. I'll post
a more recent build after the next release. I might also put it in a
slightly more discoverable place ;-)

Duncan

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


Re: [Haskell-cafe] runghc Setup.hs doitall

2009-01-18 Thread Duncan Coutts
On Sun, 2009-01-18 at 10:27 -0600, Jeff Wheeler wrote:
 On Sun, 2009-01-18 at 16:22 +, Sebastian Sylvan wrote:
 
  Is there some sort of bundle that you can use to install cabal-install 
  easily? Because it looks to me like I'd have to spend the better part of an 
  evening manually downloading and installing the gazillion of dependencies 
  it 
  has, which is far too much work when I just wanted to spend ten minutes 
  playing with some package...
 
 There's a bootstrap.sh file in root of the cabal-install that can do
 this automatically.

I've also improved the bootstrap.sh script for unix users. Feedback as
to whether it still works on everyone's unix flavor would be much
appreciated.

http://darcs.haskell.org/cabal-install/bootstrap.sh

It's slightly smarter about not re-installing things that are already
installed. It should have rather better error handling too.

In fact I've heard reports that this new one even works on Windows,
though only for the people with MSYS of course.

 In my experience, it usually fails because of missing dependencies like
 zlib-dev on my own system, but those are easy to fix, at which point I
 can rerun the bootstrap script.

Patches accepted.

Duncan

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


Re: [Haskell-cafe] runghc Setup.hs doitall

2009-01-18 Thread Duncan Coutts
On Sun, 2009-01-18 at 17:58 +0100, Daniel Fischer wrote:
 Am Sonntag, 18. Januar 2009 17:22 schrieb Sebastian Sylvan:
  Is there some sort of bundle that you can use to install cabal-install
  easily? Because it looks to me like I'd have to spend the better part of an
  evening manually downloading and installing the gazillion of dependencies
  it has, which is far too much work when I just wanted to spend ten minutes
  playing with some package...
 
 
 Wait, 'gazillion of dependencies'? If you have the extralibs bundle built, 
 there are only three dependencies to take care of
 - a recent Cabal library
 - HTTP
 - zlib

I think the problem is that hackage is misleading. It looks from the
hackage page like there are a gazillion dependencies when in fact as you
say there are only 2 that are not included with the latest ghc.

The solution some have suggested would be for hackage to only list
dependencies that are not in some core set.

Duncan

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


Re: [Haskell-cafe] runghc Setup.hs doitall

2009-01-18 Thread Jeff Wheeler
On Sun, 2009-01-18 at 18:24 +, Duncan Coutts wrote:

  In my experience, it usually fails because of missing dependencies like
  zlib-dev on my own system, but those are easy to fix, at which point I
  can rerun the bootstrap script.
 
 Patches accepted.

Without digressing too much, I don't think much can be done here. I
would not (and should not) expect the bootstrap.sh file to use apt to
get the missing dependencies as I had to do.

I don't think there's any general solution to this, beyond better error
handling (which apparently you just improved).

Jeff Wheeler

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


[Haskell-cafe] Re: Improved documentation for Bool (Was: Comments from OCaml Hacker Brian Hurt)

2009-01-18 Thread Heinrich Apfelmus
Sterling Clover wrote:
 This is a great effort, but the root of the problem isn't just poor
 documentation, but an insistence on some obscure name. How about
 renaming Bool to YesOrNoDataVariable? I think this would help novice
 programmers a great deal.
 
 It would also make the documentation flow much more naturally:
 
 The Bool type is the coproduct of the terminal object with itself.
 
 --huh?
 
 The YesOrNoDataVariable is the coproduct of the terminal object with
 itself.
 
 --Oh! Of course!

I'm sorry, but I don't get neither Bool nor YesOrNoDataVariable, it's
too confusing for newcomers. Can we please name it to

  TerminalObjectCoSquared

that's much more intuitive.


Also, the wikipedia page

  http://en.wikipedia.org/wiki/YesOrNoDataVariable

is extremely unhelpful. Not that the wikipedia page for Bool which links to

  http://en.wikipedia.org/wiki/Boolean_datatype

is any better. The introduction goes to great lengths to note that

  For instance the ISO SQL:1999 standard defined a Boolean data type
  for SQL which could hold three possible values: true, false, unknown
  (SQL null is treated as equivalent to the unknown truth value, but
  only for the Boolean data type)

What is SQL, do they mean the SesQuiLinear forms that I'm familiar with?
But what does it have to do with TerminalObjectCoSquared? I'm confused.


Regards,
apfelmus

-- 
http://apfelmus.nfshost.com

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


Re: [Haskell-cafe] runghc Setup.hs doitall

2009-01-18 Thread Don Stewart
duncan.coutts:
 On Sun, 2009-01-18 at 17:58 +0100, Daniel Fischer wrote:
  Am Sonntag, 18. Januar 2009 17:22 schrieb Sebastian Sylvan:
   Is there some sort of bundle that you can use to install cabal-install
   easily? Because it looks to me like I'd have to spend the better part of 
   an
   evening manually downloading and installing the gazillion of dependencies
   it has, which is far too much work when I just wanted to spend ten minutes
   playing with some package...
  
  
  Wait, 'gazillion of dependencies'? If you have the extralibs bundle built, 
  there are only three dependencies to take care of
  - a recent Cabal library
  - HTTP
  - zlib
 
 I think the problem is that hackage is misleading. It looks from the
 hackage page like there are a gazillion dependencies when in fact as you
 say there are only 2 that are not included with the latest ghc.
 
 The solution some have suggested would be for hackage to only list
 dependencies that are not in some core set.

Hmm. That's interesting. As we do in the distro tools, for example, 

makedepends=('ghc=6.10.1' 'haskell-http4000' 'haskell-zlib')


http://repos.archlinux.org/viewvc.cgi/community/devel/cabal-install/PKGBUILD?revision=1.1root=communitypathrev=CURRENT

So the distro packaging tools already have the 'implicit set' of things
we know are on the system if ghc is on it too.

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


Re: [Haskell-cafe] runghc Setup.hs doitall

2009-01-18 Thread Sebastian Sylvan
On a similar note, would it not be nice if cabal install understood about 
platforms and could tell you straight away that a package won't install 
under e.g. windows, rather then spending ages trying and then failing 
because a package tries to run a unix command?


I always get a bit annoyed trying to do anything in windows with Haskell 
libraries, at the very least I'd like it to be clear from the start that 
something won't work (if it's by design) so I don't waste time trying. 
Ideally the hackage website would even allow you to filter packages by the 
OS you're using and would remove packages that won't build on that OS (by 
recursively checking dependencies too).


--
From: Duncan Coutts duncan.cou...@worc.ox.ac.uk
Sent: Sunday, January 18, 2009 6:20 PM
To: Sebastian Sylvan sebastian.syl...@gmail.com
Cc: Jeff Wheeler j...@nokrev.com; haskell-cafe@haskell.org
Subject: Re: [Haskell-cafe] runghc Setup.hs doitall


On Sun, 2009-01-18 at 16:48 +, Sebastian Sylvan wrote:

Doesn't work on windows.


http://haskell.org/~duncan/cabal/cabal.exe

It's not the latest version but you can use it to self-update. I'll post
a more recent build after the next release. I might also put it in a
slightly more discoverable place ;-)

Duncan



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


Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-18 Thread Don Stewart
ross:
 On Sat, Jan 17, 2009 at 09:12:32PM -0500, a...@spamcop.net wrote:
  And FWIW, I agree with everyone who has commented that the documentation
  is inadequate.  It'd be nice if there was some way to contribute better
  documentation without needing checkin access to the libraries.
 
 There is.  The current state of the docs may be viewed at
 
   http://www.haskell.org/ghc/dist/current/docs/libraries/
 
 Anyone can check out the darcs repos for the libraries, and post
 suggested improvements to the documentation to librar...@haskell.org
 (though you have to subscribe).  It doesn't even have to be a patch.
 
 Sure, it could be smoother, but there's hardly a flood of contributions.

I imagine if we set up a wiki-like system where the entire hackage docs
could be edited, as well as viewed, we would end up with a flood.

A modification to haddock perhaps, that sends edits to generated docs to 
libraries@ ?

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


[Haskell-cafe] Re: ANNOUNCE: Coadjute 0.0.1, generic build tool

2009-01-18 Thread Matti Niemenmaa

Henning Thielemann wrote:

Matti Niemenmaa schrieb:

Announcing the release of Coadjute, version 0.0.1!

Web site: http://iki.fi/matti.niemenmaa/coadjute/
Hackage:
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Coadjute

snip

How does it compare to
   http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hake


Short answer: the question that comes to mind is how does hake compare 
to make? Coadjute seems to be more capable, in general, but then I 
don't know pretty much anything about hake.


Somewhat longer answer:

Coadjute is better in that:
  1. hake's documentation is rather sparse. I have no idea what most
 functions do, or even what exactly the main program does.
  2. hake doesn't seem to do parallel builds, but I'm not sure because
 of point 1.
  3. Coadjute keeps track of command line arguments (see docs for
 details): for me this is really a killer feature, I don't know of
 anything else which does this.
  4. hake always uses timestamps, Coadjute can use MD5 hashes as well.
  5. Coadjute can have arbitrary path specifications, hake's rules seem
 to be based on file extensions only, thus applying only to the
 current directory. Peter Miller's Recursive Make Considered
 Harmful comes to mind: http://miller.emu.id.au/pmiller/books/rmch/

hake is better in that:
  1. Its syntax is more concise.
  2. It looks like it'd be easier to pick up for make users.
  3. It seems to have some built-in support for more complex operations
 than Coadjute, e.g. the 'ruleSS' function. (Coadjute can still do
 this, just not as concisely. See point 1.)

With the disclaimer that all I know about hake comes from its Hackage
page and home page, which don't really tell me very much. I can't get 
any information out of the hake binary either: it doesn't respond to 
--help or similar.


Much longer answer:

I figured I'd convert the example there to Coadjute and see what 
happens. Result, with some inline comments:



import Coadjute
import System.FilePath (replaceExtension)
import System.FilePath.Glob (globDir, compile)
import System.Process  (rawSystem)

main = do
   -- assuming that hake's rules apply to the current directory only...
   ([sfx1, sfx2, c, cc, foo],_) -
  globDir (map compile [*.sfx1,*.sfx2,*.c,*.cc,foo*]) .

   coadjute $ do
  -- Coadjute doesn't offer arbitrary source/target pairing
  -- currently: it wants you to derive your targets from your
  -- sources somehow instead of just specifying them directly
  ruleM' greeting
 (\_ _ - run linker
  [-o,greeting,hello.o,good-bye.o])
 (sourceToDatum (\_ - ( [good-bye.o]
   , [greeting,greeting.log]
   ))
[hello.o])

  rule' .sfx1 to .o (buildO compiler1)
(sourceToDatum' (chExt o) sfx1)

  rule' .sfx2 to .o (buildO compiler2)
(sourceToDatum' (chExt o) sfx2)

  -- Things like make clean don't really map well to Coadjute
  -- currently...
  --
  -- Not only can it not be specified nicely, but the rule is always
  -- applied unless we have it create some kind of dummy file
  rule' clean
(\_ _ - do run rm [-f, hello.o, good-bye.o
  , greeting, greeting.log]
run touch [DUMMY])
(sourceToDatum' (const DUMMY) [])

  rule' .c to .o
(\(s:_) _ - run gcc [-c, s])
(sourceToDatum' (chExt o) c)

  rule' .cc to .o
(\(s:_) _ - run g++ [-c, s])
(sourceToDatum' (chExt O) cc)

  -- No equivalent to hake's ruleSS: deal with C/C++ dichotomy
  -- yourself
  rule' C++ .o to binaries (buildO g++)
(sourceToDatum' (chExt ) $ map (chExt o) cc)
  rule' C .o to binaries   (buildO gcc)
(sourceToDatum' (chExt ) $ map (chExt o) c)

  ruleM' Not sure what this is
 (\[s] (t:_) - do
gen - readFile s
writeFile t $ unlines $
   [ #!/bin/sh, echo This is script ] ++ lines gen)
 (sourceToDatum'
 (\s - [replaceExtension s gen, Hakefile])
 foo)

 where chExt = flip replaceExtension
   run cmd args = rawSystem cmd args  return ()
   buildO compiler [s] t = run compiler [s,-o,t]


I really don't know what that last rule (the one generated with the 
'base' function in hake) is supposed to do. With no documentation I have 
absolutely no idea: my conversion above is my best guess, but I doubt I 
got it right.


In any case, seems there are some things which hake's interface can do
that Coadjute's can't:

  1. Arbitrary source/target pairing. This was really a d'oh moment
 for me and is trivial to fix. I think I'll even remove the current
 sourceToDatum functions and just provide a primitive with which you
 can map, fold, whatever.

 

Re: [Haskell-cafe] runghc Setup.hs doitall

2009-01-18 Thread Duncan Coutts
On Sun, 2009-01-18 at 12:28 -0600, Jeff Wheeler wrote:
 On Sun, 2009-01-18 at 18:24 +, Duncan Coutts wrote:
 
   In my experience, it usually fails because of missing dependencies like
   zlib-dev on my own system, but those are easy to fix, at which point I
   can rerun the bootstrap script.
  
  Patches accepted.
 
 Without digressing too much, I don't think much can be done here. I
 would not (and should not) expect the bootstrap.sh file to use apt to
 get the missing dependencies as I had to do.
 
 I don't think there's any general solution to this, beyond better error
 handling (which apparently you just improved).

It'll still fall over when it fails to find the zlib C lib. That's a
slightly more general issue:

Check for required C libraries during configure
http://hackage.haskell.org/trac/hackage/ticket/262

Again, patches gratefully accepted :-)

Duncan

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


Re: [Haskell-cafe] runghc Setup.hs doitall

2009-01-18 Thread Duncan Coutts
On Sun, 2009-01-18 at 18:35 +, Sebastian Sylvan wrote:
 On a similar note, would it not be nice if cabal install understood about 
 platforms and could tell you straight away that a package won't install 
 under e.g. windows, rather then spending ages trying and then failing 
 because a package tries to run a unix command?

We're pretty near to that. It does understand platforms. What we lack is
in the information that it does not work. We can get it in two ways. One
is if we cannot find sh.exe then we know straight away that all
configure based packages will not work.

We should be able to do similar things for packages that need C libs
headers etc that we cannot find. We should only need manual additional
info for a few packages.

The tickets in this context are:
http://hackage.haskell.org/trac/hackage/ticket/342
http://hackage.haskell.org/trac/hackage/ticket/400

 I always get a bit annoyed trying to do anything in windows with Haskell 
 libraries, at the very least I'd like it to be clear from the start that 
 something won't work (if it's by design) so I don't waste time trying. 
 Ideally the hackage website would even allow you to filter packages by the 
 OS you're using and would remove packages that won't build on that OS (by 
 recursively checking dependencies too).

Yes, we should be able to use the same info on hackage as in
cabal-install.

So, as usual the limiting factor is the number of people hacking on the
infrastructure. Time to get involved! :-)

Duncan

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


[Haskell-cafe] Re: ANN: hledger 0.3 released

2009-01-18 Thread Simon Michael
I've pushed a patch which should omit the vty dependency and ui  
command on windows. Sebastian, could you darcs get the latest code  
from http://joyful.com/repos/hledger and see if cabal configure and  
build works for you on windows ?

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


Re: Improved documentation for Bool (Was: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt)

2009-01-18 Thread Nathan Bloomfield
That's a great start, but coproduct is still pretty scary. Why not refer
to it as OneOrTheOtherButNotBothDataConstructor?

-Nathan Bloomfield

On Sun, Jan 18, 2009 at 11:32 AM, Sterling Clover s.clo...@gmail.comwrote:

 This is a great effort, but the root of the problem isn't just poor
 documentation, but an insistence on some obscure name. How about renaming
 Bool to YesOrNoDataVariable? I think this would help novice programmers a
 great deal.

 It would also make the documentation flow much more naturally:

 The Bool type is the coproduct of the terminal object with itself.

 --huh?

 The YesOrNoDataVariable is the coproduct of the terminal object with
 itself.

 --Oh! Of course!

 --S


 On Jan 18, 2009, at 12:17 PM, Benja Fallenstein wrote:

  On Sun, Jan 18, 2009 at 5:48 PM,  rocon...@theorem.ca wrote:

 I noticed the Bool datatype isn't well documented.  Since Bool is not a
 common English word, I figured it could use some haddock to help clarify
 it
 for newcomers.

 -- |The Bool datatype is named after George Boole (1815-1864).
 -- The Bool type is the coproduct of the terminal object with itself.


 Russell, this does seem like it might be very helpful, but it might be
 useful to include a note about what category you are working in.
 People may sometimes naively assume that one is working in the
 category of Haskell/Hugs/GHC data types and Haskell functions, in
 which there are no terminal -- or initial -- objects ('undefined' and
 'const undefined' are distinct maps between any two objects X and Y),
 or else in the similar category without lifted bottoms, in which the
 empty type is terminal and the unit type isn't ('undefined' and 'const
 ()' are both maps from any object X to the unit type). These niceties
 will not confuse the advanced reader, but it may help the beginner if
 you are more explicit.

 - Benja


 P.S. :-)
 ___
 Libraries mailing list
 librar...@haskell.org
 http://www.haskell.org/mailman/listinfo/libraries


 ___
 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] Stupid question, re: overloaded type classes

2009-01-18 Thread Brian Hurt


So, I'm working with this simplistic S-expression library of my own design 
(yes, I know, reinventing the wheel).  Basically, I have the type:


data Sexp =
List of [ Sexp ]
| Atom of String

with the associated parsers and printers which really aren't relevent to 
the question at hand.  Then, I want to define the type class of types I 
can convert to and from s-expressions, like:


class Sexpable a where
toSexp :: a - Sexp
fromSexp :: Sexp - Maybe a

here, fromSexp can return Nothing is the s-expression isn't the right form 
to be parsed into a whatever.


Now, here's the problem.  I want to define a bunch of default instances, 
and two in particular I want to define are:


instance Sexpable String where
toSexp s = Atom s
fromSexp (Atom s) = Just s
fromSexp _ = Nothing

instance Sexpable a = Sexpable [ a ] where
toSexp lst = List $ map toSexp lst
fromSexp (List lst) = mapM fromSexp lst
fromSexp _ = Nothing

Note that I am not implementing Sexpable Char anywhere, so the only valid 
transform for [Char] should be the String one.  But this still causes a 
compiler error due to the overloaded instances on [Char].


There are two solutions to this that I already know of.  One is to play 
games with newtype, which I don't like because it simply adds complexity 
in my case and doesn't help anything else.  The second possibility is to 
compile with -fallow-incoherent-instances, which I'm slightly afraid of 
because I'm not sure what (if any) possible errors adding this option 
might allow.


So my question is twofold: 1) what errors might be allowed if I add 
-fallow-incoherent-instances, and 2) is there some third choice that 
avoids both solutions I already know about?


Thanks.

Brian

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


Re: Improved documentation for Bool (Was: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt)

2009-01-18 Thread Derek Elkins
On Sun, 2009-01-18 at 18:17 +0100, Benja Fallenstein wrote:
 On Sun, Jan 18, 2009 at 5:48 PM,  rocon...@theorem.ca wrote:
  I noticed the Bool datatype isn't well documented.  Since Bool is not a
  common English word, I figured it could use some haddock to help clarify it
  for newcomers.
 
  -- |The Bool datatype is named after George Boole (1815-1864).
  -- The Bool type is the coproduct of the terminal object with itself.
 
 Russell, this does seem like it might be very helpful, but it might be
 useful to include a note about what category you are working in.
 People may sometimes naively assume that one is working in the
 category of Haskell/Hugs/GHC data types and Haskell functions, in
 which there are no terminal -- or initial -- objects 

The naive way of making a Haskell category doesn't even work.  Taking
objects to be Haskell types, all Haskell functions as arrows, arrow
equality being observational equality, and (.) and id to be the
composition and identity, you fail to even have a category.  Proof of
this is left as an (easy) exercise for the reader.

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


[Haskell-cafe] Re: ANNOUNCE: Coadjute 0.0.1, generic build tool

2009-01-18 Thread Henning Thielemann
Matti Niemenmaa schrieb:

 Anyway, hake looks interesting but it's not a replacement for Coadjute;
 and neither is Coadjute for hake. To be completely honest I'm not sure
 what use case hake is meant to solve: how does it improve over plain make?

It seems to be programmable, and thus may better cope with LaTeX, where
the simple 'make' philosophy fails. 'latex' must be called repeatedly,
interleaved with 'bibtex' and 'mkindex'.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Stupid question, re: overloaded type classes

2009-01-18 Thread Ryan Ingram
On Sun, Jan 18, 2009 at 11:23 AM, Brian Hurt bh...@spnz.org wrote:
 instance Sexpable String where

 instance Sexpable a = Sexpable [ a ] where

 Note that I am not implementing Sexpable Char anywhere, so the only valid
 transform for [Char] should be the String one.  But this still causes a
 compiler error due to the overloaded instances on [Char].

 So my question is twofold: 1) what errors might be allowed if I add
 -fallow-incoherent-instances, and 2) is there some third choice that avoids
 both solutions I already know about?

1) Incoherent instances end up being used in code like this:

blah :: Sexpable a = a - Sexp
blah x = toSexp [x]

In this case, assuming an instance for Sexpable Char, this code may or
may not use the wrong instance, depending on what happens with
inlining:

blah 'x'

which passes the dictionary for Sexpable Char and then probably uses
the instance Sexpable a = Sexpable [a] (with a = Char), instead of
Sexpable String.

As long as there are no instances for Sexpable Char anywhere,
incoherent instances won't cause an error in this case.  That said,
you can't guarantee that someone won't go and add an instance for
Char.

2) A third choice is to do what Show does, which is kind of a hack but
solves this specific problem:

class Sexpable a where
toSexp :: a - Sexp
fromSexp :: Sexp - Maybe a

toSexpList :: [a] - Sexp
fromSexpList :: Sexp - Maybe [a]

toSexpList = List . map toSexp
fromSexpList (List lst) = mapM fromSexp lst
fromSexpList _ = Nothing

instance Sexpable a = Sexpable [a] where
toSexp = toSexpList  -- from Sexpable a, not [a]
fromSexp = fromSexpList

This requires Sexpable Char, though, to give you the right place to
put the instance.  But it seems easy enough to include those; is there
a reason you explicitly don't want an instance for Char?

instance Sexpable Char where
   toSexp c = toSexpList [c]
   fromSexp l = do
   [c] - fromSexp l
   return c
   toSexpList s = Atom s
   fromSexpList (Atom s) = Just s
   fromSexpList _ = Nothing

I think that a design for typeclasses that eliminates the need for the
showList hack would be quite welcome.

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


Re: [Haskell-cafe] Stupid question, re: overloaded type classes

2009-01-18 Thread Ryan Ingram
On Sun, Jan 18, 2009 at 12:43 PM, sam lee skyn...@gmail.com wrote:
 The following code compiles fine on my ghci

This seems like a bug, you didn't enable overlapping instances and
these two instances clearly overlap:

instance Sexpable String where
instance Sexpable a = Sexpable [ a ] where

since String is a synonym for [Char].  Although maybe overlapping
doesn't get checked until you use the instance?  Try adding this line:

 test = toSexp hello

   -- ryan

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


[Haskell-cafe] meeep

2009-01-18 Thread Louis Wasserman
apologies for the old-digest copy spam.  .

Louis Wasserman
wasserman.lo...@gmail.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Anybody in Savannah?

2009-01-18 Thread Ketil Malde

Hi,

I arrived in Savannah yesterday (to attend PADL), and have spent the
most part of the day drifting aimlessly around.  Thrilling as that may
be, I thought perhaps there might be other members of the Haskell
community around, and that perhaps we could arrange to meet informally
for coffee, beer, dinner?

-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] Anybody in Savannah?

2009-01-18 Thread Don Stewart
ketil:
 
 Hi,
 
 I arrived in Savannah yesterday (to attend PADL), and have spent the
 most part of the day drifting aimlessly around.  Thrilling as that may
 be, I thought perhaps there might be other members of the Haskell
 community around, and that perhaps we could arrange to meet informally
 for coffee, beer, dinner?

Some Galwegians will be at POPL and related events.

http://www.galois.com/blog/2009/01/18/galois-at-popl/

Say hi to them :)

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


Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-18 Thread David Waern
2009/1/18 Don Stewart d...@galois.com:
 ross:
 On Sat, Jan 17, 2009 at 09:12:32PM -0500, a...@spamcop.net wrote:
  And FWIW, I agree with everyone who has commented that the documentation
  is inadequate.  It'd be nice if there was some way to contribute better
  documentation without needing checkin access to the libraries.

 There is.  The current state of the docs may be viewed at

   http://www.haskell.org/ghc/dist/current/docs/libraries/

 Anyone can check out the darcs repos for the libraries, and post
 suggested improvements to the documentation to librar...@haskell.org
 (though you have to subscribe).  It doesn't even have to be a patch.

 Sure, it could be smoother, but there's hardly a flood of contributions.

 I imagine if we set up a wiki-like system where the entire hackage docs
 could be edited, as well as viewed, we would end up with a flood.

 A modification to haddock perhaps, that sends edits to generated docs to 
 libraries@ ?

This has come up many times lately. I've created a ticket for it:

  http://trac.haskell.org/haddock/ticket/72

If anyone has suggestions for design or implementation of a system
like this, don't hesitate to post to this ticket!

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


Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-18 Thread Don Stewart
david.waern:
 2009/1/18 Don Stewart d...@galois.com:
  ross:
  On Sat, Jan 17, 2009 at 09:12:32PM -0500, a...@spamcop.net wrote:
   And FWIW, I agree with everyone who has commented that the documentation
   is inadequate.  It'd be nice if there was some way to contribute better
   documentation without needing checkin access to the libraries.
 
  There is.  The current state of the docs may be viewed at
 
http://www.haskell.org/ghc/dist/current/docs/libraries/
 
  Anyone can check out the darcs repos for the libraries, and post
  suggested improvements to the documentation to librar...@haskell.org
  (though you have to subscribe).  It doesn't even have to be a patch.
 
  Sure, it could be smoother, but there's hardly a flood of contributions.
 
  I imagine if we set up a wiki-like system where the entire hackage docs
  could be edited, as well as viewed, we would end up with a flood.
 
  A modification to haddock perhaps, that sends edits to generated docs to 
  libraries@ ?
 
 This has come up many times lately. I've created a ticket for it:
 
   http://trac.haskell.org/haddock/ticket/72
 
 If anyone has suggestions for design or implementation of a system
 like this, don't hesitate to post to this ticket!
 

Added to the entry on the proposals tracker,

http://www.reddit.com/r/haskell_proposals/

If nothing else, this would make a good SoC project.

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


Re: [Haskell-cafe] Anybody in Savannah?

2009-01-18 Thread voigt
 Hi,

 I arrived in Savannah yesterday (to attend PADL), and have spent the
 most part of the day drifting aimlessly around.  Thrilling as that may
 be, I thought perhaps there might be other members of the Haskell
 community around,

I will be, in about three hours.

Plans for tonight: sleeping :-)

But maybe see you tomorrow?

Janis



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


Re: [Haskell-cafe] real haskell difficulties (at least for me)

2009-01-18 Thread David Waern
2009/1/18 Duncan Coutts duncan.cou...@worc.ox.ac.uk:

 Second, and this would take more work, I would like it if the Haddock
 documentation for packages could be given a wiki-like and/or reddit-like
 interface so that people could make comments about what is unclear or
 needs better documentation as well as offering
 spelling/grammar/punctuation suggestions[2]. Viewers should be able to
 set preferences for whether they want to see the real/current
 documentation, or whether they want to see the commented/modified
 version (hiding things below a certain depth or rank for reddit-like).

 We had a thread on this the other day with similar ideas.

It might not count as a summary, since I'm not sure I've read all of
the discussion, but I added a ticket describing this type of system
here:

  http://trac.haskell.org/haddock/ticket/72

If something is missing, please add it, and feel free to post more thoughts.

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


Re: [Haskell-cafe] Anybody in Savannah?

2009-01-18 Thread Ketil Malde
vo...@tcs.inf.tu-dresden.de writes:

 I will be, in about three hours.

 Plans for tonight: sleeping :-)

Boring!

 But maybe see you tomorrow?

Sure!  I got some replies, so hopefully my evening won't be entirely
solitary.

For anybody else who didn't have time to respond, I'll stroll down in
the lobby of the conference hotel as of now, and hang around for the
next hour or so.  Feel free to meet up.

-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] Different return type?

2009-01-18 Thread John Ky
Hi,

Possibly a silly question but is it possible to have a function that has a
different return type based on it's first argument?

For instance

data Person = Person { name :: String, ... }
data Business = Business { business_number :: Int, ...}

key person = name person
key business = business_number business

Thanks

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


Re: [Haskell-cafe] Stupid question, re: overloaded type classes

2009-01-18 Thread Brian Hurt



On Sun, 18 Jan 2009, Ryan Ingram wrote:


2) A third choice is to do what Show does, which is kind of a hack but
solves this specific problem:


Thanks.  I like this solution much better than the two I proposed.

Brian

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


Re: [Haskell-cafe] Different return type?

2009-01-18 Thread Daniel Fischer
Am Montag, 19. Januar 2009 02:44 schrieb John Ky:
 Hi,

 Possibly a silly question but is it possible to have a function that has a
 different return type based on it's first argument?

 For instance

 data Person = Person { name :: String, ... }
 data Business = Business { business_number :: Int, ...}

 key person = name person
 key business = business_number business

 Thanks

 -John

Well, you could use

{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, 
TypeSynonymInstances #-}
module Key where

data Person = Person { name :: String }
data Business = Business { business_number :: Int}

class Key a b | a - b where
key :: a - b

instance Key Person String where
key = name

instance Key Business Int where
key = business_number

or with type families:
{-# LANGUAGE TypeFamilies #-}
class Key2 a where
type Res a
key2 :: a - Res a

instance Key2 Person where
type Res Person = String
key2 = name

instance Key2 Business where
type Res Business = Int
key2 = business_number


but apart from that and parametrically polymorphic functions (of type a - [a] 
or the like), I don't think it's possible, it would need dependent types.

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


Re: [Haskell-cafe] Re: ANNOUNCE: Coadjute 0.0.1, generic build tool

2009-01-18 Thread Brandon S. Allbery KF8NH

On 2009 Jan 18, at 13:47, Matti Niemenmaa wrote:

 3. Coadjute keeps track of command line arguments (see docs for
details): for me this is really a killer feature, I don't know of
anything else which does this.


It's been done many times before; it never seems to catch on.  My  
personal favorite was Shape (http://user.cs.tu-berlin.de/~shape/)  
which I used for a few local projects in the late 80s.  SCons is  
perhaps the most popular tool in this class (and itself a  
Pythonization of the original Perl Cons; maybe it's time for HCons?),  
followed by Apache's Ant (I don't think that actually caches command  
lines or binaries though), then Jam and successors.


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


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


Re: [Haskell-cafe] Different return type?

2009-01-18 Thread John Ky
Hi Daniel,

When would I use either?  What are the trade-offs?

Thanks

-John

On Mon, Jan 19, 2009 at 1:13 PM, Daniel Fischer daniel.is.fisc...@web.dewrote:

 Am Montag, 19. Januar 2009 02:44 schrieb John Ky:
  Hi,
 
  Possibly a silly question but is it possible to have a function that has
 a
  different return type based on it's first argument?
 
  For instance
 
  data Person = Person { name :: String, ... }
  data Business = Business { business_number :: Int, ...}
 
  key person = name person
  key business = business_number business
 
  Thanks
 
  -John

 Well, you could use

 {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies,
 TypeSynonymInstances #-}
 module Key where

 data Person = Person { name :: String }
 data Business = Business { business_number :: Int}

 class Key a b | a - b where
key :: a - b

 instance Key Person String where
key = name

 instance Key Business Int where
key = business_number

 or with type families:
 {-# LANGUAGE TypeFamilies #-}
 class Key2 a where
type Res a
key2 :: a - Res a

 instance Key2 Person where
type Res Person = String
key2 = name

 instance Key2 Business where
type Res Business = Int
key2 = business_number


 but apart from that and parametrically polymorphic functions (of type a -
 [a]
 or the like), I don't think it's possible, it would need dependent types.

 HTH,
 Daniel

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