[Haskell-cafe] Parsec in Haskell platform

2010-10-24 Thread Roman Cheplyaka
Since Parsec 2 and Parsec 3 are usually considered to be different
packages, it's ambiguous to say that 'parsec' is included in Haskell
Platform [1].

Could someone please:

  1. Clarify which version(s) are included?
  2. Fix the page [1]

It would be convenient to have a page which would list all the HP packages
with their versions. The release page [2] only has a list of packages
whose versions has changed since the last release, as I understood.

[1] http://hackage.haskell.org/platform/contents.html
[2] http://hackage.haskell.org/platform/changelog.html

-- 
Roman I. Cheplyaka :: http://ro-che.info/
Don't let school get in the way of your education. - Mark Twain
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Splay tree in a pattern matching way

2010-10-24 Thread larry.liuxinyu
Hi,

I just tried a smoke test case, seems the tree is balanced enough:

import System.Random

lookup :: (Ord a) = STree a - a - STree a
lookup E _ = E
lookup t@(Node l x r) y
| x == y= t
| x  y = splay (Node (lookup l y) x r) y
| otherwise = splay (Node l x (lookup r y)) y

testSplay = do
  xs - sequence (replicate 100 (randomRIO(1, 10)))
  putStrLn $ show (foldl lookup t xs)
  where
t = foldl insert (E::STree Int) [1..10]

Where STree a and insert are defined as in my previous email, except I
changed `xy' to `xy' (sorry for the mistake).
By running the testSplay I got a BST like this:

