Re: [GHC] #3223: please detect multiple kind errors in one run

2009-05-14 Thread GHC
#3223: please detect multiple kind errors in one run
-+--
Reporter:  nr|Owner:  
Type:  feature request   |   Status:  closed  
Priority:  normal|Milestone:  
   Component:  Compiler  |  Version:  6.10.1  
Severity:  normal|   Resolution:  fixed   
Keywords:|   Difficulty:  Unknown 
Testcase:|   Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |  
-+--
Comment (by simonpj):

 I cannot reproduce this either with 6.10.1.  I've tried modifying
 `ZDF5ex.hs` (as of today), lines 417 and 922, and I get both kind errors
 in one sweep.
 {{{
 compiler\cmm\ZDF5ex.hs:417:31:
 Kind error: `ForwardFixedPoint' is applied to too many type arguments
 In the type `ForwardFixedPoint m l O C a (ZipGF m l O C)'
 In the type `FuelMonad (ForwardFixedPoint m l O C a (ZipGF m l O C))'
 In the type `ZipGF m l O C
  - FuelMonad (ForwardFixedPoint m l O C a (ZipGF m l O
 C))'

 compiler\cmm\ZDF5ex.hs:922:19:
 Kind error: `BackwardFixedPoint' is applied to too many type arguments
 In the type `BackwardFixedPoint m l O C a ()'
 In the type `ZipGF m l O C - BackwardFixedPoint m l O C a ()'
 In the type `BackwardTransfers m l a
  - ZipGF m l O C - BackwardFixedPoint m l O C a ()'
 }}}
 If you can give us a repro case, I'll look at it some more.  It's possible
 there is something wrong... after all you said it was still the case with
 6.10.1.  Pls re-open if you can see it again.

 Simon

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3223#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] #2737: add :tracelocal to ghci debugger to trace only the expressions in a given function

2009-05-14 Thread GHC
#2737: add :tracelocal to ghci debugger to trace only the expressions in a given
function
-+--
Reporter:  phercek   |Owner:  
Type:  feature request   |   Status:  new 
Priority:  normal|Milestone:  6.12 branch 
   Component:  GHCi  |  Version:  6.8.3   
Severity:  normal|   Resolution:  
Keywords:  debugger  |   Difficulty:  Unknown 
Testcase:|   Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |  
-+--
Comment (by fasta):

 I don't really believe in the too much overhead argument, until there is
 a clear analysis, which demonstrates this. It's often possible during
 debugging to create a small test case (one which does not take a long time
 to run). So, even recording all the state changes in the machine would be
 possible. I also argue that this should be the default. If it is too slow,
 people would just use some approximation (like is currently being done).

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/2737#comment:5
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] #3128: hClose leaves file descriptor open if it fails

2009-05-14 Thread GHC
#3128: hClose leaves file descriptor open if it fails
-+--
Reporter:  Baughn|Owner:  simonmar
Type:  bug   |   Status:  new 
Priority:  normal|Milestone:  6.12.1  
   Component:  libraries/base|  Version:  6.10.1  
Severity:  normal|   Resolution:  
Keywords:|   Difficulty:  Unknown 
Testcase:|   Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |  
-+--
Comment (by Baughn):

 I would like to add that Handles *should* contain an MVar (Maybe FD) or
 some such instead of just an FD. Or, rather, after a handle is hClosed -
 and the socket goes away - it ought to be impossible to use that handle
 for anything whatsoever.

 As it is now, it's possible for the FD to be reused, and for code that
 reuses the closed Handle to touch someone else's FD.

 This may not violate the haskell spec, but neither would code where you
 can't do that, and the cost would be trivial.

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3128#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] #2737: add :tracelocal to ghci debugger to trace only the expressions in a given function

2009-05-14 Thread GHC
#2737: add :tracelocal to ghci debugger to trace only the expressions in a given
function
-+--
Reporter:  phercek   |Owner:  
Type:  feature request   |   Status:  new 
Priority:  normal|Milestone:  6.12 branch 
   Component:  GHCi  |  Version:  6.8.3   
Severity:  normal|   Resolution:  
Keywords:  debugger  |   Difficulty:  Unknown 
Testcase:|   Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |  
-+--
Comment (by phercek):

 Maybe the analysis was done, at least partially.
 [http://www.haskell.org/~simonmar/papers/ghci-debug.pdf A Lightweight
 Interactive Debugger for Haskell] paper indicates so at the end of chapter
 4.3.[[BR]]
 As for as the filtering of the trace history, it is not about performace
 savings but making sure that the right stuff is in it. A possibility of
 detailed filtering what goes into the trace log is important. I discussed
 it in this message
 [http://permalink.gmane.org/gmane.comp.lang.haskell.glasgow.user/16270 my
 experience with ghci debugger extensions].[[BR]]
 Btw, a new version of {{{GhciExt}}} (0.6) is available
 [http://www.hck.sk/users/peter/pub/ here]. It does not require prefixing
 with {{{:x}}} any more and works with stock ghc 6.10.3. No custom patches
 to ghc are needed.

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/2737#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: [GHC] #2946: tracing should be controled by a global flag

2009-05-14 Thread GHC
#2946: tracing should be controled by a global flag
-+--
Reporter:  phercek   |Owner:  
Type:  feature request   |   Status:  new 
Priority:  normal|Milestone:  6.12 branch 
   Component:  GHCi  |  Version:  6.10.1  
Severity:  minor |   Resolution:  
Keywords:  debugger  |   Difficulty:  Unknown 
Testcase:|   Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |  
-+--
Changes (by phercek):

  * summary:  tracing should be controled by a global flag (it should not
  be resume context specific) = tracing should
  be controled by a global flag

Comment:

 As I discussed in message
 [http://permalink.gmane.org/gmane.comp.lang.haskell.glasgow.user/16270 my
 experience with ghci debugger extensions], the {{{:set trace}}} should
 have a grammar like this:[[BR]]
 {{{
  -- should everything be traced?
 :set trace (True|False)
 -- scopes which should be traced (or should not be traced when ! is
 present)
 :set trace ( (!)? scopeid )*
 -- add/remove individual scopeids to/from the trace specification
 :set trace (+|-) (!)? scopeid
 -- scopeid = ( conid . )* ( varid . )* varid | { breakPointArgs }
 }}}
 {{{scopeId}}} can be specified by its hierarchical identifier or by
 breakpoint arguments in curly braces.

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/2946#comment:5
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


[GHC] #3228: please make it easier to remove a file from the GHC sources

2009-05-14 Thread GHC
#3228: please make it easier to remove a file from the GHC sources
+---
Reporter:  nr   |  Owner:  
Type:  feature request  | Status:  new 
Priority:  normal   |  Component:  Build System
 Version:  6.11 |   Severity:  normal  
Keywords:   |   Testcase:  
  Os:  Linux|   Architecture:  x86 
+---
 I'm trying to remove some obsolete code from GHC's back end. (It will live
 forever
 in darcs).  The only workflow I can find that works is
 {{{
 cd $TOP
 ./configure
 (cd compiler; make -k -j 5)
 }}}
 This workflow is really expensive; on a 4-processor machine it is costing
 me 48 seconds every time I remove a file...


 Norman

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3228
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] #2945: add command :mergetrace

2009-05-14 Thread GHC
#2945: add command :mergetrace
-+--
Reporter:  phercek   |Owner:  
Type:  feature request   |   Status:  new 
Priority:  normal|Milestone:  6.12 branch 
   Component:  GHCi  |  Version:  6.10.1  
Severity:  normal|   Resolution:  
Keywords:  debugger  |   Difficulty:  Unknown 
Testcase:|   Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |  
-+--
Changes (by phercek):

  * summary:  trace history should be global or add command :mergetrace =
  add command :mergetrace

Comment:

 {{{:mergetrace}}} is better than a global trace history. Being able to
 investigate something separately in a nested context is useful.

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/2945#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


[GHC] #3229: queued GHCi commands are not resume context specific

2009-05-14 Thread GHC
#3229: queued GHCi commands are not resume context specific
-+--
Reporter:  phercek   |  Owner:  
Type:  bug   | Status:  new 
Priority:  normal|  Component:  GHCi
 Version:  6.10.3|   Severity:  normal  
Keywords:  debugger  |   Testcase:  
  Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