*SplayHeap testSplay
Node (Node E 1 (Node (Node E 2 E) 3 (Node (Node E 4 (Node E 5 E)) 6
(Node E 7 E 8 (Node (Node E 9 E) 10 E)

So I got a bit more confident about the correctness of my code.

Best regards
--
Larry, LIU Xinyu
http://sites.google.com/site/algoxy

On Oct 24, 11:06 am, Xinyu LIU liuxiny...@gmail.com wrote:
 Hi,

 I checked the Hackage Splay Tree implementation 
 from.http://hackage.haskell.org/packages/archive/TreeStructures/0.0.1/doc/...

 Basically it's based on the strategy mentioned in Okasaki's ``Purely
 Functional Programming'', Chapter 5.4.
 That in case we traverse twice in left (or right), we rotate the tree, so in
 long term of view, the tree turns more and more balanced.

 There are 3 cases for splay: zig-zig case, zig-zag case and zig case
 according tohttp://en.wikipedia.org/wiki/Splay_tree

 So I wonder if Splay tree can also be implemented by using pattern matching
 in a similar way as red black tree.

 Here is a draft source code:



 data STree a = E -- Empty
              | Node (STree a) a (STree a) -- left, element, right
                deriving (Eq, Show)

 -- splay by pattern matching
 splay :: (Eq a) = STree a - a -STree a
 -- zig-zig
 splay t@(Node (Node (Node a x b) p c) g d) y =
    if x == y then Node a x (Node b p (Node c g d)) else t
 splay t@(Node a g (Node b p (Node c x d))) y =
    if x == y then Node (Node (Node a g b) p c) x d else t
 -- zig-zag
 splay t@(Node (Node a p (Node b x c)) g d) y =
    if x == y then Node (Node a p b) x (Node c g d) else t
 splay t@(Node a g (Node (Node b x c) p d)) y =
    if x == y then Node (Node a g b) x (Node c p d) else t
 -- zig
 splay t@(Node (Node a x b) p c) y = if x == y then Node a x (Node b p
 c) else t
 splay t@(Node a p (Node b x c)) y = if x == y then Node (Node a p b) x
 c else t
 -- otherwise
 splay t _ = t

 -- insert by using pattern matching
 insert :: (Ord a) = STree a - a - STree a
 insert E y = Node E y E
 insert (Node l x r) y
    | x  y     = splay (Node (insert l y) x r) y
    | otherwise = splay (Node l x (insert r y)) y
 

 I am not quite sure if the solution is correct and what about the
 efficiency of this code.

 Regards.

 --
 Larry. LIU 
 Xinyuhttp://sites.google.com/site/algoxyhttp://sites.google.com/site/algoxy/home

 ___
 Haskell-Cafe mailing list
 haskell-c...@haskell.orghttp://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] concurrency vs. I/O in GHC

2010-10-24 Thread Claude Heiland-Allen

On 23/10/10 23:17, Donn Cave wrote:

Quoth Claude Heiland-Allenclaudiusmaxi...@goto10.org,
...

The conclusion I drew was that unsafe foreign functions block the
current capability (OS thread) and any threads (Haskell forkIO etc)
currently scheduled on that capability, but other capabilities and
threads continue executing as normal.


... until GC time when all capabilities must be ready. (?)


If a trivial test program would help, here I call the sleep() function,
which I believe on a POSIX platform suspends the thread until receipt
of a SIGALRM.


I wrote a program which shows some interesting behaviour:

8

{-# LANGUAGE ForeignFunctionInterface #-}
module Main (main) where
import GHC.Conc (forkOnIO, numCapabilities)
import Control.Concurrent (threadDelay)
import Foreign.C (CInt)
import System.Environment (getArgs)

foreign import ccall unsafe sleep sleep :: CInt - IO CInt

delayer :: Int - IO ()
delayer n = do
  print (delayer, n)
  threadDelay 10 -- 10Hz
  delayer n

sleeper :: Int - IO ()
sleeper n = do
  print (sleeper, n)
  _ - sleep 1   --  1Hz
  sleeper n

main :: IO ()
main = do
  m - (read . head) `fmap` getArgs
  mapM_ (\n - forkOnIO n $ delayer n) [1 .. numCapabilities]
  mapM_ (\n - forkOnIO n $ sleeper n) [1 .. numCapabilities - m]
  threadDelay 1 -- 100s

8

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.12.3
$ uname -a
Linux zebimus 2.6.32-25-generic #44-Ubuntu SMP Fri Sep 17 20:05:27 UTC 
2010 x86_64 GNU/Linux

$ ghc -O2 -Wall -threaded --make DelayedSleep.hs
$ ./DelayedSleep +RTS -N4 -S -RTS 3
[snip]

8

By interesting I mean there is lots of output from the delayer threads 
on capabilities without sleeper threads (as you would expect), with the 
delayer threads on capabilities also having sleeper threads being much 
less frequent (as you might also expect).  But then there are some long 
pauses where there is no output from any thread: my hypothesis is that 
the whole runtime is blocked waiting for all threads to be ready for GC 
(because +RTS -S shows some GC stats after the end of those pauses).



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


Re: [Haskell-cafe] Parsec in Haskell platform

2010-10-24 Thread Andrew Coppin

On 24/10/2010 09:10 AM, Roman Cheplyaka wrote:

It would be convenient to have a page which would list all the HP packages
with their versions. The release page [2] only has a list of packages
whose versions has changed since the last release, as I understood.


It would be nice to have a page that lists everything included in every 
HP release, together with their version numbers. (So that, e.g., I can 
see at a glance what version of GHC, Haddock or cabal-install is in 
HP-2009.1.0.0.) All this information must exist somewhere, it's just not 
easily viewable on the web.


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


Re: [Haskell-cafe] Parsec in Haskell platform

2010-10-24 Thread Johan Tibell
On Sun, Oct 24, 2010 at 11:57 AM, Andrew Coppin
andrewcop...@btinternet.com wrote:
 It would be nice to have a page that lists everything included in every HP
 release, together with their version numbers. (So that, e.g., I can see at a
 glance what version of GHC, Haddock or cabal-install is in HP-2009.1.0.0.)
 All this information must exist somewhere, it's just not easily viewable on
 the web.

http://hackage.haskell.org/platform/changelog.html

There's a Cabal file somewhere specifying all the package in the
platform (including binaries like Happy.)

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


Re: [Haskell-cafe] Converting Values Between Lua And Haskell

2010-10-24 Thread Bulat Ziganshin
Hello aditya,

Sunday, October 24, 2010, 8:05:55 AM, you wrote:

HsLua page is nothing more but my fantasy about future HsLua
development :)  you may find even XXX type where i don't found good
name :)

 Hi all,
 The HsLua page [1] says that Int,Double,String,Bool,[a] and [(a,b)]
 types can be converted to and from Lua values. However the on hslua
 API page I don't see a StackValue instance [2] for [a] or [(a,b)]. Am I 
 missing something?
  -deech

 [1]
 http://www.haskell.org/haskellwiki/HsLua#Exchanging_data_between_Haskell_and_Lua_worlds
 [2]
 http://hackage.haskell.org/packages/archive/hslua/latest/doc/html/Scripting-Lua.html#t:StackValue
   


-- 
Best regards,
 Bulatmailto:bulat.zigans...@gmail.com

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


Re: [Haskell-cafe] Parsec in Haskell platform

2010-10-24 Thread Andrew Coppin

On 24/10/2010 11:10 AM, Johan Tibell wrote:

On Sun, Oct 24, 2010 at 11:57 AM, Andrew Coppin
andrewcop...@btinternet.com  wrote:

It would be nice to have a page that lists everything included in every HP
release, together with their version numbers. (So that, e.g., I can see at a
glance what version of GHC, Haddock or cabal-install is in HP-2009.1.0.0.)
All this information must exist somewhere, it's just not easily viewable on
the web.

http://hackage.haskell.org/platform/changelog.html

There's a Cabal file somewhere specifying all the package in the
platform (including binaries like Happy.)


I'm pretty sure there used to be a link to the .cabal file somewhere, 
but now I can't seem to find it. Instead, I had to navigate to the Unix 
download page, download the source tarball, untar it (non-trivial under 
Windows), and hunt around for the .cabal file. And *then* I can find out 
what's in [the current release of] HP.


It would be nice if there was a table on the website somewhere that I 
could just glance at to get the same information.


[Also, regarding the page linked above... Who the hell uses strong for 
section heading?! Why wou-- oh, wait. It's Pandoc? I guess that also 
explains why we have ASCII-art arrows [-] rather than real arrows 
[rarr;]. And presumably this stuff is written by hand, becuase GHC is 
missing an arrow...]


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


[Haskell-cafe] ANNOUNCE: iteratee-compress 0.1.1

2010-10-24 Thread Maciej Piechotka
Iteratee-compress provides compressing and decompressing enumerators
including flushing. Currently only gzip is provided but at least bzip
is planned.


Changes from previous version:
 - Independent from zlib library (Haskell one, not C)
 - Allow hand-flushing the contents (from outside).
 - Fix potential memory-leak

Next goals:
 - BZip support
 - Generic interface for flushing

To think about:
 - Should inner iteratee be able to request flushing?

Regards

PS. It did change API by removing dependency on zlib but I home such
breakage in 0.1.x will be allowed



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


[Haskell-cafe] Re: Haddock: patch to generate single-index page in addition to perl-letter indexes indices.

2010-10-24 Thread David Waern
2010/10/24 Ryan Newton new...@mit.edu:
 When I encounter a split-index (A-Z) page it can be quite frustrating if I
 don't know the first letter of what I'm searching for.  I want to use my
 browser find!  For example, tonight I wanted to look at all the functions
 that END in Window in the Chart package -- no luck:
   http://hackage.haskell.org/packages/archive/Chart/0.13.1/doc/html/doc-index.html
 Therefore I propose that even when generating the A-Z individual pages
 that there also be an All option for the single-page version.  Attached is
 a patch against haddock's HEAD (darcs get http://code.haskell.org/haddock/
 right?) that implements this behavior.  As an example, here is FGL's
 documentation built with the patched haddock:
   http://people.csail.mit.edu/newton/fgl_example_doc/doc-index.html
 The great thing about hackage being centralized is that if people are happy
 with this fix it can be widely deployed where it counts, and quickly!

Patch applied. Thanks!

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


Re: [Haskell-cafe] Haddock: patch to generate single-index page in addition to perl-letter indexes indices.

2010-10-24 Thread Thomas Schilling
For packages with many items in the index, these pages can get a bit
huge.  How about a permuted index like
http://www.lispworks.com/documentation/HyperSpec/Front/X_Symbol.htm?

E.g., for your use case, you would go to E and then the row with all
the End entries, which would contain all the names with End
anywhere in their name.

I don't know if page size can be a problem, but at least for mobile or
otherwise low-bandwidth devices this can be a nice alternative.

On 24 October 2010 04:41, Ryan Newton new...@mit.edu wrote:
 When I encounter a split-index (A-Z) page it can be quite frustrating if I
 don't know the first letter of what I'm searching for.  I want to use my
 browser find!  For example, tonight I wanted to look at all the functions
 that END in Window in the Chart package -- no luck:
   http://hackage.haskell.org/packages/archive/Chart/0.13.1/doc/html/doc-index.html
 Therefore I propose that even when generating the A-Z individual pages
 that there also be an All option for the single-page version.  Attached is
 a patch against haddock's HEAD (darcs get http://code.haskell.org/haddock/
 right?) that implements this behavior.  As an example, here is FGL's
 documentation built with the patched haddock:
   http://people.csail.mit.edu/newton/fgl_example_doc/doc-index.html
 The great thing about hackage being centralized is that if people are happy
 with this fix it can be widely deployed where it counts, and quickly!
 Cheers,
    -Ryan
 P.S. At the other end of the spectrum, when considering a central index for
 all of hackage (as in the below ticket) maybe it would be necessary to have
 more than 26 pages,  I.e. Aa-Am | An-Az or whatever.
     http://hackage.haskell.org/trac/hackage/ticket/516#comment:6

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





-- 
Push the envelope. Watch it bend.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] running and understanding a lifting program

2010-10-24 Thread Patrick Browne
hi,
I am trying to run and understand a lifting program from [1].
The program lifts points to moving points that vary their position over
time.
I made some effort to run the progrm but I do not know how to overide
the +,-,*,sqr, and sqrt from the Num class. Below is my current attempt.

I do not wish to change or imporve the code, rather I wish to understand
it as it stands and find out what needs to be added to get the outputs
shown below i.e. distance between points p1 and p2 -- 1.55  and the
distance between moving points mp1 and mp2  for time 2  5.83.


data Point = Point Float Float
data Line = Line Point Point
data Polygon = Polygon [Point]
type Time = Float

-- Functor Changing, which adds time parameter t to its input value.
-- For example, Changing Float indicates a changing floating number
(i.e. a function of time).
type Changing v = Time - v

-- The abstract lifting functions
class Lifts a where
 lift0 :: a - f a
 lift1 :: (a - b) - f a - f b
 lift2 :: (a - b - c) - f a - f b - f c


-- Not too sure about this,
instance Lifts Changing Float where
 lift0 a = \t - a
 lift1 op a = \t - op (a t)
 lift2 op a b = \t - op (a t) op (b t)

class Number a where
  (+), (-), (*) :: a - a - a
  sqr, sqrt :: a - a
  sqr a = a * a