-+--
 I think it is a bug that the second part ({{{:continue}}}) of the command
 {{{:cmd return rv\n:continue}}} is executed in a different context than
 the first part (rv (request for the value of rv variable)). Notice that we
 did not stop at breakpoint 1 (line 7). Well, the stop happened but it
 continued immediately because of queued {{{:continue}}} command. But the
 command was queued in the context of breakpoint 0 and not breakpoint 1.
 {{{
 status:0 pe...@metod [716] ~/tmp
 % grep -n '^' b.hs
 1:fn :: Int - Int
 2:fn x =
 3:  let rv = add x 1 in
 4:  rv
 5:
 6:add :: Int - Int - Int
 7:add a b = a + b
 status:0 pe...@metod [717] ~/tmp
 % ghci b.hs
 GHCi, version 6.10.1: http://www.haskell.org/ghc/  :? for help
 Loading package ghc-prim ... linking ... done.
 Loading package integer ... linking ... done.
 Loading package base ... linking ... done.
 [1 of 1] Compiling Main ( b.hs, interpreted )
 Ok, modules loaded: Main.
 *Main :set stop :list
 *Main :break 4
 Breakpoint 0 activated at b.hs:4:2-3
 *Main :break 7
 Breakpoint 1 activated at b.hs:7:0-14
 *Main fn 100
 Stopped at b.hs:4:2-3
 _result :: Int = _
 rv :: Int = _
 3let rv = add x 1 in
 4rv
 5
 [b.hs:4:2-3] *Main :cmd return rv\n:continue
 Stopped at b.hs:7:0-14
 _result :: Int = _
 6  add :: Int - Int - Int
 7  add a b = a + b
 8
 101
 [b.hs:4:2-3] *Main :continue
 101
 *Main :q
 Leaving GHCi.
 status:0 pe...@metod [718] ~/tmp
 %
 }}}
 The log was done with 6.10.1 but it is the same with 6.10.3.[[BR]]
 I posted about this to the ghc users list about 2 months ago but nobody
 responded. My guess is nobody minds either way since nobody scripts
 breakpoints. At least it would be fine to know whether a patch fixing this
 has a chance to be accepted.

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3229
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


[GHC] #3230: Build fails with cabal-bin complaining

2009-05-14 Thread GHC
#3230: Build fails with cabal-bin complaining
---+
Reporter:  guest   |  Owner:
Type:  bug | Status:  new   
Priority:  normal  |  Component:  Build System  
 Version:  6.10.3  |   Severity:  normal
Keywords:  |   Testcase:
  Os:  Linux   |   Architecture:  x86_64 (amd64)
---+
 The build of ghc 6.10.3 and 6.10.2 (I haven't tested others) on a Debian
 Etch (ghc 6.6) system fails like so (I am attaching a complete log as
 well):
 {{{
 Configuring ghc-6.10.3...
 cabal-bin: At least the following dependencies are missing:
 Cabal -any,
 base 3,
 filepath =1  1.2,
 haskell98 -any,
 hpc -any,
 template-haskell -any,
 unix -any
 make[3]: *** [boot.stage.2] Error 1
 }}}

 I am trying to build using the following Makefile (which ought to work
 based on my understanding of
 http://hackage.haskell.org/trac/ghc/wiki/Building/Using):

 {{{
 #!/usr/bin/make -f

 ghc_version := 6.10.3
 ghc_dir := ghc-$(ghc_version)
 .PHONY: ghc
 ghc:
 rm -rf $(ghc_dir)/
 tar -xjf ghc-$(ghc_version)-src.tar.bz2
 tar -xjf ghc-$(ghc_version)-src-extralibs.tar.bz2
 cd $(ghc_dir)/  ./configure --prefix=/tmp/g
 sed -e 's...@^#buildflavour = quick...@buildflavour = quickest@'
 $(ghc_dir)/mk/build.mk.sample \
 $(ghc_dir)/mk/build.mk
 $(MAKE) -C $(ghc_dir)
 }}}

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3230
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] #3226: please eliminate error message from Make on every build

2009-05-14 Thread GHC
#3226: please eliminate error message from Make on every build
-+--
Reporter:  nr|Owner:  
Type:  feature request   |   Status:  new 
Priority:  normal|Milestone:  
   Component:  Build System  |  Version:  6.11
Severity:  trivial   |   Resolution:  
Keywords:|   Difficulty:  Unknown 
Testcase:|   Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |  
-+--
Comment (by nr):

 I just pulled from the darcs head a few days ago, so I presume I'm
 building 6.11.

 I don't know where {{{Makefile-stage1}}} comes from---maybe it is a stale
 version from a while back---but it is very, very useful.  Comparing
 {{{
 make -f Makefile dist/stage1/ZipGF.o
 }}}
 and
 {{{
 make -f Makefile-stage1 dist/stage1/ZipGF.o
 }}}
 the second is considerably faster.

 I basically am asking for a fast path to attempt to compile a .o file from
 possibly stale dependencies.  I am very, very eager to trade accuracy for
 speed here.  If something strange happens I can always resort to the full
 Makefile.

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3226#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] #3223: please detect multiple kind errors in one run

2009-05-14 Thread GHC
#3223: please detect multiple kind errors in one run
-+--
Reporter:  nr|Owner:  
Type:  feature request   |   Status:  closed  
Priority:  normal|Milestone:  
   Component:  Compiler  |  Version:  6.10.1  
Severity:  normal|   Resolution:  fixed   
Keywords:|   Difficulty:  Unknown 
Testcase:|   Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |  
-+--
Comment (by nr):

 I have now upgraded to 6.10, and this bug should stay closed.

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3223#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


ANN: GhciExt 0.6 for GHC 6.10.3

2009-05-14 Thread Peter Hercek

Hi,

I know there were 4 unique IP addresses which checked it out. Since I do 
not know who they are I just spam this list again :)

You can get it here: http://www.hck.sk/users/peter/pub/
If you decide to give it a try then read the README file before installing.
It should work with the stock GHC 6.10.2 and higher, but I only tried 
briefly with GHC 6.10.3 (as it was released) and I use it without any 
problem with my customized GHC 6.10.3 (dirty support for ansi escape 
sequences in ':set prompt' for color highlighting of the prompt, patch 
for ticket http://hackage.haskell.org/trac/ghc/ticket/3084 (allow macros 
to redefine builtin GHCi commands), and few more details).


Here is what it does:

Prelude :defs long
:. file -- source commands from file
:* count cmd...   -- run cmd count times
:x cmd...   -- run cmd with stdout suppressed
:out  -- redirect ghci stdout back to console
:redir var cmd... -- execute cmd redirecting stdout to var
:grep args  cmd...   -- run grep args on cmd output
Runs grep from your OS on the output of cmd. This means all the options
of your OS grep are available. '' separates grep options from the command.
:find cmd [-]var  -- step with cmd until var is found
Prepend variable name with '-' to disable printing of its value.
:locate cmd bpArgs-- step with cmd until location bpArgs is hit
:bp bpArgs  -- put breakpoint at bpArgs (adds hit count)
:inject cc c sc b -- at location b run c if cc and stop if 
sc

There are two special identifiers which can be used in the breakpoint
code (c) and the breakpoint stop condition (sc); but which are not
usable in the breakpoint code condition (cc). These are:
 - ghciExt_BpId - macro name; translates to breakpoint id
 - ghciExt_HitCnt - macro name; translates to breakpoint hit count
:strobe [c] b   -- at location b show hit count if c
:monitor [c] vs b -- show comma-sep. variables at location b 
if c

:watch cond bpArgs-- break at location bpArgs when cond is True
:count N [bpArgs] -- count/stop execution at bpArgs or query 
bp hits

There are three ways how to use this command:
 - :count 0 bpArgs  - never stops; counts hits and extends trace history
 - :count N bpArgs  - stops when location bpArgs is hit N-th time
 - :count N  - shows hit count of a ghciExt breakpoint with number N.