-- The class point which support vector plus and minus as well as
-- distance operation is defined as follow
class Number s = Points p s where
 x, y :: p s - s
 x (Point x1 y1) = x1
 y (Point x1 y1) = y1
 (+), (-) :: p s - p s - p s
 (+) a b = Point (x a + x b) (y a + y b)
 (-) a b = Point (x a - x b) (y a - y b)
 dist :: p s - p s - s
 dist a b = sqrt(sqr((x a)-(x b))+sqr((y a)-(y b)))


-- The lifting the operations for numbers shoukd provide a distance
-- function which can be used for both static and moving points:
instance Number v = Number (Changing v) where
 (+) = lift2 (+)
 (-) = lift2 (-)
 (*) = lift2 (*)
 sqrt = lift1 (sqrt)

-- Running the code
-- If p1 and p2 are two 2D static points,
-- their distance d is calculated as follows:
p1, p2 :: Point Float
p1 = Point 3.4 5.5
p2 = Point 4.5 4.5

-- distance between p1 and p2 -- 1.55
d = dist p1 p2

-- For 2D moving points mp1 and mp2, their distance md,
-- which is a function of time, is calculated as follows:
mp1, mp2 :: Point (Changing Float)
mp1 = Point (\t - 4.0 + 0.5 * t)(\t - 4.0 - 0.5 * t)
mp2 = Point (\t - 0.0 + 1.0 * t)(\t - 0.0 - 1.0 * t)
--  distance between mp1 and mp2
md = dist mp1 mp2
-- distance md for time 2  5.83
md 2


[1] A Mathematical Tool to Extend 2D Spatial Operations
to Higher Dimensions:  by Farid Karimipour1,2, Mahmoud R. Delavar1, and
Andrew U. Frank2

http://books.google.ie/books?id=JUGpGN_jwf0Cpg=PA153lpg=PA153dq=Karimipour+%22A+Mathematical+Tool+to+Extend+2D+Spatial+Operations+to+Higher+Dimensions%22source=blots=fu-lSkPMr3sig=ztkcRV3Cv6hn9T6iwQCJ9sB75IMhl=enei=QS7ETJHPGoiA5Ab0zZW6Awsa=Xoi=book_resultct=resultresnum=4ved=0CCMQ6AEwAw#v=onepageq=Karimipour%20%22A%20Mathematical%20Tool%20to%20Extend%202D%20Spatial%20Operations%20to%20Higher%20Dimensions%22f=false





This message has been scanned for content and viruses by the DIT Information 
Services E-Mail Scanning Service, and is believed to be clean. http://www.dit.ie
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Converting Values Between Lua And Haskell

2010-10-24 Thread aditya siram
I was fooled :). Some indication of that on the page would be very helpful.
-deech

On Sun, Oct 24, 2010 at 5:29 AM, Bulat Ziganshin
bulat.zigans...@gmail.comwrote:

 Hello aditya,

 Sunday, October 24, 2010, 8:05:55 AM, you wrote:

 HsLua page is nothing more but my fantasy about future HsLua
 development :)  you may find even XXX type where i don't found good
 name :)

  Hi all,
  The HsLua page [1] says that Int,Double,String,Bool,[a] and [(a,b)]
  types can be converted to and from Lua values. However the on hslua
  API page I don't see a StackValue instance [2] for [a] or [(a,b)]. Am I
 missing something?
   -deech

  [1]
 
 http://www.haskell.org/haskellwiki/HsLua#Exchanging_data_between_Haskell_and_Lua_worlds
  [2]
 
 http://hackage.haskell.org/packages/archive/hslua/latest/doc/html/Scripting-Lua.html#t:StackValue
 


 --
 Best regards,
  Bulatmailto:bulat.zigans...@gmail.com


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


Re: [Haskell-cafe] Parsec in Haskell platform

2010-10-24 Thread Simon Hengel
 It would be convenient to have a page which would list all the HP packages
 with their versions. The release page [2] only has a list of packages
 whose versions has changed since the last release, as I understood.
 
 It would be nice to have a page that lists everything included in
 every HP release, together with their version numbers. (So that,
 e.g., I can see at a glance what version of GHC, Haddock or
 cabal-install is in HP-2009.1.0.0.) All this information must exist
 somewhere, it's just not easily viewable on the web.

Yes, I needed the same information recently.  I ended up reading the
Cabal file at [1].  A convenient way to see what packages are included
in what version of the platform would still be very useful, though.

Cheers,
Simon

[1] http://code.haskell.org/haskell-platform/haskell-platform.cabal
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] back doors into the IO monad

2010-10-24 Thread Nicolas Pouillard
On Sun, 24 Oct 2010 00:28:37 +0200, Manlio Perillo manlio_peri...@libero.it 
wrote:
 Hi.
 
 What are the available methods to execute IO actions from pure code?
 
 I know only unsafePerformIO and foreign import (to call a non pure
 foreign function).

unsafeCoerce is a back door for almost everything.

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


Re: [Haskell-cafe] Haddock: patch to generate single-index page in addition to perl-letter indexes indices.

2010-10-24 Thread Ryan Newton
(Btw, I blame gmail for the mangled title ;-) -- it's been doing some weird
stuff recently on Safari for me; but only in the subject line.  I think
there were backspace characters in an edit that weren't applied.)

The permuted indices are interesting.  It means really committing to the
style/naming conventions, doesn't it?  In common lisp, hyphen separated
names and I guess camel-case for Haskell.  Though you could split on
underscores *or* camel case...

I think multiple ways of indexing the data never hurts (except by confusing
the user a bit).  On that common lisp page I especially like how they've
indented the words.  Frankly I'd like a search box in any interface that
displays more than two thingamajigs.  That should be a UI commandment.

I was expecting the objection of wasted server bandwidth for very large
indices.  I wasn't so worried about the client (even mobile) case.  People
can always press escape if a load takes too long.  And it only happens if
they manually drill down into All.  Perhaps a good idea would be to follow
the convention used elsewhere http://svnbook.red-bean.com/ and have a link
with a size warning -- All Entries (1.6 MB HTML).  That should keep people
from clicking on it with their smartphone :-).  I can tweak it again to do
that if people like.

Cheers,
  -Ryan



On Sun, Oct 24, 2010 at 8:15 AM, Thomas Schilling
nomin...@googlemail.comwrote:

 For packages with many items in the index, these pages can get a bit
 huge.  How about a permuted index like
 http://www.lispworks.com/documentation/HyperSpec/Front/X_Symbol.htm?

 E.g., for your use case, you would go to E and then the row with all
 the End entries, which would contain all the names with End
 anywhere in their name.

 I don't know if page size can be a problem, but at least for mobile or
 otherwise low-bandwidth devices this can be a nice alternative.

 On 24 October 2010 04:41, Ryan Newton new...@mit.edu wrote:
  When I encounter a split-index (A-Z) page it can be quite frustrating if
 I
  don't know the first letter of what I'm searching for.  I want to use my
  browser find!  For example, tonight I wanted to look at all the functions
  that END in Window in the Chart package -- no luck:
 
 http://hackage.haskell.org/packages/archive/Chart/0.13.1/doc/html/doc-index.html
  Therefore I propose that even when generating the A-Z individual pages
  that there also be an All option for the single-page version.  Attached
 is
  a patch against haddock's HEAD (darcs get
 http://code.haskell.org/haddock/
  right?) that implements this behavior.  As an example, here is FGL's
  documentation built with the patched haddock:
http://people.csail.mit.edu/newton/fgl_example_doc/doc-index.html
  The great thing about hackage being centralized is that if people are
 happy
  with this fix it can be widely deployed where it counts, and quickly!
  Cheers,
 -Ryan
  P.S. At the other end of the spectrum, when considering a central index
 for
  all of hackage (as in the below ticket) maybe it would be necessary to
 have
  more than 26 pages,  I.e. Aa-Am | An-Az or whatever.
  http://hackage.haskell.org/trac/hackage/ticket/516#comment:6
 
  ___
  Haskell-Cafe mailing list
  Haskell-Cafe@haskell.org
  http://www.haskell.org/mailman/listinfo/haskell-cafe
 
 



 --
 Push the envelope. Watch it bend.

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


Re: [Haskell-cafe] back doors into the IO monad

2010-10-24 Thread Gwern Branwen
On Sun, Oct 24, 2010 at 10:22 AM, Nicolas Pouillard
nicolas.pouill...@gmail.com wrote:
 On Sun, 24 Oct 2010 00:28:37 +0200, Manlio Perillo manlio_peri...@libero.it 
 wrote:
 Hi.

 What are the available methods to execute IO actions from pure code?

 I know only unsafePerformIO and foreign import (to call a non pure
 foreign function).

 unsafeCoerce is a back door for almost everything.


The mueval tests also include this fun example: 'runST (unsafeIOToST
(readFile /etc/passwd))'

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


Re: [Haskell-cafe] Re: Haskell meeting in Berlin

2010-10-24 Thread Sönke Hahn
On Saturday, October 23, 2010 07:50:41 pm Johannes Waldmann wrote:
  There will be an informal Haskell meeting [...]
  The bi-monthly lisp meeting [...]
  [1] http://www.c-base.org/calender/phpicalendar/month.php
 
 Pray tell - which of the three above-mentioned languages is from the dark
 side?

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


Re: [Haskell-cafe] Parsec in Haskell platform

2010-10-24 Thread Don Stewart
andrewcoppin:
 On 24/10/2010 09:10 AM, Roman Cheplyaka wrote:
 It would be convenient to have a page which would list all the HP packages
 with their versions. The release page [2] only has a list of packages
 whose versions has changed since the last release, as I understood.

 It would be nice to have a page that lists everything included in every  
 HP release, together with their version numbers. (So that, e.g., I can  
 see at a glance what version of GHC, Haddock or cabal-install is in  
 HP-2009.1.0.0.) All this information must exist somewhere, it's just not  
 easily viewable on the web.

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


Re: [Haskell-cafe] Eta-expansion and existentials (or: types destroy my laziness)

2010-10-24 Thread Henning Thielemann
Max Bolingbroke schrieb:

 Let's start with a simple example of an existential data type:
 
 data Stream a = forall s. Stream s (s - Maybe (a, s))

I use quite the same data type for my signal processing applications:
  http://code.haskell.org/synthesizer/core/src/Synthesizer/State/Signal.hs

You may be interested in my overview:
http://hackage.haskell.org/packages/archive/synthesizer/0.2.0.1/doc/html/Synthesizer-Storage.html

 Now we may wish to define infinite streams using value recursion:
 
 ones :: Stream Int
 ones = cons 1 ones

For me a Stream is a List without storage, thus in your example you
cannot share the content of 'ones'. The internal state type becomes
larger and larger for every new element (every element adds a new layer
of Maybe, if I'm not mistaken).

In cases, where I want this kind of recursion I store the content
generated by a Stream in a list or another more efficient stream type or
I write special functions for this purpose (e.g., 'repeat' in the case
of 'ones').


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


Re: [Haskell-cafe] ANNOUNCE: iteratee-compress 0.1.1

2010-10-24 Thread wren ng thornton

On 10/24/10 7:09 AM, Maciej Piechotka wrote:

Iteratee-compress provides compressing and decompressing enumerators
including flushing. Currently only gzip is provided but at least bzip
is planned.

Changes from previous version:
  - Independent from zlib library (Haskell one, not C)
  - Allow hand-flushing the contents (from outside).
  - Fix potential memory-leak

Next goals:
  - BZip support
  - Generic interface for flushing


Have you thought about adding LZO[1] support? There'd be the usual 
licensing issues for GPL, but it offers a realtime alternative to gzip 
(i.e., decompression time is hidden by I/O latency) with comparable 
compression performance.



[1] http://www.oberhumer.com/opensource/lzo/

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


Re: [Haskell-cafe] Bug in HTTP (bad internal error handling)

2010-10-24 Thread Ganesh Sittampalam

On Sun, 24 Oct 2010, Bit Connor wrote:


On Sat, Oct 23, 2010 at 8:49 PM, Ganesh Sittampalam gan...@earth.li wrote:


I'm just looking at fixing this so I can make an upload as discussed with
Sigbjorn. I guess the best thing to do is to make all the calls to fail into
something more explicit.


Yep. Ideally, simpleHTTP and its friends should never throw an IO
exception (and should certainly never call prelude's error, as
happens now). Network errors and other errors should be reported by
returning an appropriate ConnError Result:


I'm not going to try to audit for that exhaustively right now, but I've 
changed all the calls to fail that were broken by the Either change, so 
hopefully we should be back where we started.


I've put a repo up with the changes and a base dependency bump at 
http://urchin.earth.li/git/HTTP - could you (and anyone else interested) 
give it a try? I haven't done anything but the most minimal testing and in 
particular I haven't made any effort to reproduce your specific problem.


I plan to upload this as HTTP-4000.0.10 in the next few days.

Cheers,

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


[Haskell-cafe] Re: ANNOUNCE: iteratee-compress 0.1.1

2010-10-24 Thread Maciej Piechotka
On Sun, 2010-10-24 at 15:03 -0400, wren ng thornton wrote:
 On 10/24/10 7:09 AM, Maciej Piechotka wrote:
  Iteratee-compress provides compressing and decompressing enumerators
  including flushing. Currently only gzip is provided but at least bzip
  is planned.
 
  Changes from previous version:
- Independent from zlib library (Haskell one, not C)
- Allow hand-flushing the contents (from outside).
- Fix potential memory-leak
 
  Next goals:
- BZip support
- Generic interface for flushing
 
 Have you thought about adding LZO[1] support? There'd be the usual 
 licensing issues for GPL, but it offers a realtime alternative to gzip 
 (i.e., decompression time is hidden by I/O latency) with comparable 
 compression performance.
 
 
 [1] http://www.oberhumer.com/opensource/lzo/
 

Currently I thought only about bzip2/gzip. Probably .xz support would
follow if any.

LZO, as you said, is on GPL-2. While I have no problems with GPL-2 some
potential users may (Haskell tend to be BSD3 community). Does anyone
knows if conditional compilation solves problem? In my interpretation of
GPL-2 yes but I'm not sure. 

Regards


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


Re: [Haskell-cafe] Re: ANNOUNCE: iteratee-compress 0.1.1

2010-10-24 Thread Felipe Lessa
On Sun, Oct 24, 2010 at 9:59 PM, Maciej Piechotka uzytkown...@gmail.com wrote:
 Currently I thought only about bzip2/gzip. Probably .xz support would
 follow if any.

 LZO, as you said, is on GPL-2. While I have no problems with GPL-2 some
 potential users may (Haskell tend to be BSD3 community). Does anyone
 knows if conditional compilation solves problem? In my interpretation of
 GPL-2 yes but I'm not sure.

Conditional compilation is tricky for licensing purposes, I think.
But a 'iteratee-compress-lzo' or 'iteratee-compress-gpl' package would
definitely avoid such issues.

Cheers!

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


Re: [Haskell-cafe] ANNOUNCE: iteratee-compress 0.1.1

2010-10-24 Thread Conrad Parker
On 24 October 2010 20:09, Maciej Piechotka uzytkown...@gmail.com wrote:
 Iteratee-compress provides compressing and decompressing enumerators
 including flushing. Currently only gzip is provided but at least bzip
 is planned.


 Changes from previous version:
  - Independent from zlib library (Haskell one, not C)
  - Allow hand-flushing the contents (from outside).
  - Fix potential memory-leak

 Next goals:
  - BZip support
  - Generic interface for flushing

 To think about:
  - Should inner iteratee be able to request flushing?

 Regards

 PS. It did change API by removing dependency on zlib but I home such
 breakage in 0.1.x will be allowed

version numbers are cheap :)

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


Re: [Haskell-cafe] Re: ANNOUNCE: iteratee-compress 0.1.1

2010-10-24 Thread wren ng thornton

On 10/24/10 8:14 PM, Felipe Lessa wrote:

On Sun, Oct 24, 2010 at 9:59 PM, Maciej Piechotkauzytkown...@gmail.com  wrote:

Currently I thought only about bzip2/gzip. Probably .xz support would
follow if any.

LZO, as you said, is on GPL-2. While I have no problems with GPL-2 some
potential users may (Haskell tend to be BSD3 community). Does anyone
knows if conditional compilation solves problem? In my interpretation of
GPL-2 yes but I'm not sure.


Conditional compilation is tricky for licensing purposes, I think.
But a 'iteratee-compress-lzo' or 'iteratee-compress-gpl' package would
definitely avoid such issues.


I was going to suggest iteratee-compress-gpl...

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