:hl cmd...  -- highlight the output of cmd
:defs [long]  -- list user commands (possibly with long help)
General information for all GhciExt commands:
- Most arguments may be in quotation marks (to allow spaces in them).
- Instead of a regular quotation mark, @x can be used to start a string
  argument too. In such a case the argument is finished when character
  x appears again after `...@x' string. Use any character in place of x.
  This was added so that one does not need to escape quotation marks
  and back-slashes in arguments (especially those representing code).
Prelude

Not so much obsolete description of how it works (and how to use it) is 
here:


http://permalink.gmane.org/gmane.comp.lang.haskell.glasgow.user/16270

Notable changes are:
* much better :grep command (you can even get color highlighted output)
* you do not need to prefix commands :main, :continute, :step, and :trace with 
:x any more
* :findex replaced with much better :locate

It works on linux. The only reason I recall it would not work on windows is the 
use of '/dev/null'. But I never tried on windows.


Enjoy,
 Peter.


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


[Haskell] Fun with type functions

2009-05-14 Thread Simon Peyton-Jones
Friends

Ken, Oleg, and I have been working on a tutorial paper about type families (aka 
associated data types, or type functions). It's in draft at the moment, and 
we'd really appreciate feedback that would help us improve it.

Here it is: http://haskell.org/haskellwiki/Simonpj/Talk:FunWithTypeFuns

Thank you!

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


[Haskell] Re: ANNOUNCE: GHC version 6.10.3

2009-05-14 Thread Benjamin L . Russell
What happened to the Windows installation section in the corresponding
User's Guide?  The User's Guide for GHC version 6.10.2 (see
http://www.haskell.org/ghc/docs/6.10.2/html/users_guide/index.html)
had section 2.2: Installing on Windows (see
http://www.haskell.org/ghc/docs/6.10.2/html/users_guide/install-windows.html#winfaq),
but this section seems to be missing in the corresponding document for
version 6.10.3 (see
http://www.haskell.org/ghc/docs/latest/html/users_guide/index.html).
Not only that, but the entire chapter 2: Installing GHC seems to be
missing.

-- Benjamin L. Russell

On Sat, 9 May 2009 14:59:57 +0100, Ian Lynagh ig...@earth.li wrote:


   ==
The (Interactive) Glasgow Haskell Compiler -- version 6.10.3
   ==

The GHC Team is pleased to announce a new patchlevel release of GHC.
This release contains a handful of bugfixes relative to 6.10.2 and
better line editing support in GHCi, so we recommend upgrading.

Release notes are here:

  http://haskell.org/ghc/docs/6.10.3/html/users_guide/release-6-10-3.html

How to get it
~

The easy way is to go to the web page, which should be self-explanatory:

http://www.haskell.org/ghc/

We supply binary builds in the native package format for many
platforms, and the source distribution is available from the same
place.

Packages will appear as they are built - if the package for your
system isn't available yet, please try again later.


Background
~~

Haskell is a standard lazy functional programming language; the
current language version is Haskell 98, agreed in December 1998 and
revised December 2002.

GHC is a state-of-the-art programming suite for Haskell.  Included is
an optimising compiler generating good code for a variety of
platforms, together with an interactive system for convenient, quick
development.  The distribution includes space and time profiling
facilities, a large collection of libraries, and support for various
language extensions, including concurrency, exceptions, and foreign
language interfaces (C, whatever).  GHC is distributed under a
BSD-style open source license.

A wide variety of Haskell related resources (tutorials, libraries,
specifications, documentation, compilers, interpreters, references,
contact information, links to research groups) are available from the
Haskell home page (see below).


On-line GHC-related resources
~~

Relevant URLs on the World-Wide Web:

GHC home page  http://www.haskell.org/ghc/
GHC developers' home page  http://hackage.haskell.org/trac/ghc/
Haskell home page  http://www.haskell.org/


Supported Platforms
~~~

The list of platforms we support, and the people responsible for them,
is here:

   http://hackage.haskell.org/trac/ghc/wiki/Contributors

Ports to other platforms are possible with varying degrees of
difficulty.  The Building Guide describes how to go about porting to a
new platform:

http://hackage.haskell.org/trac/ghc/wiki/Building


Developers
~~

We welcome new contributors.  Instructions on accessing our source
code repository, and getting started with hacking on GHC, are
available from the GHC's developer's site run by Trac:

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


Mailing lists
~

We run mailing lists for GHC users and bug reports; to subscribe, use
the web interfaces at

http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

There are several other haskell and ghc-related mailing lists on
www.haskell.org; for the full list, see

http://www.haskell.org/mailman/listinfo/

Some GHC developers hang out on #haskell on IRC, too:

http://www.haskell.org/haskellwiki/IRC_channel

Please report bugs using our bug tracking system.  Instructions on
reporting bugs can be found here:

http://www.haskell.org/ghc/reportabug
-- 
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


Re: [Haskell-cafe] IO trouble

2009-05-14 Thread Henning Thielemann
Xiao-Yong Jin schrieb:
 Lauri Alanko l...@iki.fi writes:
 
 On Tue, May 12, 2009 at 04:59:36PM -0400, Xiao-Yong Jin wrote:
 f :: a - b
 g :: (a - b) - c - d
 gf :: c - d
 gf = g f
 Now I want to handle exceptions in f and redefine f as in f'

 f' :: a - IO (Either e b)
 So my question is how to define gf' now to use f' instead of
 f?

 gf' :: c - IO (Either e d)
 Use Control.Monad.Error.ErrorT, it's exactly for this. You have to
 monadize g to be able to pass f' as an argument to it.

 f' :: a - ErrorT e IO b
 g' :: Monad m = (a - m b) - c - m d
 gf' :: c - ErrorT e IO d
 gf' = g' f'
 
 So there is no way to do it without monadize g to g', is
 it?  Big trouble, sigh.

Sure, but I'm afraid that gets more complicated. Btw. you can also use
ExceptionalT and Exceptional from explicit-exception package, which does
not require a constraint on the exception type.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [darcs-users] [Haskell-cafe] Darcs as undo/redo system?

2009-05-14 Thread Wolfgang Jeltsch
Am Mittwoch, 13. Mai 2009 02:55 schrieb Trent W. Buck:
 Wolfgang Jeltsch g9ks1...@acme.softbase.org writes:
  Am Freitag, 8. Mai 2009 18:43 schrieb Jason Dagit:
  If you wanted to work on this, I would encourage you to read more
  about patch theory[1,2,3,4] and also try out libdarcs[5].
 
  Is libdarcs the same as the darcs library package on Hackage (which
  exports the darcs API)?

 The Darcs package (both on Hackage and elsewhere) builds two things: the
 darcs(1) binary, and libHSdarcs.  The latter is what Jason was referring
 to.  Note that currently it just exposes all our internal functions,
 rather than providing a coherent (or stable!) API.

I know. My students, who worked on a darcs GUI frontend, already experienced 
this. ;-) 

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


Re: [Haskell-cafe] Removing mtl from the Haskell Platform

2009-05-14 Thread Wolfgang Jeltsch
Am Mittwoch, 13. Mai 2009 01:03 schrieb rocon...@theorem.ca:
 I wanted to pass this idea around the cafe to get some thoughts before
 submitting a trac on this topic.

 I'd like to see the mtl removed from the Haskell Platform.

 The mtl was a tremendous step forward when it was developed.  However, we
 have learned a few things about monad transformers since the development
 of the mtl, and it is time that we moved forward.

 There are at least 3 significant problem with the mtl.

 1) `pass' should not be a member functions of the MonadWriter class.  It
 is my understanding that there is no `MonadWriter w m = MonadWriter w
 (ContT s m)' instance because the `pass' function cannot be implemented.
 I'm also highly suspicious of some other methods too (I'm looking at you
 `local').

 2) The `StateT s (Cont r a)' instance of callCC is wrong.  The paper on
 modular monad transformers
 http://www.cs.nott.ac.uk/~mjj/pubs/mmt/mmt.pdf describes why this is
 wrong.

 3) I am told by many people that the order of the state and value pair in
 `State' is backwards.  Actually, I'm not entirely sure what the issue is
 here, but I trust the people who say this.

4) The identifiers State and StateT are flawed. Something of value State s a 
doesn’t denote a state but a state transformer or however you want to name 
it.

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


Re: [Haskell-cafe] [ANNOUNCE] Bindings for libguestfs

2009-05-14 Thread Richard W.M. Jones
On Wed, May 13, 2009 at 11:15:24PM +1000, Peter Gammie wrote:
 Hope this helps!

Thanks for your honest  helpful answer.  I think I will try again at
compiling c2hs so I can look at the code that it generates.

Rich.

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Removing mtl from the Haskell Platform

2009-05-14 Thread Thomas ten Cate
On Thu, May 14, 2009 at 10:14, Wolfgang Jeltsch
g9ks1...@acme.softbase.org wrote:
 4) The identifiers State and StateT are flawed. Something of value State s a
 doesn’t denote a state but a state transformer or however you want to name
 it.

A state monad, i.e. a monad containing a state? If you use it in a
sentence in that way, the name State makes sense. StateTransformer
or something like that would lead to much confusion with the state
transformer transformer that is currently called StateT. I don't
really see a good alternative to the name State, and a good thing
about it is that it is short. Oh, bikesheds ought to be brown, of
course.

Cheers,

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


Re: [Haskell-cafe] Functional Reactive Web Application Framework?

2009-05-14 Thread Robert Wills
Yes, I didn't realise that until Arjun mentioned that.  I'm going to
try to find some time to look more closely at Flapjax...

-Rob

On Wed, May 13, 2009 at 11:30 PM, Don Stewart d...@galois.com wrote:
 wrwills:
 The  only web-oriented frp framework that I know of is Flapjax
 http://www.flapjax-lang.org/

 Flapjax is javascript so possibly there could be a way to integrate it
 into Haskell using HJavascript?  Maybe it could even be integrated
 into Happstack?

 I'm also quite new to Haskell.

 Isn't the flapjax compiler implemented in Haskell?

 -- Don

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


Re: [Haskell-cafe] Structural sharing in haskell data structures?

2009-05-14 Thread Vladimir Ivanov
Wren,

It's not true for Java either.
The idea of cheap throw-away objects isn't foreign for modern JVMs.
GC favors short-lived immutable objects since:
 - all collectors are generational;
 - GC cycle duration is proportional to the size of live objects, not
the heap size;
 - object allocation is _very_ cheap, even in parallel;

Moreover, many advanced techniques are used in JVM GCs:
  - there are parallel  concurrent collectors;
  - adaptive ergonomics (e.g. heap resizing, according to some goals
on collection duration);

There are problems with functional languages on top of JVM, but GC
isn't among them.
If you are interested in current work, you may look at mlvm project [1].

-- vi

[1] http://openjdk.java.net/projects/mlvm/

On Thu, May 14, 2009 at 2:58 AM, wren ng thornton w...@freegeek.org wrote:
 Jan-Willem Maessen wrote:

 I wanted to clear up one misconception here...

 wren ng thornton wrote:
  In heavily GCed languages like Haskell allocation and collection is 
  cheap, so we don't mind too much; but in Java and the like, both 
  allocation and collection are expensive so the idea of cheap throwaway 
  objects is foreign.

 Not true!

 I was speaking of Java, not Clojure. I believe the costs in Java are well
 documented, though I don't know enough about the JVM to know where the blame
 belongs. (All I know of Clojure is that it's a Lisp-like on the JVM :)


 If you look at the internals of Clojure, you'll discover they're using
 trees with *very* wide fanout (eg fanout-64 leaf trees for lists).  Why?
  Because it's so cheap to allocate and GC these structures!  By using
 shallow-but-wide trees we reduce the cost of indexing and accessing list
 elements.  I suspect you'd still be hard-pressed to support this kind of
 allocation behavior in any of the present Haskell implementations, and
 Haskell implementations of the same kinds of structures have limited fanout
 to 2-4 elements or so.

 I was under the impression that the reason datastructures in Haskell tend to
 be limited to 4-fanout had more to do with the cleanliness of the
 implementations--- pattern matching on 64-wide cells is quite ugly, as is
 dealing with the proliferation of corner cases for complex structures like
 finger trees, patricia trees, etc. The use of view patterns could clean this
 up significantly. On the other hand, we do have things like lazy ByteStrings
 and UVector which do have wide fanouts.

 --
 Live well,
 ~wren
 ___
 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] Fun with type functions

2009-05-14 Thread Simon Peyton-Jones
Friends

Ken, Oleg, and I have been working on a tutorial paper about type families (aka 
associated data types, or type functions). It's in draft at the moment, and 
we'd really appreciate feedback that would help us improve it.

Here it is: http://haskell.org/haskellwiki/Simonpj/Talk:FunWithTypeFuns

Thank you!

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


[Haskell-cafe] haskellnet

2009-05-14 Thread Robert Wills
Hello,

Yesterday I found myself wanting to clear out a spam-ridden pop
account without downloading all the messages. Rather than just using
Python's poplib, I thought I might look for a haskell solution and
came across Haskellnet:
http://darcs.haskell.org/SoC/haskellnet/

I ended up spending much of the afternoon getting it to compile and
much of last night trying to get the pop library to actually work (the
'strip' method produced exceptions).  It was a good learning
experience (this was helpful:
http://donsbot.wordpress.com/2007/11/14/no-more-exceptions-debugging-haskell-code-with-ghci/).

I'm writing here because I'm wondering whether it would be worthwhile
putting it up on hackage? From searching this list, there seem to have
been a few times when people have stumbled across it but got
frustrated when it didn't compile.  If so, what's the protocol? Is the
original author, Jun Mukai, still around?

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


Re: [Haskell-cafe] Structural sharing in haskell data structures?

2009-05-14 Thread Jan-Willem Maessen


On May 13, 2009, at 6:58 PM, wren ng thornton wrote:


Jan-Willem Maessen wrote:

I wanted to clear up one misconception here...
wren ng thornton wrote:
 In heavily GCed languages like Haskell allocation and collection  
is  cheap, so we don't mind too much; but in Java and the like,  
both  allocation and collection are expensive so the idea of cheap  
throwaway  objects is foreign.

Not true!


I was speaking of Java, not Clojure. I believe the costs in Java are  
well documented, though I don't know enough about the JVM to know  
where the blame belongs. (All I know of Clojure is that it's a Lisp- 
like on the JVM :)


I think you're missing the point here: the code I refer to below *is  
in Java* and is running on a standard JVM; the costs you refer to  
simply don't exist!  As Vladimir Ivanov points out, and as Rich Hickey  
is happy to observe in his talks on Clojure, the JVM handles  
allocation-intensive garbage-intensive programs very well.


If you look at the internals of Clojure, you'll discover they're  
using trees with *very* wide fanout (eg fanout-64 leaf trees for  
lists).  Why?  Because it's so cheap to allocate and GC these  
structures!  By using shallow-but-wide trees we reduce the cost of  
indexing and accessing list elements.  I suspect you'd still be  
hard-pressed to support this kind of allocation behavior in any of  
the present Haskell implementations, and Haskell implementations of  
the same kinds of structures have limited fanout to 2-4 elements or  
so.


I was under the impression that the reason datastructures in Haskell  
tend to be limited to 4-fanout had more to do with the cleanliness  
of the implementations--- pattern matching on 64-wide cells is quite  
ugly, as is dealing with the proliferation of corner cases for  
complex structures like finger trees, patricia trees, etc. The use  
of view patterns could clean this up significantly. On the other  
hand, we do have things like lazy ByteStrings and UVector which do  
have wide fanouts.


Hmm, I think neither of the data structures you name actually support  
both O(lg n) indexing and O(lg n) cons or append.  That said, your  
point is well taken, so let's instead state it as a challenge:


Can you, oh Haskellers, implement a fast, wide-fanout (say = 8) tree- 
based sequence implementation in Haskell, which supports at-least-log- 
time indexing and at-least-log-time cons with a large base for the  
logarithm?  Can you do it without turning off array bounds checking  
(either by using unsafe operations or low-level peeking and poking)  
and without using an algebraic data type with O(f) constructors for  
fanout of f?  You can turn off bounds checks if your program encodes  
static guarantees that indices cannot be out of bounds (there are a  
couple of libraries to do this).


The spirit here is Work in Haskell with safe operations and no FFI  
except through safe libraries, but otherwise use any extensions you  
like.


I actually think this *is* doable, but it touches a few areas where  
Haskell doesn't presently do well (the bounds checking in particular  
is a challenge).  I threw in the bounds checking when I realized that  
in fact the equivalent Java code is always bounds checked, and these  
bounds checks are then optimized away where possible.  Actually, I'd  
*love* to see an *in*efficient solution to eliminating as many bounds  
checks as possible!


-Jan




--
Live well,
~wren
___
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] haskellnet

2009-05-14 Thread Neil Mitchell
Hi

Email the original author, if you can. Ideally work with them to
upload a working version to hackage. If they're not interested
hopefully they'll make you the new maintainer. If you can't contact
them, just upload a new version anyway - as long as it's done for the
benefit of the community and not with malicious intent, everyone is
happy.

And please do make sure you upload something working, I imagine this
will be very useful to lots of people!

Thanks for your efforts

Neil

On Thu, May 14, 2009 at 12:51 PM, Robert Wills wrwi...@gmail.com wrote:
 Hello,

 Yesterday I found myself wanting to clear out a spam-ridden pop
 account without downloading all the messages. Rather than just using
 Python's poplib, I thought I might look for a haskell solution and
 came across Haskellnet:
 http://darcs.haskell.org/SoC/haskellnet/

 I ended up spending much of the afternoon getting it to compile and
 much of last night trying to get the pop library to actually work (the
 'strip' method produced exceptions).  It was a good learning
 experience (this was helpful:
 http://donsbot.wordpress.com/2007/11/14/no-more-exceptions-debugging-haskell-code-with-ghci/).

 I'm writing here because I'm wondering whether it would be worthwhile
 putting it up on hackage? From searching this list, there seem to have
 been a few times when people have stumbled across it but got
 frustrated when it didn't compile.  If so, what's the protocol? Is the
 original author, Jun Mukai, still around?

 Thanks,
 Rob
 ___
 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] Structural sharing in haskell data structures?

2009-05-14 Thread Duncan Coutts
On Thu, 2009-05-14 at 09:03 -0400, Jan-Willem Maessen wrote:

 Hmm, I think neither of the data structures you name actually support  
 both O(lg n) indexing and O(lg n) cons or append.  That said, your  
 point is well taken, so let's instead state it as a challenge:
 
 Can you, oh Haskellers, implement a fast, wide-fanout (say = 8) tree- 
 based sequence implementation in Haskell, which supports at-least-log- 
 time indexing and at-least-log-time cons with a large base for the  
 logarithm?  Can you do it without turning off array bounds checking  
 (either by using unsafe operations or low-level peeking and poking)  
 and without using an algebraic data type with O(f) constructors for  
 fanout of f?  You can turn off bounds checks if your program encodes  
 static guarantees that indices cannot be out of bounds (there are a  
 couple of libraries to do this).

Can we motivate the restriction of not using multiple constructors? If
we're only talking about a fanout of 8 then it doesn't look like a
problem. It sounds like you're really asking for an array but without
wanting to say so explicitly. Perhaps you should ask for a variable
fanout or a fanout of something bigger like 32 (and presumably these
requirements could be justified too?).

Duncan

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


Re: [Haskell-cafe] Structural sharing in haskell data structures?

2009-05-14 Thread Jan-Willem Maessen


On May 14, 2009, at 10:17 AM, Duncan Coutts wrote:


On Thu, 2009-05-14 at 09:03 -0400, Jan-Willem Maessen wrote:


Hmm, I think neither of the data structures you name actually support
both O(lg n) indexing and O(lg n) cons or append.  That said, your
point is well taken, so let's instead state it as a challenge:

Can you, oh Haskellers, implement a fast, wide-fanout (say = 8)  
tree-
based sequence implementation in Haskell, which supports at-least- 
log-

time indexing and at-least-log-time cons with a large base for the
logarithm?  Can you do it without turning off array bounds checking
(either by using unsafe operations or low-level peeking and poking)
and without using an algebraic data type with O(f) constructors for
fanout of f?  You can turn off bounds checks if your program encodes
static guarantees that indices cannot be out of bounds (there are a
couple of libraries to do this).


Can we motivate the restriction of not using multiple constructors? If
we're only talking about a fanout of 8 then it doesn't look like a
problem.


I actually expect this will cause some fairly nasty code bloat, but  
I'm happy to be proven wrong. :-)



It sounds like you're really asking for an array but without
wanting to say so explicitly. Perhaps you should ask for a variable
fanout or a fanout of something bigger like 32 (and presumably these
requirements could be justified too?).


Wide fanout seems fair.

-Jan




Duncan



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


[Haskell-cafe] PhD position in Nottingham

2009-05-14 Thread vxc

PhD position in Type Theory at Nottingham
-

A new PhD position is available in the Functional Programming Laboratory at 
the University of Nottingham. The topic of research for the project is 
Programming and Reasoning with Infinite Structures: it consists in the 
theoretical study and development of software tools for coinductive types 
and structured corecursion.


The candidate must be a UK resident with an excellent degree in Computer 
Science or Mathematics at MSc (preferred) or BSc level (first class or 
equivalent). The applicant should have a good background in mathematical 
logic, theoretical computer science or functional programming. (S)he should 
be interested doing research in type theory, constructive mathematics, 
category theory and foundations of formal reasoning.


We offer: PhD place with living expenses (standard UK level) for 3 years. 
The grants also provide laptops and travel expenses for conference and 
workshop visits. Nottingham University provides a vibrant research 
environment in the Functional Programming Laboratory.


Deadline for applications: 20 June 2009.
Send a cover letter and your CV to Venanzio Capretta (v...@cs.nott.ac.uk).
Please contact me for any additional information that you need.


This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.

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


RE: [Haskell-cafe] Performance Problem with Typeable

2009-05-14 Thread Simon Peyton-Jones
Interesting.  Would anyone care to make a Trac ticket for this (with perf bug 
as  the ticket kind), and (if at all possible) do some investigation to see 
what is going on?

Many thanks

Simon

| -Original Message-
| From: haskell-cafe-boun...@haskell.org 
[mailto:haskell-cafe-boun...@haskell.org] On
| Behalf Of Michael D. Adams
| Sent: 13 May 2009 22:57
| To: Haskell Cafe
| Subject: [Haskell-cafe] Performance Problem with Typeable
|
| I'm not sure where this should be reported, but I think I've found a
| significant asymptotic performance problem with Data.Typeable.  In the
| attached code, sum2 runs much slower than either sum1 or sum3.  It
| should be linear but it seems to slow down quadratically (i.e.
| doubling len quadruples the time for sum2).  Here is an example run:
|
| $ ghc --make -O3 CastSpeed.hs
| $ ./CastSpeed 2
| gsum1
| Result: 20001
| Time(sec): 7.999e-3
| Result: 20001
| Time(sec): 0.0
| Result: 20001
| Time(sec): 1.0e-3
|
| gsum2
| Result: 20001
| Time(sec): 1.483774
| Result: 20001
| Time(sec): 1.46
| Result: 20001
| Time(sec): 1.523768
|
| gsum3
| Result: 20001
| Time(sec): 5.999e-3
| Result: 20001
| Time(sec): 0.0
| Result: 20001
| Time(sec): 0.0
|
| The only difference between sum1 and sum2 is that sum2 wraps a
| singleton list around each element (i.e. the cast is to [Int] instead
| of Int).  The only difference between sum2 and sum3 is that sum3 uses
| an unchecked cast (unsafeCoerce) instead of a checked cast.  This
| problem seems to crop up only for those types which are made up of a
| type constructor applied to an argument (e.g. [] applied to Int).
|
| Because of sum3 runs fast, I suspect that something is going wrong
| with the typeOf call in a checked cast, and because sum1 runs fast I
| suspect that what is going wrong is the call to appKey that is called
| from mkAppTy that is called from typeOfDefault that is called from the
| Typeable instance for [Int] (i.e. instance (Typeable1 s, Typeable a)
| = Typeable (s a)).  This is a bit of speculation and I don't have
| hard evidence for that being the source of the problems, but tests
| that I have run (not listed here) are strongly suggestive of appKey
| being the culprit.
|
| Michael D. Adams
| mdmko...@gmail.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


RE: [Haskell-cafe] Developing 3 dimensional interactive environments/functional objects

2009-05-14 Thread paulfrancis
 Thanks guys, I appreciate the feedback. I'll update the mailing list with progress in my endeavors in the best way. With best wishes,  Paul    Original Message  Subject: Re: [Haskell-cafe] Developing 3 dimensional interactive  environments/functional objects From: Peter Verswyvelen bugf...@gmail.com Date: Tue, May 12, 2009 3:24 pm To: Don Stewart d...@galois.com Cc: paulfran...@friendbliss.com, haskell-cafe@haskell.org  You might want to contact the author of RogueStar GLhttp://roguestar.downstairspeople.org/ On Tue, May 12, 2009 at 5:21 PM, Don Stewart d...@galois.com wrote: paulfrancis:   Does any programmer on this mailing list have experience with developing 3  dimensional interactive environments/functional objects within them, au Second  Life? Is Haskell useful for such an endeavor?  Mm..   Anygmahttp://www.anygma.com/JobOfferA.html   gamr7http://www.gamr7.com/  Both use Haskell to some extent. ___ 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] Structural sharing in haskell data structures?

2009-05-14 Thread Jan-Willem Maessen


On May 14, 2009, at 11:01 AM, Dan Doel wrote:


On Thursday 14 May 2009 9:03:30 am Jan-Willem Maessen wrote:

Hmm, I think neither of the data structures you name actually support
both O(lg n) indexing and O(lg n) cons or append.  That said, your
point is well taken, so let's instead state it as a challenge:


Data.Sequence has O(log n) index, concatenation, update, take, drop  
and
splitAt, and O(1) cons, snoc, and viewing at both ends, according to  
the

documentation.


Yes.  But large sequences end up being quite deep.  Can a wide-fanout  
version be made that is actually faster?  Note that the effective  
fanout of Hinze's finger trees is approximately e; consider effective  
fanouts of e^2 to e^4 (which may require substantially higher maximum  
fanout).


-Jan


-- Dan


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


Re: [Haskell-cafe] Structural sharing in haskell data structures?

2009-05-14 Thread Dan Doel
On Thursday 14 May 2009 9:03:30 am Jan-Willem Maessen wrote:
 Hmm, I think neither of the data structures you name actually support
 both O(lg n) indexing and O(lg n) cons or append.  That said, your
 point is well taken, so let's instead state it as a challenge:

Data.Sequence has O(log n) index, concatenation, update, take, drop and 
splitAt, and O(1) cons, snoc, and viewing at both ends, according to the 
documentation.

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


[Haskell-cafe] hsffig and duplicate typedef declarations

2009-05-14 Thread Dimitry Golubovsky
Dean,

I am not sure how HSFFIG would deal with duplicate typedefs (I'm
afraid you get error from gcc when processing hsc2hs output).

In case you haven't seen this, I put a repo for HSFFIG here recently:

http://code.haskell.org/hsffig/

Before running cabal install run make at the toplevel of the repo first.

I have fixed some glitches recently, and adjusted both hsffig and
ffipkg to work with contemporary GHC and Cabal (at least 1.6.0.x).

I'd be glad to get any feedback on HSFFIG. E-mail me to golubovsky at
gmail dot com.

Thanks.

-- 
Dimitry Golubovsky

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


Re: [Haskell-cafe] Building 'text-icu-0.1' on Windows

2009-05-14 Thread Bryan O'Sullivan
On Wed, May 13, 2009 at 4:46 PM, Alexander Dunlap 
alexander.dun...@gmail.com wrote:


 This isn't really helpful, but I received similar errors when trying
 to build icu-text on Windows


If one of you has the time to dig into this and send a patch that corrects
the problem, I'd welcome the help. As I'm sure you can tell, I developed
text-icu on Unix, and I don't have regular enough Windows access to make
debugging this a quick and easy matter.

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


Re: [Haskell-cafe] Structural sharing in haskell data structures?

2009-05-14 Thread Don Stewart
jmaessen:

 On May 14, 2009, at 11:01 AM, Dan Doel wrote:

 On Thursday 14 May 2009 9:03:30 am Jan-Willem Maessen wrote:
 Hmm, I think neither of the data structures you name actually support
 both O(lg n) indexing and O(lg n) cons or append.  That said, your
 point is well taken, so let's instead state it as a challenge:

 Data.Sequence has O(log n) index, concatenation, update, take, drop  
 and
 splitAt, and O(1) cons, snoc, and viewing at both ends, according to  
 the
 documentation.

 Yes.  But large sequences end up being quite deep.  Can a wide-fanout  
 version be made that is actually faster?  Note that the effective fanout 
 of Hinze's finger trees is approximately e; consider effective fanouts of 
 e^2 to e^4 (which may require substantially higher maximum fanout).

Ah, so I see what Jan's asking for (I think).

During the hackathon a number of us were experimenting with
associated types to flatten groups of nodes in Data.Map (by unpacking
them into the constructor). We were playing with fan out of up to 16
(while preserving pattern matching that makes it look like the original
constructors).

Good speedups followed, thanks to the improved data density.

Here's a video (first part is about visualizing heap structures):

http://vimeo.com/4258084

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


Re: [Haskell-cafe] Building 'text-icu-0.1' on Windows

2009-05-14 Thread Bryan O'Sullivan
On Thu, May 14, 2009 at 10:18 AM, Bryan O'Sullivan b...@serpentine.comwrote:


 If one of you has the time to dig into this and send a patch that corrects
 the problem, I'd welcome the help. As I'm sure you can tell, I developed
 text-icu on Unix, and I don't have regular enough Windows access to make
 debugging this a quick and easy matter.

 By the way, if you run into problems building or using text or text-icu,
please file a ticket here: http://trac.haskell.org/text/newticket
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Pretty printing a tree

2009-05-14 Thread José Romildo Malaquias
Hello.

I would like to pretty print a tree in a way that its structure is
easily perceived.

For instance, consider the declarations:

   data Node a = Node a [Node a]

   type Tree a = [ Node a ]

   t = [ Node a [ Node b []
  , Node c [ Node c1 []
 , Node c2 [] ]
  , Node d [ Node d1 [ Node d1a [] ]
 , Node d2 [] ] ] ]

Then the resulting of pretty printing the given tree would be something
like the following:

   a
   |
+-+
|||
bcd
 ||
   +---++---+
   |   ||   |
   c1  c2   d1  d2
|
   d1a

There is the module Text.PrettyPrint.HughesPJ, but it lacks examples on
how to use the pretty print combinators, and it is not well docomented.

I would like to see solutions for this problem, or clues on how to solve
it.

Regards,

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


Re: [Haskell-cafe] Pretty printing a tree

2009-05-14 Thread Andrew Wagner
Perhaps drawTree on
http://www.haskell.org/ghc/docs/latest/html/libraries/containers/Data-Tree.html
2009/5/14 José Romildo Malaquias j.romi...@gmail.com

 Hello.

 I would like to pretty print a tree in a way that its structure is
 easily perceived.

 For instance, consider the declarations:

   data Node a = Node a [Node a]

   type Tree a = [ Node a ]

   t = [ Node a [ Node b []
  , Node c [ Node c1 []
 , Node c2 [] ]
  , Node d [ Node d1 [ Node d1a [] ]
 , Node d2 [] ] ] ]

 Then the resulting of pretty printing the given tree would be something
 like the following:

   a
   |
 +-+
 |||
 bcd
 ||
   +---++---+
   |   ||   |
   c1  c2   d1  d2
|
   d1a

 There is the module Text.PrettyPrint.HughesPJ, but it lacks examples on
 how to use the pretty print combinators, and it is not well docomented.

 I would like to see solutions for this problem, or clues on how to solve
 it.

 Regards,

 José Romildo
 ___
 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] commending Design concepts in programming languages

2009-05-14 Thread Gregg Reynolds
On Tue, May 12, 2009 at 1:04 PM, Max Rabkin max.rab...@gmail.com wrote:
 On Tue, May 12, 2009 at 1:41 PM, Wolfgang Jeltsch
 g9ks1...@acme.softbase.org wrote:
 At least, I cannot
 remember seeing the other notation (first morphism on the left) in
category
 theory literature so far. It’s just that my above-mentioned professor
told me
 that category theorists would use the first-morphism-on-the-left
notation.

 I've seen the notation f;g for g.f somewhere (and Wikipedia mentions
 it). I think it's less ambiguous than just fg (which I've seen for f.g
 too), but in Haskell we have the option of . A flipped application
 might be nice to go with it. How about $ ?

FYI:

Unicode U+2A3E  Zed notation relational composition (small circle over a 9)

Examples at http://staff.washington.edu/jon/z/toolkit.html#pair3
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] looking for suggestion on pattern matching problem

2009-05-14 Thread Daryoush Mehrtash
I am trying to analyze a list of items (say integers) for longest matches on
patterns and their location on the list.  One catch is that pattern may be
defined in terms of other patterns. Example of patterns would be the any
sequence of increasing numbers, or sequence of increasing numbers followed
by upto 5 zeros then followed by any odd digits.

I don't know much about the actual patterns, but would like to be able to
define EDSL for composing the patterns and an execution environment to
actually find the patterns.

I like to find out various ways I can structure the problem and its trade
offs.  I appreciate any  books, articles, suggestions, papers, etc on this
type of problems.

Thanks,

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


[Haskell-cafe] hiddenness

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

 When I am compiling a module, I get Could not find module
'Control.Module.State':
  it is a
member of package mtl-1.1.0.2, which is hidden

 1) What is the efficacy of hiddenness?

 2) I have forgotten what tool I run to expose a package. ??

 3) In another vein, the code is using Data.Finitemap ... so I guess I
must darcs install this?

Regards,

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


Re: [Haskell-cafe] hiddenness

2009-05-14 Thread Max Rabkin
On Thu, May 14, 2009 at 10:51 PM, Vasili I. Galchin vigalc...@gmail.com wrote:
 Hello,

  When I am compiling a module, I get Could not find module
 'Control.Module.State':
   it is a
 member of package mtl-1.1.0.2, which is hidden

  1) What is the efficacy of hiddenness?

As I understand it, the purpose is two-fold. Firstly, if you have
multiple versions a package (or multiple packages containing the same
module), you can hide the ones not in use. Second, it ensures you have
declared all dependencies.

  2) I have forgotten what tool I run to expose a package. ??

I've only ever had this when working with Cabal, where I have missed a
dependency. In this case, it looks like you have an undeclared
dependency on mtl. I'm not sure whether this arises in the non-Cabal
case.

  3) In another vein, the code is using Data.Finitemap ... so I guess I
 must darcs install this?

I believe it was just uploaded to Hackage (it's obsolete, but useful
for getting old code to run).

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


Re: [Haskell-cafe] hiddenness

2009-05-14 Thread Vasili I. Galchin
oh ... yes .. my .cabal file is incomplete! Thanks, Max.

Vasili

On Thu, May 14, 2009 at 3:56 PM, Max Rabkin max.rab...@gmail.com wrote:

 On Thu, May 14, 2009 at 10:51 PM, Vasili I. Galchin vigalc...@gmail.com
 wrote:
  Hello,
 
   When I am compiling a module, I get Could not find module
  'Control.Module.State':
it is a
  member of package mtl-1.1.0.2, which is hidden
 
   1) What is the efficacy of hiddenness?

 As I understand it, the purpose is two-fold. Firstly, if you have
 multiple versions a package (or multiple packages containing the same
 module), you can hide the ones not in use. Second, it ensures you have
 declared all dependencies.

   2) I have forgotten what tool I run to expose a package. ??

 I've only ever had this when working with Cabal, where I have missed a
 dependency. In this case, it looks like you have an undeclared
 dependency on mtl. I'm not sure whether this arises in the non-Cabal
 case.

   3) In another vein, the code is using Data.Finitemap ... so I guess
 I
  must darcs install this?

 I believe it was just uploaded to Hackage (it's obsolete, but useful
 for getting old code to run).

 HTH,
 Max

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


Re: [Haskell-cafe] looking for suggestion on pattern matching problem

2009-05-14 Thread Paul Johnson
Sounds like you need regular expressions applied to the string 
representation, although the sequence of increasing numbers is not 
something any of the standard regexp packages do.  So you will have to 
roll your own.


Alternatively you could use one of the parsing libraries to parse the 
string and define sequence of increasing numbers using a stateful parser.


Paul.

Daryoush Mehrtash wrote:
I am trying to analyze a list of items (say integers) for longest 
matches on patterns and their location on the list.  One catch is that 
pattern may be defined in terms of other patterns. Example of 
patterns would be the any sequence of increasing numbers, or sequence 
of increasing numbers followed by upto 5 zeros then followed by any 
odd digits.  

I don't know much about the actual patterns, but would like to be able 
to define EDSL for composing the patterns and an execution environment 
to actually find the patterns.


I like to find out various ways I can structure the problem and its 
trade offs.  I appreciate any  books, articles, suggestions, papers, 
etc on this type of problems.


Thanks,

Daryoush


___
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] Pretty printing a tree

2009-05-14 Thread Brent Yorgey
On Thu, May 14, 2009 at 03:58:18PM -0300, José Romildo Malaquias wrote:
 
 Then the resulting of pretty printing the given tree would be something
 like the following:
 
a
|
 +-+
 |||
 bcd
  ||
+---++---+
|   ||   |
c1  c2   d1  d2
 |
d1a
 
 There is the module Text.PrettyPrint.HughesPJ, but it lacks examples on
 how to use the pretty print combinators, and it is not well docomented.

Text.PrettyPrint.HughesPJ is actually not a good tool for this, since
it is for pretty-printing line-oriented material (i.e. source code).
I actually have a library I was developing a while ago to do the sort
of pretty-printing/layout of text that you're looking for, using a box
model similar to that of TeX, but I never released it.  Hopefully I'll
get around to polishing and releasing it this summer.

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


Re: [Haskell-cafe] looking for suggestion on pattern matching problem

2009-05-14 Thread Christopher Lane Hinson


Parsec 3 should be able to handle this pretty easily.  It can parse any 
data structure that implements it's Stream class.


Friendly,
--Lane

On Thu, 14 May 2009, Daryoush Mehrtash wrote:


I am trying to analyze a list of items (say integers) for longest matches on 
patterns and their location on the list.  One catch is that pattern may be 
defined in terms of other
patterns.     Example of patterns would be the any sequence of increasing 
numbers, or sequence of increasing numbers followed by upto 5 zeros then 
followed by any odd digits.  

I don't know much about the actual patterns, but would like to be able to 
define EDSL for composing the patterns and an execution environment to actually 
find the patterns.

I like to find out various ways I can structure the problem and its trade 
offs.  I appreciate any  books, articles, suggestions, papers, etc on this type 
of problems.

Thanks,

Daryoush

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


[Haskell-cafe] Data.Binary and little endian encoding

2009-05-14 Thread David Leimbach
I actually need little endian encoding... wondering if anyone else hit this
with Data.Binary. (because I'm working with Bell Lab's 9P protocol which
does encode things on the network in little-endian order).
Anyone got some tricks for this?

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


Re: [Haskell-cafe] Data.Binary and little endian encoding

2009-05-14 Thread Don Stewart
leimy2k:
 I actually need little endian encoding... wondering if anyone else hit this
 with Data.Binary. (because I'm working with Bell Lab's 9P protocol which does
 encode things on the network in little-endian order).
 
 Anyone got some tricks for this?

Yes!
There are big, little and host-endian primitives in the Get/Put monads.


http://hackage.haskell.org/packages/archive/binary/0.5.0.1/doc/html/Data-Binary-Put.html#v%3AputWord16le

You can use these to build encoders directly.

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


Re: [Haskell-cafe] Data.Binary and little endian encoding

2009-05-14 Thread David Leimbach
On Thu, May 14, 2009 at 8:40 PM, Don Stewart d...@galois.com wrote:

 leimy2k:
  I actually need little endian encoding... wondering if anyone else hit
 this
  with Data.Binary. (because I'm working with Bell Lab's 9P protocol which
 does
  encode things on the network in little-endian order).
 
  Anyone got some tricks for this?

 Yes!
 There are big, little and host-endian primitives in the Get/Put monads.


 http://hackage.haskell.org/packages/archive/binary/0.5.0.1/doc/html/Data-Binary-Put.html#v%3AputWord16le

 You can use these to build encoders directly.


Cool... I just have to write my own encoder and decoder now.

As a request could we get encodeLe decodeLe for a later version of this
library?  :-)  That'd be totally awesome.




 Cheers,
   Don

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


Re: [Haskell-cafe] Data.Binary and little endian encoding

2009-05-14 Thread Don Stewart
leimy2k:
 
 
 On Thu, May 14, 2009 at 8:40 PM, Don Stewart d...@galois.com wrote:
 
 leimy2k:
  I actually need little endian encoding... wondering if anyone else hit
 this
  with Data.Binary. (because I'm working with Bell Lab's 9P protocol which
 does
  encode things on the network in little-endian order).
 
  Anyone got some tricks for this?
 
 Yes!
 There are big, little and host-endian primitives in the Get/Put monads.
 
http://hackage.haskell.org/packages/archive/binary/0.5.0.1/doc/html/
 Data-Binary-Put.html#v%3AputWord16le
 
 You can use these to build encoders directly.
 
 
 Cool... I just have to write my own encoder and decoder now.
 
 As a request could we get encodeLe decodeLe for a later version of this
 library?  :-)  That'd be totally awesome.

Oh, you mean entirely different instances for all the current ones, that
use LE encodings? 

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


Re: [Haskell-cafe] Data.Binary and little endian encoding

2009-05-14 Thread David Leimbach
On Thu, May 14, 2009 at 8:46 PM, Don Stewart d...@galois.com wrote:

 leimy2k:
 
 
  On Thu, May 14, 2009 at 8:40 PM, Don Stewart d...@galois.com wrote:
 
  leimy2k:
   I actually need little endian encoding... wondering if anyone else
 hit
  this
   with Data.Binary. (because I'm working with Bell Lab's 9P protocol
 which
  does
   encode things on the network in little-endian order).
  
   Anyone got some tricks for this?
 
  Yes!
  There are big, little and host-endian primitives in the Get/Put
 monads.
 
 
 http://hackage.haskell.org/packages/archive/binary/0.5.0.1/doc/html/
  Data-Binary-Put.html#v%3AputWord16le
 
  You can use these to build encoders directly.
 
 
  Cool... I just have to write my own encoder and decoder now.
 
  As a request could we get encodeLe decodeLe for a later version of this
  library?  :-)  That'd be totally awesome.

 Oh, you mean entirely different instances for all the current ones, that
 use LE encodings?


Well the library is leaning towards Network Byte Order in that it has
encode/decode that only encode/decode for Big Endian.

Us folks who have to do little endian all now have to write our own
encoding/decoding :-)

I'm speaking specifically of the encode/decode functions.  I have no idea
how they're implemented.

Are you saying that encode is doing something really simple and the default
encodings for things just happen to be big endian?  If so, then I understand
the pain but it still means I have to roll my own :-)  I guess if one
must choose, big endian kind of makes sense, except that the whole world is
little endian now, except for networks :-)  (No one *really* cares about
anything but x86 anyway these days right?)

I'm only half-kidding.



 -- Don

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


Re: [Haskell-cafe] Data.Binary and little endian encoding

2009-05-14 Thread Don Stewart
 I'm speaking specifically of the encode/decode functions.  I have no idea how
 they're implemented.
 
 Are you saying that encode is doing something really simple and the default
 encodings for things just happen to be big endian?  If so, then I understand
 the pain but it still means I have to roll my own :-)  I guess if one must
 choose, big endian kind of makes sense, except that the whole world is little
 endian now, except for networks :-)  (No one *really* cares about anything but
 x86 anyway these days right?)

Oh, 'encode' has type:

encode :: Binary a = a - ByteString

it just encodes with the default instances, which are all network order:

http://en.wikipedia.org/wiki/Endianness#Endianness_in_networking

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


Re: [Haskell-cafe] Data.Binary and little endian encoding

2009-05-14 Thread David Leimbach
On Thu, May 14, 2009 at 8:54 PM, Don Stewart d...@galois.com wrote:

  I'm speaking specifically of the encode/decode functions.  I have no idea
 how
  they're implemented.
 
  Are you saying that encode is doing something really simple and the
 default
  encodings for things just happen to be big endian?  If so, then I
 understand
  the pain but it still means I have to roll my own :-)  I guess if one
 must
  choose, big endian kind of makes sense, except that the whole world is
 little
  endian now, except for networks :-)  (No one *really* cares about
 anything but
  x86 anyway these days right?)

 Oh, 'encode' has type:

encode :: Binary a = a - ByteString

 it just encodes with the default instances, which are all network order:

http://en.wikipedia.org/wiki/Endianness#Endianness_in_networking


Yeah I understand that Big Endian == Network Byte Order... which would be
true, if I wasn't talking about Plan 9's 9P protocol which specifies little
endian bytes on the wire (as far as I can tell anyway from the man page).

Dave



 -- Don

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


Re: [Haskell-cafe] Data.Binary and little endian encoding

2009-05-14 Thread David Leimbach
On Thu, May 14, 2009 at 8:57 PM, David Leimbach leim...@gmail.com wrote:



 On Thu, May 14, 2009 at 8:54 PM, Don Stewart d...@galois.com wrote:

  I'm speaking specifically of the encode/decode functions.  I have no
 idea how
  they're implemented.
 
  Are you saying that encode is doing something really simple and the
 default
  encodings for things just happen to be big endian?  If so, then I
 understand
  the pain but it still means I have to roll my own :-)  I guess if
 one must
  choose, big endian kind of makes sense, except that the whole world is
 little
  endian now, except for networks :-)  (No one *really* cares about
 anything but
  x86 anyway these days right?)

 Oh, 'encode' has type:

encode :: Binary a = a - ByteString

 it just encodes with the default instances, which are all network order:

http://en.wikipedia.org/wiki/Endianness#Endianness_in_networking


 Yeah I understand that Big Endian == Network Byte Order... which would be
 true, if I wasn't talking about Plan 9's 9P protocol which specifies little
 endian bytes on the wire (as far as I can tell anyway from the man page).

 Dave


FYI here's what I've ended up trying to write to negotiate the version of
a 9p server:

main = withSocketsDo $
   do
  ainfo - getAddrInfo Nothing (Just 127.0.0.1) (Just 6872)  --
hardcoded for now, it's an IRC filesystem server
  let a = head ainfo
  sock - socket AF_INET Stream defaultProtocol
  connect sock (addrAddress a)
  sendAll sock $ (toLazyByteString (putWord32le (fromIntegral (16
::Int32
  sendAll sock $ (encode (100 ::Int8))
  sendAll sock $ (toLazyByteString (putWord32le (fromIntegral (1024
::Int32
  sendAll sock $ (encode (C.pack 9P2000))


I feel like I should use wireshark or something to watch the bytes :-)  I'm
not feeling very sure about this.




 -- Don



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


Re: [Haskell-cafe] Data.Binary and little endian encoding

2009-05-14 Thread David Leimbach
On Thu, May 14, 2009 at 9:10 PM, David Leimbach leim...@gmail.com wrote:



 On Thu, May 14, 2009 at 8:57 PM, David Leimbach leim...@gmail.com wrote:



 On Thu, May 14, 2009 at 8:54 PM, Don Stewart d...@galois.com wrote:

  I'm speaking specifically of the encode/decode functions.  I have no
 idea how
  they're implemented.
 
  Are you saying that encode is doing something really simple and the
 default
  encodings for things just happen to be big endian?  If so, then I
 understand
  the pain but it still means I have to roll my own :-)  I guess if
 one must
  choose, big endian kind of makes sense, except that the whole world is
 little
  endian now, except for networks :-)  (No one *really* cares about
 anything but
  x86 anyway these days right?)

 Oh, 'encode' has type:

encode :: Binary a = a - ByteString

 it just encodes with the default instances, which are all network order:

http://en.wikipedia.org/wiki/Endianness#Endianness_in_networking


 Yeah I understand that Big Endian == Network Byte Order... which would be
 true, if I wasn't talking about Plan 9's 9P protocol which specifies little
 endian bytes on the wire (as far as I can tell anyway from the man page).

 Dave


 FYI here's what I've ended up trying to write to negotiate the version of
 a 9p server:

 main = withSocketsDo $
do
   ainfo - getAddrInfo Nothing (Just 127.0.0.1) (Just 6872)  --
 hardcoded for now, it's an IRC filesystem server
   let a = head ainfo
   sock - socket AF_INET Stream defaultProtocol
   connect sock (addrAddress a)
   sendAll sock $ (toLazyByteString (putWord32le (fromIntegral (16
 ::Int32
   sendAll sock $ (encode (100 ::Int8))
   sendAll sock $ (toLazyByteString (putWord32le (fromIntegral (1024
 ::Int32
   sendAll sock $ (encode (C.pack 9P2000))



I totally forgot the tag part of 9p ugh.  I think I should probably just
go to bed now.



 I feel like I should use wireshark or something to watch the bytes :-)  I'm
 not feeling very sure about this.




 -- Don




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


RE: [Haskell-cafe] Data.Binary and little endian encoding

2009-05-14 Thread Tim Docker
On a related matter, I am using Data.Binary to serialise data from
haskell
for use from other languages. The Data.Binary encoding of a Double is a
long
integer for the mantissa, and an int for the exponent.  This doesn't
work too well for interacting with other languages as I'd need to have
an arbitrary precision int type there to decode/encode. The CORBA CDR
standard encodes doubles in a big ended fashion like this (excuse my
possibly incorrect ascii art):


| byte | msb   lsb |
|--+---|
|0 | S   E6 E0 |
|1 | E10 E9 E8 E7 F3 F2 F1  F0 |
|2 | F11F4 |
|3 | F19   F12 |
|4 | F27   F20 |
|5 | F35   F28 |
|6 | F43   F36 |
|7 | F51   F44 |

Up until now, my code is pure haskell.  Is it possible to get at the
internal bits of a Double/CDouble in ghc? Or Should I use the FFI and
write C to encode something like the above?

Tim



From: haskell-cafe-boun...@haskell.org
[mailto:haskell-cafe-boun...@haskell.org] On Behalf Of David Leimbach
Sent: Friday, 15 May 2009 1:58 PM
To: Don Stewart
Cc: Haskell Cafe
Subject: Re: [Haskell-cafe] Data.Binary and little endian encoding




On Thu, May 14, 2009 at 8:54 PM, Don Stewart d...@galois.com wrote:


 I'm speaking specifically of the encode/decode functions.  I
have no idea how
 they're implemented.

 Are you saying that encode is doing something really simple
and the default
 encodings for things just happen to be big endian?  If so,
then I understand
 the pain but it still means I have to roll my own :-)  I
guess if one must
 choose, big endian kind of makes sense, except that the whole
world is little
 endian now, except for networks :-)  (No one *really* cares
about anything but
 x86 anyway these days right?)


Oh, 'encode' has type:

   encode :: Binary a = a - ByteString

it just encodes with the default instances, which are all
network order:


http://en.wikipedia.org/wiki/Endianness#Endianness_in_networking



Yeah I understand that Big Endian == Network Byte Order... which would
be true, if I wasn't talking about Plan 9's 9P protocol which specifies
little endian bytes on the wire (as far as I can tell anyway from the
man page).

Dave
 


-- Don



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


[Haskell-cafe] I have forgotten .. my bad

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

   darcs get --init ?? I want to pull down Data.FiniteMap. I
have forgotten the path to Hackage .. I tried 

 sudo darcs get http://hackage.haskell.org/ Data.FiniteMap
[sudo] password for vigalchin:
Invalid repository:  http://hackage.haskell.org

darcs failed:  Failed to download URL
http://hackage.haskell.org/_darcs/inventory : HTTP error (404?)

??

Obviously the code I am cabalizing needs to be upgraded(i.e. not using
deprecated packages) but first I want it to build!


Thanks,

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


Re: [Haskell-cafe] Data.Binary and little endian encoding

2009-05-14 Thread Don Stewart
timd:
 On a related matter, I am using Data.Binary to serialise data from
 haskell
 for use from other languages. The Data.Binary encoding of a Double is a
 long
 integer for the mantissa, and an int for the exponent.  This doesn't
 work too well for interacting with other languages as I'd need to have
 an arbitrary precision int type there to decode/encode. The CORBA CDR
 standard encodes doubles in a big ended fashion like this (excuse my
 possibly incorrect ascii art):
 
 
 | byte | msb   lsb |
 |--+---|
 |0 | S   E6 E0 |
 |1 | E10 E9 E8 E7 F3 F2 F1  F0 |
 |2 | F11F4 |
 |3 | F19   F12 |
 |4 | F27   F20 |
 |5 | F35   F28 |
 |6 | F43   F36 |
 |7 | F51   F44 |
 
 Up until now, my code is pure haskell.  Is it possible to get at the
 internal bits of a Double/CDouble in ghc? Or Should I use the FFI and
 write C to encode something like the above?

Yep, it's possible, just not portably so. Google for Data.Binary IEEE
discussions.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe