Re: [Haskell-cafe] Conduit versions of wai and warp?

2012-01-18 Thread Vincent Hanquez

On 01/19/2012 03:22 AM, Erik de Castro Lopo wrote:

 Michael Snoyman wrote:

> However, WAI and Warp are mostly ready now, just needing a bit more
> testing. If people want to give me some feedback on the readiness
> of them, and would like them released earlier, I'm definitely
> flexible.
>
> Meanwhile: yes, the Github version is conduit-based.

 Michael,

 I'm having some trouble getting the right set of dependencies for
 Conduit versions of wai and warp. At the moment I'm stuck on
 asn1-data; every version I can find of that seems to depend on
 enumerator.


Humm, yeah, a bit sad, I'ld like to move away from them as well, and
probably just moving to a raw-attoparsec-based API would be fine.

But asn1-data is not part of wai/warp, and just a sub dependency of tls.
so you can just have enumerator installed for it for the time being.

--
Vincent @vincenthz

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


Re: [Haskell-cafe] Conduit versions of wai and warp?

2012-01-18 Thread Erik de Castro Lopo
Michael Snoyman wrote:

> We can still have a conduit-based version of WAI and Warp, even if an
> underlying package uses enumerator. The enumerator usage from
> asn1-data doesn't leak into WAI or Warp at all[1]. We could ask
> Vincent to consider moving over to attoparsec-conduit instead, but I
> don't think there's any strong need for this.

Ah, got it now. Thanks.

Look forward to this stuff hitting Hackage.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/

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


Re: [Haskell-cafe] Conduit versions of wai and warp?

2012-01-18 Thread Michael Snoyman
On Thu, Jan 19, 2012 at 5:22 AM, Erik de Castro Lopo
 wrote:
> Michael Snoyman wrote:
>
>> However, WAI and Warp are mostly ready now, just
>> needing a bit more testing. If people want to give me some feedback on
>> the readiness of them, and would like them released earlier, I'm
>> definitely flexible.
>>
>> Meanwhile: yes, the Github version is conduit-based.
>
> Michael,
>
> I'm having some trouble getting the right set of dependencies for
> Conduit versions of wai and warp. At the moment I'm stuck on
> asn1-data; every version I can find of that seems to depend on
> enumerator.
>
> Is there a simple recipe somewhere for build conduit versions of
> wai and warp?
>
> Cheers,
> Erik

We can still have a conduit-based version of WAI and Warp, even if an
underlying package uses enumerator. The enumerator usage from
asn1-data doesn't leak into WAI or Warp at all[1]. We could ask
Vincent to consider moving over to attoparsec-conduit instead, but I
don't think there's any strong need for this.

Michael

[1] In fact, asn1-data isn't even a dependency for WAI or Warp, though
it is for http-conduit

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


[Haskell-cafe] Haskell Weekly News: Issue 211

2012-01-18 Thread Daniel Santa Cruz
Welcome to issue 211 of the HWN, a newsletter covering developments in
the Haskell community. This release covers top stories found around the
net between January 01 to 14, 2012.

This is going to be a shorted version, as I have been out of time. I
did not want to let more time go by without a heartbeat from your
friendly HWN.

Happy coding!

You can find an HTML version at:
http://contemplatecode.blogspot.com/2012/01/haskell-weekly-news-issue-211.html

Quotes of the Week

   *  xtalmath: #math or #not-math would probably be a more
 appropriate place to ask.
  ddarius: Those two channels pretty much cover it all.
  shachaf: You're clearly not an intuitionist.

   * monochrom: in fact, freedom is the freedom to write 2.2 = 4

   * Jafet: caleskell is the standard golf course.

   * byorgey: Escaped skolem! Authorities mount massive search. News at
 11.

   * BMeph: loves swapping function arguments, he said flippantly

   * kmc: "Haskell is great, because Curry-Howard! Proving things in the
 type system. We can prove that, uh, Ints exist, unless they're
 [bottom]."

   * Jafet: In Soviet Russia, State executes you

   * byorgey: that would be known as "low-dimensional linear algebra",
 where "low-dimensional" is said in as condescending a tone as
 possible

   * monochrom: at a crossroad you meet an angel (always tells the
 truth) or demon (always lies). the crossroad gives you two choices
 of roads, one to heaven, one to hell, and only the angel or demon
 knows which is which. if you ask "how would you answer if I asked
 'what is a monad?'", what will happen?

Top Reddit Stories

   * Dropbox tech blog » Using the Dropbox API from Haskell
 Domain: tech.dropbox.com, Score: 68, Comments: 4
 On Reddit: [1] http://goo.gl/rsndV
 Original: [2] http://goo.gl/g3RyF

   * A new approach to iteratees
 Domain: self.haskell, Score: 48, Comments: 99
 On Reddit: [3] http://goo.gl/ZRbGW
 Original: [4] http://goo.gl/ZRbGW

   * Haskell / Repa Real-Time Ray Tracing Demo
 Domain: youtube.com, Score: 45, Comments: 7
 On Reddit: [5] http://goo.gl/rzyZs
 Original: [6] http://goo.gl/15P2V

   * Order theory for computer scientists
 Domain: matt.might.net, Score: 39, Comments: 1
 On Reddit: [7] http://goo.gl/nTOfr
 Original: [8] http://goo.gl/HAVjQ

   * Generalizing Streams into Coroutines (with an introduction to
functors, applicative functors and arrows)
 Domain: github.com, Score: 38, Comments: 15
 On Reddit: [9] http://goo.gl/hUopY
 Original: [10] http://goo.gl/avTUf

   * Well-Typed are hiring: Haskell consultant
 Domain: well-typed.com, Score: 38, Comments: 71
 On Reddit: [11] http://goo.gl/Chu7f
 Original: [12] http://goo.gl/VHPfJ

   * Why iteratees are hard to understand
 Domain: blog.ezyang.com, Score: 34, Comments: 11
 On Reddit: [13] http://goo.gl/LrEoV
 Original: [14] http://goo.gl/d1scG

   * Modern reall-world Haskell?
 Domain: self.haskell, Score: 33, Comments: 21
 On Reddit: [15] http://goo.gl/l0Aud
 Original: [16] http://goo.gl/l0Aud

   * FRP: reactive-banana is getting dynamic event switching
 Domain: apfelmus.nfshost.com, Score: 30, Comments: 3
 On Reddit: [17] http://goo.gl/dGblT
 Original: [18] http://goo.gl/ovRE5

   * wxHaskell and wxWidgets 2.9
 Domain: wewantarock.wordpress.com, Score: 29, Comments:
 On Reddit: [19] http://goo.gl/sxiBx
 Original: [20] http://goo.gl/878Aj

   * Updated Yesod blog example: i18n, authentication, authorization, and
database
 Domain: yesodweb.com, Score: 28, Comments: 22
 On Reddit: [21] http://goo.gl/4eDAT
 Original: [22] http://goo.gl/duzSG

   * Experiments in Haskell Packaging
 Domain: justhaskell.org, Score: 27, Comments: 5
 On Reddit: [23] http://goo.gl/y2vHk
 Original: [24] http://goo.gl/0nADv

   * http-conduit
 Domain: yesodweb.com, Score: 26, Comments: 26
 On Reddit: [25] http://goo.gl/gisUJ
 Original: [26] http://goo.gl/mMhaf

   * Reasoning about Stream Processing with Effects
 Domain: personal.cis.strath.ac.uk, Score: 26, Comments: 6
 On Reddit: [27] http://goo.gl/3Ckzr
 Original: [28] http://goo.gl/Uw8ZO

   * Simon Marlow's Parallel and Concurrent Programming Haskell (slides)
 Domain: self.haskell, Score: 26, Comments: 3
 On Reddit: [29] http://goo.gl/Rg0Lz
 Original: [30] http://goo.gl/Rg0Lz

   * Who is my Community? -- wxHaskell maintainer's thoughts on C bindings
 Domain: wewantarock.wordpress.com, Score: 26, Comments:
 On Reddit: [31] http://goo.gl/tcqZN
 Original: [32] http://goo.gl/mRwQa

Top StackOverflow Questions

   * Fun with repeated fmap
 votes: 26, answers: 1
 Read on SO: [33] http://goo.gl/T2FPm

   * Can a compiler automatically detect pure functions without the type
information about purity?
 votes: 23, answers: 2
 Read on SO: [34] http://goo.gl/wgYim

   * What does “floated out” mean?
  

Re: [Haskell-cafe] Conduit versions of wai and warp?

2012-01-18 Thread Erik de Castro Lopo
Michael Snoyman wrote:

> However, WAI and Warp are mostly ready now, just
> needing a bit more testing. If people want to give me some feedback on
> the readiness of them, and would like them released earlier, I'm
> definitely flexible.
> 
> Meanwhile: yes, the Github version is conduit-based.

Michael,

I'm having some trouble getting the right set of dependencies for
Conduit versions of wai and warp. At the moment I'm stuck on
asn1-data; every version I can find of that seems to depend on
enumerator.

Is there a simple recipe somewhere for build conduit versions of
wai and warp?

Cheers,
Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/

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


Re: [Haskell-cafe] black Wikipedia

2012-01-18 Thread John Lask




"This bill cannot be fixed; it must be killed." - The EFF



yes the act is pernicious, and may cause the wholesale relocation of 
content out of the US, to friendlier places like China, perhaps!



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


Re: [Haskell-cafe] black Wikipedia

2012-01-18 Thread Austin Seipp
Aside from being a horrible oversimplification of the matter (because
it's *never* that simple - Wikipedia is not in this movement for
commercial interest or the side of SV/HW, but because it opposes the
censoring of the internet; neither are people like Dan Kaminsky, who
are also opposing from the point of the large-scale security
ramifications due to the subversion of DNS' universal nature,) and the
grounds at stake extending far beyond either SV or Hollywood [1] - I
don't really think boiling it down to 2 contenders is terribly
important: It passes, and we lose. Or we'll end up having to fight an
even tougher battle.

"This bill cannot be fixed; it must be killed." - The EFF

On Wed, Jan 18, 2012 at 5:42 PM, Hans Aberg  wrote:
> Actually, it is a battle between the Hollywood and Silicon Valley industries.
>
> Hans
>

[1] It will cause substantial damage to large number of existing jobs
in plenty of places as a result of massive amounts of litigation, it
will stunt investment in anything which could potentially suffer from
such litigation, it sets horrific precedents, goes beyond just
'piracy' with the Monster case as John pointed out, and could result
in possible follow up laws in similar countries.

-- 
Regards,
Austin

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


Re: [Haskell-cafe] black Wikipedia

2012-01-18 Thread John Meacham
However the fallout is likely to destroy both open source and resale
on the internet.

For instance, the existence of this is enough to get hackage a
takedown under SOPA.
http://hackage.haskell.org/package/conjure

now, you might say we can just move hackage out of the US, but then
any site that _links_ to hackage from within the US will then be
subject to takedown from within the US, and any US based search engine
would be unable to index hackage or return results to it, until
hackage hired a lawyer to prove they don't fascilitate piracy. And I
am not even sure they would win, providing a bittorrent client is
fascilitting piracy because it can be used as a piratebay client.
supporting piracy is transitive under SOPA. think freshmeat.net,
slashdot.org, github, basically any site that links to user content
can be shut down. And haskell.org won't be able to link to it without
also falling prey to SOPA. it's transitive.

Not only that, but the proponents are not just hollywood, it is anyone
that feels they will have an advantage with the ability to bully
internet sites. For instance, monster cable is a huge supporter and
they have a history of suing any site that posts bad reviews of their
products or anyone that uses the words 'monster' or 'cable'. under
SOPA they could just get the sites they want shut down until they
capitulate. Silicon Valley need not fear this sort of thing too much
as they can bite back with lawyers of their own, but independent sites
will find themselves shut off or delisted and sites linking to them
shut down.

John

On Wed, Jan 18, 2012 at 3:42 PM, Hans Aberg  wrote:
> Actually, it is a battle between the Hollywood and Silicon Valley industries.
>
> Hans
>
>
> On 19 Jan 2012, at 00:11, John Meacham wrote:
>
>> And such a thing can take months or years for the courts to figure
>> out, and unless your free site has a lawyer to fight for your side,
>> under SOPA/PIPA you can be down the entire time with little recourse.
>> For anyone hosting content lke hackage, github, etc. when you have
>> thousands of packages, someone somewhere is going to be upset by
>> something and will be able to take the site down. _regardless of the
>> merit of their case_ the site will go down as they figure it out. Not
>> only that, they would be able to take the site down if it contains a
>> link to an objectionable site. for instance, if one of the homepage
>> fields in some cabal file  somewhere pointed to a site that someone
>> took offense too on it. we would not only be obligated to patrol the
>> code uploaded, but the targets of any urls within said
>> code/description... and retroactively remove stuff if said links
>> change to contain objectional material. (for a very vauge definition
>> of objectionable). it is a really messed up law.
>>
>>    John
>>
>> On Wed, Jan 18, 2012 at 2:46 PM, Hans Aberg  wrote:
>>> On 18 Jan 2012, at 23:11, Brandon Allbery wrote:
>>>
> There is the Beastie Boys case, where the judge decided copyright 
> protects what is creatively unique.

 But such judgments are rare, sadly.  And for every Beastie Boys case 
 there's at least one The Verve case.
>>>
>>> I did not know that. But it was a UK case, wasn't it? - UK copyright laws 
>>> are a lot more tight.
>>>
>>> Hans
>>>
>>>
>

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


Re: [Haskell-cafe] black Wikipedia

2012-01-18 Thread Hans Aberg
Actually, it is a battle between the Hollywood and Silicon Valley industries.

Hans


On 19 Jan 2012, at 00:11, John Meacham wrote:

> And such a thing can take months or years for the courts to figure
> out, and unless your free site has a lawyer to fight for your side,
> under SOPA/PIPA you can be down the entire time with little recourse.
> For anyone hosting content lke hackage, github, etc. when you have
> thousands of packages, someone somewhere is going to be upset by
> something and will be able to take the site down. _regardless of the
> merit of their case_ the site will go down as they figure it out. Not
> only that, they would be able to take the site down if it contains a
> link to an objectionable site. for instance, if one of the homepage
> fields in some cabal file  somewhere pointed to a site that someone
> took offense too on it. we would not only be obligated to patrol the
> code uploaded, but the targets of any urls within said
> code/description... and retroactively remove stuff if said links
> change to contain objectional material. (for a very vauge definition
> of objectionable). it is a really messed up law.
> 
>John
> 
> On Wed, Jan 18, 2012 at 2:46 PM, Hans Aberg  wrote:
>> On 18 Jan 2012, at 23:11, Brandon Allbery wrote:
>> 
 There is the Beastie Boys case, where the judge decided copyright protects 
 what is creatively unique.
>>> 
>>> But such judgments are rare, sadly.  And for every Beastie Boys case 
>>> there's at least one The Verve case.
>> 
>> I did not know that. But it was a UK case, wasn't it? - UK copyright laws 
>> are a lot more tight.
>> 
>> Hans
>> 
>> 


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


Re: [Haskell-cafe] Error in converting List of Lists into PArray ( Parray a )

2012-01-18 Thread Atsuro Hoshino
Hi Mukesh,

Below is a naive implementation of converting `[[(Int,Double)]]' to
`PArray (PArray (Int, Double))' .
There's no instance for `PA [a]', I've explicitly separated the inner
and outer conversion.
Though, when reading data from a file and converting, it might be
better to use `hGet' in:

  
http://hackage.haskell.org/packages/archive/dph-prim-par/0.5.1.1/doc/html/Data-Array-Parallel-Unlifted.html

-- 
module Main where

import Data.Array.Parallel
import Data.Array.Parallel.PArray ()
import qualified Data.Array.Parallel.PArray as P

mat_li :: [[(Int, Double)]]
mat_li =
  [ zip [1..] [ 1, 2, 3, 0, 0, 0, 0, 0, 4 ]
  , zip [1..] [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
  , zip [1..] [ 0, 0, 0, 0, 0, 0, 1, 2, 0 ] ]

mat_pa_1 :: PArray (PArray (Int, Double))
mat_pa_1 = P.fromList (fmap P.fromList mat_li)

mat_pa_2 :: PArray (PArray (Int, Double))
mat_pa_2 = conv_outer (conv_inner mat_li)

conv_inner :: P.PA a => [[a]] -> [PArray a]
conv_inner = map P.fromList

conv_outer :: P.PA a => [PArray a] -> PArray (PArray a)
conv_outer xs = case xs of
  [] -> P.empty
  (x:xs) -> P.singleton x P.+:+ conv_outer xs

main :: IO ()
main =
  -- Printing `mat_pa_1' shows an error:
  --
  -- > No instance nor default method for class operation
  -- > Data.Array.Parallel.PArray.PData.fromListPR
  --
  -- print mat_pa_1
  print mat_pa_2



Hope this well help.


Regards,
 --
Atsuro Hoshino

On Thu, Jan 19, 2012 at 4:47 AM, mukesh tiwari
 wrote:
> Hello all
> I am trying to convert List of Lists ( [[(Int , Double )]] ) into PArray (
> PArray ( Int , Double )) but getting run time error. This code works fine
> and print list of PArray ( Int , Double ) but when i put print $ P.fromList
> ( map P.fromList c ) then i am getting runtime error. It says "Main:
> Data/Array/Parallel/PArray/PDataInstances.hs:337:10-30: No instance nor
> default method for class operation
> Data.Array.Parallel.PArray.PData.fromListPR". Could some one please tell me
> how to resolve this issue.
> Thank you
>
>
> --import ParallelMat
> import Data.List
> import System.Environment
> import Data.Array.Parallel
> import qualified Data.Array.Parallel.PArray as P
>
>
> processMatrix :: [ [ Double ] ] -> [ [ Double ] ] -> [ ( [ ( Int , Double )
> ] , [ ( Int , Double ) ]) ]
> processMatrix [] [] = []
> processMatrix ( x : xs ) ( y : ys )
>   | ( all ( == 0 ) x )  Prelude.|| (  all ( == 0 ) y ) = processMatrix xs ys
>   | otherwise = ( filter ( \( x , y ) -> y /= 0 ) . zip [ 1..]  $ x ,filter
> (  \( x , y ) -> y /= 0 ) . zip [1..] $ y  ) : processMatrix xs ys
>
> main = do
>     [ first , second ] <- getArgs
>     a <- readFile first
>     b <- readFile second
>     let a' = transpose . tail . map ( map ( read :: String -> Double ) .
> words ) . lines $ a
>     b' = tail . map ( map ( read :: String -> Double ) . words ) . lines
> $ b
>     ( c , d )   = unzip $ processMatrix a' b'
>     print $   (  map P.fromList c )
>    --print d
>
> Macintosh-0026bb610428:Haskell mukesh$ ghc --make  -Odph -fdph-par  Main.hs
> [1 of 1] Compiling Main             ( Main.hs, Main.o )
> Linking Main ...
> Macintosh-0026bb610428:Haskell mukesh$ ./Main  A.in A.in
> [fromList [(1,1.0),(6,1.0)],fromList
> [(4,11.0),(9,11.0)],fromList [(1,4.0),(4,2.0),(6,4.0),(9,2.0)]]
>
> Putting print $ P.fromList ( map P.fromList c )
>
> Macintosh-0026bb610428:Haskell mukesh$ ghc --make  -Odph -fdph-par  Main.hs
> [1 of 1] Compiling Main             ( Main.hs, Main.o )
> Linking Main ...
> Macintosh-0026bb610428:Haskell mukesh$ ./Main  A.in A.in
> Main: Data/Array/Parallel/PArray/PDataInstances.hs:337:10-30: No instance
> nor default method for class operation
> Data.Array.Parallel.PArray.PData.fromListPR
>
> Input file A.in
> 10 10
> 1 2 3 0 0 0 0 0 0 4
> 0 0 0 0 0 0 0 0 0 0
> 0 0 0 0 0 0 0 0 0 0
> 0 0 0 0 0 0 1 2 11 2
> 0 1 2 0 0 0 0 0 0 0
> 1 2 3 0 0 0 0 0 0 4
> 0 0 0 0 0 0 0 0 0 0
> 0 0 0 0 0 0 0 0 0 0
> 0 0 0 0 0 0 1 2 11 2
> 0 1 2 0 0 0 0 0 0 0
> ___
> 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] black Wikipedia

2012-01-18 Thread John Meacham
And such a thing can take months or years for the courts to figure
out, and unless your free site has a lawyer to fight for your side,
under SOPA/PIPA you can be down the entire time with little recourse.
For anyone hosting content lke hackage, github, etc. when you have
thousands of packages, someone somewhere is going to be upset by
something and will be able to take the site down. _regardless of the
merit of their case_ the site will go down as they figure it out. Not
only that, they would be able to take the site down if it contains a
link to an objectionable site. for instance, if one of the homepage
fields in some cabal file  somewhere pointed to a site that someone
took offense too on it. we would not only be obligated to patrol the
code uploaded, but the targets of any urls within said
code/description... and retroactively remove stuff if said links
change to contain objectional material. (for a very vauge definition
of objectionable). it is a really messed up law.

John

On Wed, Jan 18, 2012 at 2:46 PM, Hans Aberg  wrote:
> On 18 Jan 2012, at 23:11, Brandon Allbery wrote:
>
>>> There is the Beastie Boys case, where the judge decided copyright protects 
>>> what is creatively unique.
>>
>> But such judgments are rare, sadly.  And for every Beastie Boys case there's 
>> at least one The Verve case.
>
> I did not know that. But it was a UK case, wasn't it? - UK copyright laws are 
> a lot more tight.
>
> Hans
>
>

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


Re: [Haskell-cafe] black Wikipedia

2012-01-18 Thread Hans Aberg
On 18 Jan 2012, at 23:11, Brandon Allbery wrote:

>> There is the Beastie Boys case, where the judge decided copyright protects 
>> what is creatively unique.
> 
> But such judgments are rare, sadly.  And for every Beastie Boys case there's 
> at least one The Verve case.

I did not know that. But it was a UK case, wasn't it? - UK copyright laws are a 
lot more tight.

Hans



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


Re: [Haskell-cafe] Pattern-matching & substitution for haskell-src-exts?

2012-01-18 Thread Joachim Breitner
Hi,

Am Mittwoch, den 18.01.2012, 12:05 -0800 schrieb Conal Elliott:
> Has anyone implemented pattern-matching & substitution for
> haskell-src-exts?  - Conal

without checking the code, I believe that hlint does exactly that; it
takes rules (given as Haskell code), matches them as patterns against
the real code and substitutes the matched parts in the right side of the
rule.

Greetings,
Joachim

-- 
Joachim "nomeata" Breitner
  m...@joachim-breitner.de  |  nome...@debian.org  |  GPG: 0x4743206C
  xmpp: nome...@joachim-breitner.de | http://www.joachim-breitner.de/



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] black Wikipedia

2012-01-18 Thread David Thomas
Granted, but nothing a technical user can't handle, which was the
earlier question.

On Wed, Jan 18, 2012 at 2:18 PM, Brandon Allbery  wrote:
> On Wed, Jan 18, 2012 at 17:15, David Thomas 
> wrote:
>>
>> My understanding is that blocking/redirection is to be done at the DNS
>> level.  In which case, there *is* a "?banner" hack of sorts - get the
>> IP by some other means.
>
>
> Sadly name-based virtual hosts require a bit more work than that...
>
> --
> brandon s allbery                                      allber...@gmail.com
> wandering unix systems administrator (available)     (412) 475-9364 vm/sms
>

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


Re: [Haskell-cafe] black Wikipedia

2012-01-18 Thread Brandon Allbery
On Wed, Jan 18, 2012 at 17:15, David Thomas wrote:

> My understanding is that blocking/redirection is to be done at the DNS
> level.  In which case, there *is* a "?banner" hack of sorts - get the
> IP by some other means.
>

Sadly name-based virtual hosts require a bit more work than that...

-- 
brandon s allbery  allber...@gmail.com
wandering unix systems administrator (available) (412) 475-9364 vm/sms
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] black Wikipedia

2012-01-18 Thread David Thomas
My understanding is that blocking/redirection is to be done at the DNS
level.  In which case, there *is* a "?banner" hack of sorts - get the
IP by some other means.

Which is not to say we should be significantly less concerned.

On Wed, Jan 18, 2012 at 10:17 AM, Brandon Allbery  wrote:
> On Wed, Jan 18, 2012 at 13:11, Henning Thielemann
>  wrote:
>>
>> On Wed, 18 Jan 2012, Andrew Butterfield wrote:
>>>
>>> Just add ?banner=none to the url if you really have to read the page
>>
>>
>> Maybe the intention was to demonstrate that censorship (in this case
>> self-censorship) is mostly a problem for average users but not for advanced
>> users.
>
>
> There isn't going to be a disable-javascript or ?banner hack when anyone
> anywhere can force a website to be redirected to some DOJ page without
> providing any proof.  (Yes, really.)
>
> --
> brandon s allbery                                      allber...@gmail.com
> wandering unix systems administrator (available)     (412) 475-9364 vm/sms
>
>
> ___
> 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] black Wikipedia

2012-01-18 Thread Brandon Allbery
On Wed, Jan 18, 2012 at 15:20, Hans Aberg  wrote:

> There is the Beastie Boys case, where the judge decided copyright protects
> what is creatively unique.


But such judgments are rare, sadly.  And for every Beastie Boys case
there's at least one The Verve case.

-- 
brandon s allbery  allber...@gmail.com
wandering unix systems administrator (available) (412) 475-9364 vm/sms
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] REMINDER: Hac Boston from January 20-22 at MIT

2012-01-18 Thread Edward Z. Yang
I'd like to remind everyone that Hac Boston, a Haskell hackathon is being held
January 20-22, 2012 at MIT (rooms 4-159 and 4-261) in Cambridge, MA.

The hackathon will officially kick off at 2:30 Friday afternoon, and go
until 5pm on Sunday with the occasional break for sleep.

Everyone is welcome -- you do not have to be a Haskell guru to attend!
Helping hack on someone else's project could be a great way to increase
your Haskell skills.

If you plan on coming, please officially 
register,
even if you already put your name on the wiki.  Registration, travel, some
information about lodging and many other details can now be found on the Hac
Boston wiki .  Edward Kmett tells
me we still have space.

We're also looking for a few people interested in giving short (15-20 min.)
talks, probably on Saturday afternoon.  Anything of interest to the
Haskell community is fair game---a project you've been working on, a
paper, a quick tutorial.  If you'd like to give a talk, add it on 
the
wiki .

We look forward to seeing you at MIT!

Cheers,
Edward


sup-attachment-1326923418-8029.html
Description: Binary data
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Need advice: Haskell in Web Client

2012-01-18 Thread Dag Odenhall
On Tue, 2012-01-17 at 22:05 +0300, dokondr wrote:
> On Tue, Jan 17, 2012 at 6:42 PM, John Lenz  wrote:
> 
> >
> > HTML5 Canvas is great for charts.  If you go this route you might as well
> > use a library which draws charts for you instead of writing all this code
> > yourself.
> >
> > Personally, I use extjs version 4 which has some amazing charts, but there
> > are other libraries out there.
> >
> > http://www.sencha.com/**products/extjs/examples/#**sample-3
> >
> > Essentially the server provides the data in JSON or XML some other format,
> > and the extjs code draws the charts on the client side.
> >
> > If you go with extjs, then the server side I would suggest a small, simple
> > yesod or snap server.   You could probably get the server under a hundred
> > lines of code with yesod; see some of the examples in the yesod book.
> >  yesod or snap would serve JSON of the statistics on request, and also
> > serve the javascript files which draw the charts.
> >
> 
> Yes, I was thinking about using Haskell to generate everything that
> specific Javascript library needs to display charts in browser. Naturally
> charts are to be displayed by this library itself. I also would like to
> have Haskell tools to generate Web GUI in Javascript.
> As for yesod, I am not sure that I like approach which mixes HTML with
> code, or even worse - creates a new weird HTML-like language like  'whamlet
> quasi-quotation', for example:
> 
> 
> 
> I prefer using Turing complete PL to program web client, like the one used
> in GWT (Java) or Cappuccino  (Objective-J). http://cappuccino.org/learn/
> In this case you /almost/ don't need to know  HTML, CSS, DOM, Ajax, etc. to
> develop WebUI and good PL lets you concentrate on problem domain instead of
> bothering about browser support.
> It is a real pity that Haskell still has no such tools to generate Web GUI
> in Javascript. (((

Have you seen Chris Done's posts on the subject?

http://chrisdone.com/tags/javascript.html



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


Re: [Haskell-cafe] Pattern-matching & substitution for haskell-src-exts?

2012-01-18 Thread Gwern Branwen
On Wed, Jan 18, 2012 at 3:05 PM, Conal Elliott  wrote:
> Has anyone implemented pattern-matching & substitution for
> haskell-src-exts?  - Conal

I don't know what exactly you are looking for, but I remember banging
together a function-name search script using haskell-src-exts and
'find' last summer, which pattern-matches, looking for use of
particular function-names. Presumably you could change
`functionSearch` to not call `length` but instead replace the matched
function with another function and then write out the modules? Well,
maybe the source will be helpful, maybe not:

import System.Environment (getArgs)
import Language.Haskell.Exts
import qualified Data.Foldable as F (concat)
import Data.Generics.Uniplate.Data
-- import Debug.Trace

main :: IO ()
main = do (func:_) <- getArgs
  args <- fmap lines $ getContents
  mapM_ (checkAndPrint func) args

checkAndPrint :: String -> FilePath -> IO ()
checkAndPrint fn fs = do print fs
 x <- readFile fs
 let exts = F.concat $ readExtensions x
 let parsed = parseFileContentsWithMode
(defaultParseMode { fixities = fixes, extensions = exts }) x
 case parsed of
  ParseFailed _ _ -> (return ())
  ParseOk a -> functionSearch fn a
 return ()

-- the default fixities augmented with everything necessary to parse my corpus
fixes :: Maybe [Fixity]
fixes = Just $ baseFixities ++ infixr_ 0 ["==>"]

functionSearch :: String -> Module -> IO ()
functionSearch fun md = do
  let x = length [ () | Var (UnQual (Ident a)) <- universeBi md, a == fun]
  putStrLn $ "Found " ++ show x ++ " occurences of function " ++ fun

-- 
gwern
http://www.gwern.net

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


Re: [Haskell-cafe] black Wikipedia

2012-01-18 Thread Hans Aberg

On 18 Jan 2012, at 19:32, John Meacham wrote:

> Not to mention ebay, craigslist, etc..
> http://www.techdirt.com/articles/20111005/10082416208/monster-cable-claims-ebay-craigslist-costco-sears-are-rogue-sites.shtml
> 
> when there is no burden of proof for someone to take down a site then
> things get very complicated.
> 
> for instance this package could be enough to get all of hackage taken
> down since astrolabe decided they own timezone data[1].
> 
> http://hackage.haskell.org/package/timezone-olson-0.1.2

There is the Beastie Boys case, where the judge decided copyright protects what 
is creatively unique.

Hans


> in fact, SOPA and PIPA would make hackage pretty impossible to legally
> host. Unless the hackage maintainers want to do exhaustive patent and
> copyright searches on all uploaded code before they allow it to be
> posted.
> 
> [1] 
> http://www.techdirt.com/articles/20111006/11532316235/astrolabe-claims-it-holds-copyright-timezone-data-sues-maintainers-public-timezone-database.shtml
> 
>   John
> 
> 
> 
> On Wed, Jan 18, 2012 at 10:17 AM, Brandon Allbery  wrote:
>> On Wed, Jan 18, 2012 at 13:11, Henning Thielemann
>>  wrote:
>>> 
>>> On Wed, 18 Jan 2012, Andrew Butterfield wrote:
 
 Just add ?banner=none to the url if you really have to read the page
>>> 
>>> 
>>> Maybe the intention was to demonstrate that censorship (in this case
>>> self-censorship) is mostly a problem for average users but not for advanced
>>> users.
>> 
>> 
>> There isn't going to be a disable-javascript or ?banner hack when anyone
>> anywhere can force a website to be redirected to some DOJ page without
>> providing any proof.  (Yes, really.)
>> 
>> --
>> brandon s allbery  allber...@gmail.com
>> wandering unix systems administrator (available) (412) 475-9364 vm/sms
>> 
>> 
>> ___
>> Haskell-Cafe mailing list
>> Haskell-Cafe@haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>> 
> 
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe


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


[Haskell-cafe] Pattern-matching & substitution for haskell-src-exts?

2012-01-18 Thread Conal Elliott
Has anyone implemented pattern-matching & substitution for
haskell-src-exts?  - Conal
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Error in converting List of Lists into PArray ( Parray a )

2012-01-18 Thread mukesh tiwari
Hello all
I am trying to convert List of Lists ( [[(Int , Double )]] ) into PArray (
PArray ( Int , Double )) but getting run time error. This code works fine
and print list of PArray ( Int , Double ) but when i put print $ P.fromList
( map P.fromList c ) then i am getting runtime error. It says "Main:
Data/Array/Parallel/PArray/PDataInstances.hs:337:10-30: No instance nor
default method for class operation
Data.Array.Parallel.PArray.PData.fromListPR". Could some one please tell me
how to resolve this issue.
Thank you


--import ParallelMat
import Data.List
import System.Environment
import Data.Array.Parallel
import qualified Data.Array.Parallel.PArray as P


processMatrix :: [ [ Double ] ] -> [ [ Double ] ] -> [ ( [ ( Int , Double )
] , [ ( Int , Double ) ]) ]
processMatrix [] [] = []
processMatrix ( x : xs ) ( y : ys )
  | ( all ( == 0 ) x )  Prelude.|| (  all ( == 0 ) y ) = processMatrix xs ys
  | otherwise = ( filter ( \( x , y ) -> y /= 0 ) . zip [ 1..]  $ x ,filter
(  \( x , y ) -> y /= 0 ) . zip [1..] $ y  ) : processMatrix xs ys

main = do
[ first , second ] <- getArgs
a <- readFile first
b <- readFile second
let a' = transpose . tail . map ( map ( read :: String -> Double ) .
words ) . lines $ a
b' = tail . map ( map ( read :: String -> Double ) . words ) .
lines $ b
( c , d )   = unzip $ processMatrix a' b'
print $   (  map P.fromList c )
   --print d

Macintosh-0026bb610428:Haskell mukesh$ ghc --make  -Odph -fdph-par  Main.hs
[1 of 1] Compiling Main ( Main.hs, Main.o )
Linking Main ...
Macintosh-0026bb610428:Haskell mukesh$ ./Main  A.in A.in
[fromList [(1,1.0),(6,1.0)],fromList
[(4,11.0),(9,11.0)],fromList [(1,4.0),(4,2.0),(6,4.0),(9,2.0)]]

Putting print $ P.fromList ( map P.fromList c )

Macintosh-0026bb610428:Haskell mukesh$ ghc --make  -Odph -fdph-par  Main.hs
[1 of 1] Compiling Main ( Main.hs, Main.o )
Linking Main ...
Macintosh-0026bb610428:Haskell mukesh$ ./Main  A.in A.in
Main: Data/Array/Parallel/PArray/PDataInstances.hs:337:10-30: No instance
nor default method for class operation
Data.Array.Parallel.PArray.PData.fromListPR

Input file A.in
10 10
1 2 3 0 0 0 0 0 0 4
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 1 2 11 2
0 1 2 0 0 0 0 0 0 0
1 2 3 0 0 0 0 0 0 4
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 1 2 11 2
0 1 2 0 0 0 0 0 0 0
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] black Wikipedia (Was: PhD program at Portland State accepting applications)

2012-01-18 Thread Tom Murphy
On 1/18/12, MigMit  wrote:
[..]
> (it really is a JavaScript trick).


In the interest of Wikipedia-style fact-citation, here's a quote from Wikipedia:
"During the blackout, Wikipedia is accessible on mobile devices and
smart phones. You can also view Wikipedia normally by disabling
JavaScript in your browser, as explained on this Technical FAQ page.
Our purpose here isn't to make it completely impossible for people to
read Wikipedia, and it's okay for you to circumvent the blackout. We
just want to make sure you see our message. "
(Source: http://en.wikipedia.org/wiki/Wikipedia:SOPA_initiative/Learn_more)

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


Re: [Haskell-cafe] black Wikipedia

2012-01-18 Thread John Meacham
Not to mention ebay, craigslist, etc..
http://www.techdirt.com/articles/20111005/10082416208/monster-cable-claims-ebay-craigslist-costco-sears-are-rogue-sites.shtml

when there is no burden of proof for someone to take down a site then
things get very complicated.

for instance this package could be enough to get all of hackage taken
down since astrolabe decided they own timezone data[1].

http://hackage.haskell.org/package/timezone-olson-0.1.2

in fact, SOPA and PIPA would make hackage pretty impossible to legally
host. Unless the hackage maintainers want to do exhaustive patent and
copyright searches on all uploaded code before they allow it to be
posted.

[1] 
http://www.techdirt.com/articles/20111006/11532316235/astrolabe-claims-it-holds-copyright-timezone-data-sues-maintainers-public-timezone-database.shtml

   John



On Wed, Jan 18, 2012 at 10:17 AM, Brandon Allbery  wrote:
> On Wed, Jan 18, 2012 at 13:11, Henning Thielemann
>  wrote:
>>
>> On Wed, 18 Jan 2012, Andrew Butterfield wrote:
>>>
>>> Just add ?banner=none to the url if you really have to read the page
>>
>>
>> Maybe the intention was to demonstrate that censorship (in this case
>> self-censorship) is mostly a problem for average users but not for advanced
>> users.
>
>
> There isn't going to be a disable-javascript or ?banner hack when anyone
> anywhere can force a website to be redirected to some DOJ page without
> providing any proof.  (Yes, really.)
>
> --
> brandon s allbery                                      allber...@gmail.com
> wandering unix systems administrator (available)     (412) 475-9364 vm/sms
>
>
> ___
> 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] black Wikipedia

2012-01-18 Thread Brandon Allbery
On Wed, Jan 18, 2012 at 13:11, Henning Thielemann <
lemm...@henning-thielemann.de> wrote:

> On Wed, 18 Jan 2012, Andrew Butterfield wrote:
>
>> Just add ?banner=none to the url if you really have to read the page
>>
>
> Maybe the intention was to demonstrate that censorship (in this case
> self-censorship) is mostly a problem for average users but not for advanced
> users.
>

There isn't going to be a disable-javascript or ?banner hack when anyone
anywhere can force a website to be redirected to some DOJ page without
providing any proof.  (Yes, really.)

-- 
brandon s allbery  allber...@gmail.com
wandering unix systems administrator (available) (412) 475-9364 vm/sms
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] black Wikipedia

2012-01-18 Thread Henning Thielemann


On Wed, 18 Jan 2012, Andrew Butterfield wrote:


Just add ?banner=none to the url if you really have to read the page


Maybe the intention was to demonstrate that censorship (in this case 
self-censorship) is mostly a problem for average users but not for 
advanced users.


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


Re: [Haskell-cafe] black Wikipedia (Was: PhD program at Portland State accepting applications)

2012-01-18 Thread Hans Aberg
On 18 Jan 2012, at 18:49, Andrew Butterfield wrote:

> Just add ?banner=none to the url if you really have to read the page

Or stop the loading before the banner comes up.

Hans


> On 18 Jan 2012, at 17:37, Henning Thielemann wrote:
> 
>> 
>> On Wed, 18 Jan 2012, Nathan Collins wrote:
>> 
>>> - Portland is a very popular US city, known for beer, bikes, music,
>>> and street food:
>>> 
>>> http://en.wikipedia.org/wiki/Portland_Oregon (wikipedia is blacked out 
>>> today)
>> 
>> Maybe it is only a JavaScript trick. In Firefox (with JavaScript) I see the 
>> complete a page before it is overwritten by the protest page. In Konqueror 
>> of KDE 3 (with and without JavaScript) I can read the Wiki pages without 
>> problems. Edit however is really disabled. Sometimes I am glad to have the 
>> old technology available. :-)



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


Re: [Haskell-cafe] black Wikipedia (Was: PhD program at Portland State accepting applications)

2012-01-18 Thread Andrew Butterfield
Just add ?banner=none to the url if you really have to read the page

On 18 Jan 2012, at 17:37, Henning Thielemann wrote:

> 
> On Wed, 18 Jan 2012, Nathan Collins wrote:
> 
>> - Portland is a very popular US city, known for beer, bikes, music,
>> and street food:
>> 
>> http://en.wikipedia.org/wiki/Portland_Oregon (wikipedia is blacked out today)
> 
> Maybe it is only a JavaScript trick. In Firefox (with JavaScript) I see the 
> complete a page before it is overwritten by the protest page. In Konqueror of 
> KDE 3 (with and without JavaScript) I can read the Wiki pages without 
> problems. Edit however is really disabled. Sometimes I am glad to have the 
> old technology available. :-)
> 
> 
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe


Andrew Butterfield Tel: +353-1-896-2517 Fax: +353-1-677-2204
Lero@TCD, Head of Foundations & Methods Research Group
Director of Teaching and Learning - Undergraduate,
School of Computer Science and Statistics,
Room G.39, O'Reilly Institute, Trinity College, University of Dublin
  http://www.scss.tcd.ie/Andrew.Butterfield/



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


Re: [Haskell-cafe] black Wikipedia (Was: PhD program at Portland State accepting applications)

2012-01-18 Thread MigMit

On 18 Jan 2012, at 21:37, Henning Thielemann wrote:

> 
> On Wed, 18 Jan 2012, Nathan Collins wrote:
> 
>> - Portland is a very popular US city, known for beer, bikes, music,
>> and street food:
>> 
>> http://en.wikipedia.org/wiki/Portland_Oregon (wikipedia is blacked out today)
> 
> Maybe it is only a JavaScript trick. In Firefox (with JavaScript) I see the 
> complete a page before it is overwritten by the protest page. In Konqueror of 
> KDE 3 (with and without JavaScript) I can read the Wiki pages without 
> problems. Edit however is really disabled. Sometimes I am glad to have the 
> old technology available. :-)

Well, I must admit, they succeeded in making me install AdBlock - just to block 
this banner (it really is a JavaScript trick).
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] black Wikipedia (Was: PhD program at Portland State accepting applications)

2012-01-18 Thread Brandon Allbery
On Wed, Jan 18, 2012 at 12:37, Henning Thielemann <
lemm...@henning-thielemann.de> wrote:

> On Wed, 18 Jan 2012, Nathan Collins wrote:
>
>> - Portland is a very popular US city, known for beer, bikes, music,
>> and street food:
>>
>> http://en.wikipedia.org/wiki/**Portland_Oregon(wikipedia
>>  is blacked out today)
>>
>
> Maybe it is only a JavaScript trick. In Firefox (with JavaScript) I see
> the complete a page before


Yes, it's being done in JavaScript so people who need to can get around it;
also, the mobile site is working normally.

-- 
brandon s allbery  allber...@gmail.com
wandering unix systems administrator (available) (412) 475-9364 vm/sms
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] black Wikipedia (Was: PhD program at Portland State accepting applications)

2012-01-18 Thread Henning Thielemann


On Wed, 18 Jan 2012, Nathan Collins wrote:


- Portland is a very popular US city, known for beer, bikes, music,
and street food:

http://en.wikipedia.org/wiki/Portland_Oregon (wikipedia is blacked out today)


Maybe it is only a JavaScript trick. In Firefox (with JavaScript) I see 
the complete a page before it is overwritten by the protest page. In 
Konqueror of KDE 3 (with and without JavaScript) I can read the Wiki pages 
without problems. Edit however is really disabled. Sometimes I am glad to 
have the old technology available. :-)



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


Re: [Haskell-cafe] Monad-control rant

2012-01-18 Thread Brandon Allbery
On Wed, Jan 18, 2012 at 03:47, Mikhail Vorozhtsov <
mikhail.vorozht...@gmail.com> wrote:

> On 01/18/2012 01:52 AM, Brandon Allbery wrote:
>
>> On Tue, Jan 17, 2012 at 06:29, Mikhail Vorozhtsov
>> > >
>> wrote:
>>I wouldn't be too optimistic about convincing GHC HQ. Even making
>>Applicative a superclass of Monad can make Haskell98 nazis come
>>after you in ninja suits.
>>
>> What?!  The only significant complaint I've seen here is that the
>> necessary language support for doing so without breaking more or less
>> every Haskell program currently in existence is difficult to achieve.
>>
> This is a /big/ exaggeration. What libraries exactly are going to be
> broken?


One of the big reasons the Haskell Platform release got delayed for so long
is a similar breaking change (making the haskell98 package incompatible
with base), which left a bunch of required libraries unable to build; it
took quite a while for all of them to get updated.  I expect the same thing
to happen with the Functor, Applicative => Monad change.

-- 
brandon s allbery  allber...@gmail.com
wandering unix systems administrator (available) (412) 475-9364 vm/sms
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] PhD program at Portland State accepting applications for Fall 2012

2012-01-18 Thread Nathan Collins
Hi,

Portland State University has a lot going on in functional
programming.  The Fall 2012 PhD program application deadline is March
1 for US students and February 1 for international students:

http://cs.pdx.edu/programs/admissions

FP related work at Portland:

- Tim Sheard is working on the Trellys project: design and
implementation (in Haskell) of a "practical" dependently typed
programming language.  Joint project with Aaron Stump at UIowa and
Stephanie Weirich at UPenn.  Here "practical" means intended for
programming more than for theorem proving.  Supports theorem proving,
but also logically dubious features like general recursion and Type in
Type.  The key design issue is the interplay between safe and unsafe
features.  Project repo:

https://code.google.com/p/trellys/

- Andrew Tolmach, Mark Jones, and James Hook are working on HASP:
design and implementation (in Haskell) of a functional programming
language for high-assurance systems programming.  Project page:

http://hasp.cs.pdx.edu/

- Sergio Antoy is working on narrowing in functional logic programming
and the Curry FLP language.  Intro to functional logic programming:

http://web.cecs.pdx.edu/~antoy/homepage/publications/cacm/paper.pdf

PAKCS Curry implementation:

http://www.informatik.uni-kiel.de/~pakcs/

- Arthur Peters, a student of Sergio’s, is working on a new
implementation of Curry based on a simplified graph rewriting model of
functional logic computation. A paper about it and the prototype
implementation are available at:

http://web.cecs.pdx.edu/~amp4/vialois

- Andrew Black is a co-author on a recent paper on Haskell for the Cloud:

https://research.microsoft.com/en-us/um/people/simonpj/papers/parallel/

Other FP resources in Portland:

- Galois, located a half mile from the computer science department,
hosts many "Tech Talks", open to the public:

http://corp.galois.com/blog/

- Functional programming study group:

http://pdxfunc.org/

Living in Portland:

- Portland is a very popular US city, known for beer, bikes, music,
and street food:

http://en.wikipedia.org/wiki/Portland_Oregon (wikipedia is blacked out today)

Cheers,

-nathan (PhD student in programming languages)

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


Re: [Haskell-cafe] Encouraging performance with ghc 7.4

2012-01-18 Thread Eugene Kirpichov
I got even more encouraging results on another input - 5 vs 7 seconds:

=== GHC 7.4.0 ==
jkff@jkff-laptop ~/projects/logs/... $ tplot -if lat.trace -dk 'within[.]
duration quantile 10 0.25,0.5,0.75,0.9,0.95' -o lat3.png +RTS -s
   2,809,230,872 bytes allocated in the heap
 358,393,440 bytes copied during GC
  42,478,364 bytes maximum residency (68 sample(s))
   1,833,848 bytes maximum slop
 113 MB total memory in use (0 MB lost due to fragmentation)

Tot time (elapsed)  Avg pause  Max pause
  Gen  0  4740 colls, 0 par0.39s0.40s 0.0001s0.0005s
  Gen  168 colls, 0 par0.42s0.48s 0.0071s0.1157s

  INITtime0.00s  (  0.00s elapsed)
  MUT time3.76s  (  4.01s elapsed)
  GC  time0.82s  (  0.88s elapsed)
  EXITtime0.00s  (  0.00s elapsed)
  Total   time4.59s  (  4.89s elapsed)

  %GC time  17.8%  (18.0% elapsed)

  Alloc rate744,774,183 bytes per MUT second

  Productivity  82.2% of total user, 77.2% of total elapsed

 GHC 7.0.4 ===
jkff@jkff-laptop ~/projects/logs/... $ tplot -if lat.trace -dk 'within[.]
duration quantile 10 0.25,0.5,0.75,0.9,0.95' -o lat3.png +RTS -s
tplot -if lat.trace -dk within[.] duration quantile 10
0.25,0.5,0.75,0.9,0.95 -o lat3.png +RTS -s
   4,024,048,244 bytes allocated in the heap
 419,997,300 bytes copied during GC
  44,546,920 bytes maximum residency (70 sample(s))
   1,840,208 bytes maximum slop
 113 MB total memory in use (0 MB lost due to fragmentation)

  Generation 0:  6995 collections, 0 parallel,  0.63s,  0.64s elapsed
  Generation 1:70 collections, 0 parallel,  0.39s,  0.43s elapsed

  INIT  time0.01s  (  0.00s elapsed)
  MUT   time5.96s  (  6.17s elapsed)
  GCtime1.02s  (  1.08s elapsed)
  EXIT  time0.00s  (  0.00s elapsed)
  Total time6.99s  (  7.24s elapsed)

  %GC time  14.6%  (14.9% elapsed)

  Alloc rate674,478,767 bytes per MUT second

  Productivity  85.3% of total user, 82.3% of total elapsed


On Wed, Jan 18, 2012 at 8:22 PM, Eugene Kirpichov wrote:

> Hi cafe,
>
> Just wanted to inform you that I've been benchmarking my compute-intensive
> stuff on ghc 7.0.4 vs 7.4.0, and 7.4.0 gave a large speedup - one program
> that took 2.9s on a particular input is now taking 2.2s. This result is
> repeatable.
>
> So I encourage people to try out GHC 7.4.0. Some stuff may stop compiling
> (I had to do 3 basically one-line fixes in 3 packages before I got mine to
> compile), but I didn't encounter other problems.
>
> Below is +RTS -s of two runs: one compiled with ghc 7.4.0 and another with
> 7.0.4.
>
> I can make a more detailed comparison if it's useful and if someone tells
> me how - I thought about including +RTS -p, but Simon Marlow wrote recently
> that it has started giving meaningful results only in 7.4, so comparison
> with 7.0.4 would be unfair.
>
> However in this case I'm sure that the program is heavily compute-bound by
> the following two functions (because it's always compute-bound by them):
> 1)
> https://github.com/jkff/timeplot/blob/master/Tools/TimePlot/Plots.hs#L226
> 2) https://github.com/jkff/timeplot/blob/master/Tools/TimePlot/Conf.hs -
> localToUTC and strptime.
>
> jkff@jkff-laptop ~/projects/logs/... $ tplot -if e.trace -dk 'within[.]
> cumsum 10' -o e.png +RTS -s
> tplot -if e.trace -dk within[.] cumsum 10 -o e.png +RTS -s
>2,751,756,296 bytes allocated in the heap
>  135,129,112 bytes copied during GC
>   33,149,720 bytes maximum residency (22 sample(s))
>1,755,868 bytes maximum slop
>   56 MB total memory in use (0 MB lost due to fragmentation)
>
>   Generation 0:  4994 collections, 0 parallel,  0.22s,  0.23s elapsed
>   Generation 1:22 collections, 0 parallel,  0.08s,  0.09s elapsed
>
>   INIT  time0.01s  (  0.00s elapsed)
>   MUT   time2.61s  (  2.91s elapsed)
>   GCtime0.30s  (  0.32s elapsed)
>   EXIT  time0.00s  (  0.00s elapsed)
>   Total time2.91s  (  3.22s elapsed)
>
>   %GC time  10.1%  (9.8% elapsed)
>
>   Alloc rate1,051,262,083 bytes per MUT second
>
>   Productivity  89.6% of total user, 80.9% of total elapsed
>
> jkff@jkff-laptop ~/projects/logs/... $ tplot -if e.trace -dk 'within[.]
> cumsum 10' -o e.png +RTS -s
>2,161,811,620 bytes allocated in the heap
>  107,589,660 bytes copied during GC
>   34,799,400 bytes maximum residency (22 sample(s))
>1,721,152 bytes maximum slop
>   58 MB total memory in use (0 MB lost due to fragmentation)
>
> Tot time (elapsed)  Avg pause  Max
> pause
>   Gen  0  3899 colls, 0 par0.13s0.14s 0.s
>  0.0003s
>   Gen  122 colls, 0 par0.08s0.09s 0.0043s
>  0.0482s
>
>   INITtime0.00s  (  0.00s elapsed)
>   MUT time2.03s  (  2.28s elapsed)
>

[Haskell-cafe] Encouraging performance with ghc 7.4

2012-01-18 Thread Eugene Kirpichov
Hi cafe,

Just wanted to inform you that I've been benchmarking my compute-intensive
stuff on ghc 7.0.4 vs 7.4.0, and 7.4.0 gave a large speedup - one program
that took 2.9s on a particular input is now taking 2.2s. This result is
repeatable.

So I encourage people to try out GHC 7.4.0. Some stuff may stop compiling
(I had to do 3 basically one-line fixes in 3 packages before I got mine to
compile), but I didn't encounter other problems.

Below is +RTS -s of two runs: one compiled with ghc 7.4.0 and another with
7.0.4.

I can make a more detailed comparison if it's useful and if someone tells
me how - I thought about including +RTS -p, but Simon Marlow wrote recently
that it has started giving meaningful results only in 7.4, so comparison
with 7.0.4 would be unfair.

However in this case I'm sure that the program is heavily compute-bound by
the following two functions (because it's always compute-bound by them):
1) https://github.com/jkff/timeplot/blob/master/Tools/TimePlot/Plots.hs#L226
2) https://github.com/jkff/timeplot/blob/master/Tools/TimePlot/Conf.hs -
localToUTC and strptime.

jkff@jkff-laptop ~/projects/logs/... $ tplot -if e.trace -dk 'within[.]
cumsum 10' -o e.png +RTS -s
tplot -if e.trace -dk within[.] cumsum 10 -o e.png +RTS -s
   2,751,756,296 bytes allocated in the heap
 135,129,112 bytes copied during GC
  33,149,720 bytes maximum residency (22 sample(s))
   1,755,868 bytes maximum slop
  56 MB total memory in use (0 MB lost due to fragmentation)

  Generation 0:  4994 collections, 0 parallel,  0.22s,  0.23s elapsed
  Generation 1:22 collections, 0 parallel,  0.08s,  0.09s elapsed

  INIT  time0.01s  (  0.00s elapsed)
  MUT   time2.61s  (  2.91s elapsed)
  GCtime0.30s  (  0.32s elapsed)
  EXIT  time0.00s  (  0.00s elapsed)
  Total time2.91s  (  3.22s elapsed)

  %GC time  10.1%  (9.8% elapsed)

  Alloc rate1,051,262,083 bytes per MUT second

  Productivity  89.6% of total user, 80.9% of total elapsed

jkff@jkff-laptop ~/projects/logs/... $ tplot -if e.trace -dk 'within[.]
cumsum 10' -o e.png +RTS -s
   2,161,811,620 bytes allocated in the heap
 107,589,660 bytes copied during GC
  34,799,400 bytes maximum residency (22 sample(s))
   1,721,152 bytes maximum slop
  58 MB total memory in use (0 MB lost due to fragmentation)

Tot time (elapsed)  Avg pause  Max pause
  Gen  0  3899 colls, 0 par0.13s0.14s 0.s0.0003s
  Gen  122 colls, 0 par0.08s0.09s 0.0043s0.0482s

  INITtime0.00s  (  0.00s elapsed)
  MUT time2.03s  (  2.28s elapsed)
  GC  time0.21s  (  0.23s elapsed)
  EXITtime0.00s  (  0.00s elapsed)
  Total   time2.26s  (  2.51s elapsed)

  %GC time   9.3%  (9.1% elapsed)

  Alloc rate1,056,397,390 bytes per MUT second

  Productivity  90.7% of total user, 81.5% of total elapsed


-- 
Eugene Kirpichov
Principal Engineer, Mirantis Inc. http://www.mirantis.com/
Editor, http://fprog.ru/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Monad-control rant

2012-01-18 Thread Edward Z. Yang
Excerpts from Mikhail Vorozhtsov's message of Wed Jan 18 08:47:37 -0500 2012:
> > Well, that's the kind of language we live in.  The denotation of our 
> > language
> > always permits for bottom values, and it's not a terribly far jump from 
> > there
> > to undefined and error "foo".  I don't consider the use of these facilities
> > to be a trap door.
> Non-termination is a bug (when termination is expected) and I wish that 
> `undefined` and `error` would be interpreted as bugs too (when a value 
> is expected). Putting asynchronous exceptions aside, in some situations 
> it might be useful to recover from bugs, but they should not be treated 
> like /errors/, something that is expected to happen. At least I like to 
> think this way when `error`s meet monads. For example, what is the 
> meaning of `error` in this piece:
> 
> nasty ∷ Monad μ ⇒ μ ()
> nasty = error "FOO" >> return ()
> 
> runIdentity nasty ~> () -- error is not necessarily a left zero!
> runIdentity $ runMaybeT nasty ~> error
> 
> It's just slipping through abstraction and doing what it wants.

I can't argue with "error should be used sparingly, and usually in cases
where there is an indication of developer error, rather than user error."
It's good, sound advice.

But I also believe that you can't use this as justification to stick your
head in the sand, and pretend bottoms don't exist (regardless of whether or
not we'rd talking about asynchronous exceptions.)  The reason is that
understanding how code behaves in the presence of bottoms tells you
some very important information about its strictness/laziness, and this
information is very important for managing the time and space usage of your 
code.

The identity monad for which error "FOO" is a left zero is a legitimate monad:
it's the strict identity monad (also known as the 'Eval' monad.)  Treatment
of bottom is a part of your abstraction!

(I previously claimed that we could always use undefined :: m a as a left zero,
I now stand corrected: this statement only holds for 'strict' monads, a moniker 
which
describes IO, STM and ST, and any monads based on them. Indeed, I'll stick my 
neck
out and claim any monad which can witness bottoms must be strict.)

> What is the "usefulness" here? Is being precise not enough?
> 
> contract ∷ MonadZero μ ⇒ (α → Bool) → (β → Bool) → (α → μ β) → α → μ β
> contract pre post body x = do
>unless (pre x) mzero
>y ← body x
>unless (post y) mzero
>return y
> 
> Why would I drag `mplus` here? `contract` is useful regardless of 
> whether you have a choice operation or not.

Point conceded. (Though, I probably would have used 'error' for 'contract',
since violation of pre/post-conditions is almost certainly due to developer
error.)

> >  - We only have three magical base monads: IO, ST and STM.  In
> >  ST we do not have any appreciable control over traditional IO 
> > exceptions,
> >  so the discussion there is strictly limited to pure mechanisms of 
> > failure.
> Why is this distinction necessary? Why are you trying to tie exception 
> handling idioms to the particular implementation in RTS?

The distinction I'm trying to make is between code that is pure (and cannot
witness bottoms), and code that is impure, and *can* witness bottoms.
It is true that I need language/RTS support to do the latter, but I'm
in no way tying myself to a particular implementation of an RTS: the semantics
are independent (and indeed are implemented in all of the other Haskell 
implementations.)

> >  - Finalizing "mutable state" is a very limited use-case; unlike C++
> >  we can't deallocate the state, unlike IO there are no external scarce
> >  resources, so the only thing you really might see is rolling back the
> >  state to some previous version, in which case you really ought not to
> >  be using ST for that purpose.
> Maybe. But you can. And who said that we should consider only IO, ST and 
> STM? Maybe it is a mysterious stateful monad X keeping tabs on 
> god-knows-what. Also, even though we do not deallocate memory directly, 
> having a reference to some gigantic data structure by mistake could hurt 
> too.

Claim: such a mysterious monad would have to be backed by IO/ST. (In the
case of a pure State monad, once we exit the monad all of that gets garbage
collected.)

> > You are free to create another interface that supports "unrecoverable"
> > exceptions, and to supply appropriate semantics for this more complicated
> > interface. However, I don't think it's appropriate to claim this interface
> > is appropriate for IO style exceptions, which are (and users expect) to 
> > always
> > be recoverable.
> Why exactly not? I think that everything useful written with this 
> assumption in mind can be rewritten to use `finally`, just like I did 
> with `withMVar` (the version in `base` actually uses `onException`).

I think the argument here is similar to your argument: saying that all
IO exceptions are recoverable is more precis

[Haskell-cafe] Lifting IO (IO a) -> IO a to m (m a) -> m a with monad-control

2012-01-18 Thread Edward Z. Yang
Hello folks,

I was curious whether or not it is possible to lift an arbitrary
IO (IO a) -> IO a function to MonadBaseControl IO m => m (m a) -> m a.
That is, implement a function:

liftJoin :: MonadBaseControl mb m => (mb (mb (StM m a)) -> mb (StM m a)) -> m 
(m a) -> m a

The difficulty seems to be that we can't extract the resumable state from the 
inner
base monad action.

If this is not possible, is there a suitable strengthening of MonadBaseControl
that achieves this effect?

Cheers,
Edward

[1] 
http://hackage.haskell.org/packages/archive/monad-control/latest/doc/html/Control-Monad-Trans-Control.html

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


Re: [Haskell-cafe] Need advice: Haskell in Web Client

2012-01-18 Thread Johannes Waldmann
dokondr  gmail.com> writes:

> It would be great if I could write Web client code in pure Haskell [...]

not exactly Haskell, but you may want to have a look at OPA http://opalang.org/ 

the idea is that you write all of the application in one 
(statically typed, functional) language
and the framework takes care of distributing the code to server and client
(and on the client, it shows up as JavaScript)

J.W.



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


Re: [Haskell-cafe] strict, lazy, non-strict, eager

2012-01-18 Thread Jon Fairbairn
(I’m somewhat dismayed that the error in my preliminary remark
has overshadowed the point of my original message — which was
about the distinction between lazy and non-strict. However…)

David Barbour  writes:
> Full beta-reduction is certainly not strict

What, precisely, do you mean by “full beta-reduction”?

> but also doesn't guarantee terminate even where it is possible
> (i.e. it might indefinitely unfold a value without making
> progress).

That sounds very much to me like being overly strict.

> I don't think there is much you can say about non-strictness
> and termination.

I would hope there would be, as that (or at least productivity)
is the point of saying that Haskell has non-strict semantics.

> On Mon, Jan 9, 2012 at 3:01 AM,
> Jon Fairbairn  wrote:
>
>> Perhaps what I should have said to be almost as succinct but
>> this time accurate is “non-strict semantics requires that the
>> evaluation strategy terminate if there is any evaluation
>> strategy that terminates”?

-- 
Jón Fairbairn jon.fairba...@cl.cam.ac.uk


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


Re: [Haskell-cafe] Monad-control rant

2012-01-18 Thread Mikhail Vorozhtsov

On 01/18/2012 02:45 AM, Edward Z. Yang wrote:

Excerpts from Mikhail Vorozhtsov's message of Tue Jan 17 06:29:12 -0500 2012:

The vehicle of implementation here is kind of important.  If they are 
implemented
as asynchronous exceptions, I can in fact still throw in this universe: I just
attempt to execute the equivalent of 'undefined :: m a'.  Since asynchronous 
exceptions
can always be thrown from pure code, I can /always/ do this, no matter how you
lock down the types.  Indeed, I think implementing this functionality on 
asynchronous
exceptions is a good idea, because it lets you handle nonterminating pure code 
nicely,
and allows you to bail out even when you're not doing monadic execution.

I don't like there this is going. Arguments like this destroy the whole
point of having abstract interfaces. I took liftBase from you and now
you are picking lock on my back door with raise#. I can deny this by
hiding the constructor of the asynchronous exception I use for passing
`lavel` in my implementation. But seriously. Next thing I know you will
be sneaking down my chimney with `unsafePerformIO` in your hands. It is
no question that the type system cannot protect us from all the tricks
RTS provides, but we still can rely on conventions of use.

Personally I'm not a fan of exceptions in pure code. If something can
fail it should be reflected in its type, otherwise I consider it a bug.
The only scenario I'm comfortable with is using asynchronous exceptions
to interrupt some number crunching.


Well, that's the kind of language we live in.  The denotation of our language
always permits for bottom values, and it's not a terribly far jump from there
to undefined and error "foo".  I don't consider the use of these facilities
to be a trap door.
Non-termination is a bug (when termination is expected) and I wish that 
`undefined` and `error` would be interpreted as bugs too (when a value 
is expected). Putting asynchronous exceptions aside, in some situations 
it might be useful to recover from bugs, but they should not be treated 
like /errors/, something that is expected to happen. At least I like to 
think this way when `error`s meet monads. For example, what is the 
meaning of `error` in this piece:


nasty ∷ Monad μ ⇒ μ ()
nasty = error "FOO" >> return ()

runIdentity nasty ~> () -- error is not necessarily a left zero!
runIdentity $ runMaybeT nasty ~> error

It's just slipping through abstraction and doing what it wants.


Hm, are you against splitting MonadPlus too?


The problem with MonadPlus is not the fact that it has mplus/mzero, but that
there are in fact multiple disjoint sets of laws that instances obey.  The only
other point of order is that MonadZero is a useful abstraction by itself,
and that's the point of debate.

What is the "usefulness" here? Is being precise not enough?

contract ∷ MonadZero μ ⇒ (α → Bool) → (β → Bool) → (α → μ β) → α → μ β
contract pre post body x = do
  unless (pre x) mzero
  y ← body x
  unless (post y) mzero
  return y

Why would I drag `mplus` here? `contract` is useful regardless of 
whether you have a choice operation or not.





You are forgetting about `ST`. For example, in `ErrorT SomeException ST`
finalizers /do/ make sense. It's not about having IO, it is about having
some sort of state(fulness).


Conceded. Although there are several responses:

 - We only have three magical base monads: IO, ST and STM.  In
 ST we do not have any appreciable control over traditional IO exceptions,
 so the discussion there is strictly limited to pure mechanisms of failure.
Why is this distinction necessary? Why are you trying to tie exception 
handling idioms to the particular implementation in RTS?


 - Finalizing "mutable state" is a very limited use-case; unlike C++
 we can't deallocate the state, unlike IO there are no external scarce
 resources, so the only thing you really might see is rolling back the
 state to some previous version, in which case you really ought not to
 be using ST for that purpose.
Maybe. But you can. And who said that we should consider only IO, ST and 
STM? Maybe it is a mysterious stateful monad X keeping tabs on 
god-knows-what. Also, even though we do not deallocate memory directly, 
having a reference to some gigantic data structure by mistake could hurt 
too.



I think that's incoherent. To draw out your MaybeT IO example to its logical 
conclusion,
you've just created two types of zeros, only one of which interacts with 
'recover' but
both of which interact with 'finally'. Down this inconsistency lies madness!  
Really,
we'd like 'recover' to handle Nothing's: and actually we can: introduce a 
distinguished
SomeException value that corresponds to nothings, and setup abort to transform 
that not
into an IO exception but a pure Nothing value. Then 'finally' as written works.

I see no inconsistency here. I just give implementers an opportunity to
decide which failures are recoverable (with `recover`) and which are
no

Re: [Haskell-cafe] implementing a text editor swap file

2012-01-18 Thread Gracjan Polak
Erik de Castro Lopo  mega-nerd.com> writes:

> 
> Matthew Farkas-Dyck wrote:
> 
> > http://hackage.haskell.org/package/bytestring-mmap
> 
> Since he's editing text, its a pity there isn't a text-mmap
> package .

Well, this one:

http://hackage.haskell.org/package/mmap

works not only for Text but also for Windows and Macs.

-- 
Gracjan




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


Re: [Haskell-cafe] haskell tcp server

2012-01-18 Thread Nicolas Trangez
On Thu, 2012-01-19 at 13:12 +, Alexander V Vershilov wrote:
> Hello.
> 
> I'm interested if there exists some library like warp but only for tcp.
> Or maybe some web page with skeleton for such server or with some
> variants, eg. concurent/single-threaded. I know that each service can
> have it's specific properties and realization, but there are many common
> things left.
> 
> If it matter — my main task is to create server for protobuf protocol,
> maybe for such a task there are already created solutions.

You could take a look at
https://github.com/jamwt/haskell-scalable-server

Nicolas


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


[Haskell-cafe] haskell tcp server

2012-01-18 Thread Alexander V Vershilov
Hello.

I'm interested if there exists some library like warp but only for tcp.
Or maybe some web page with skeleton for such server or with some
variants, eg. concurent/single-threaded. I know that each service can
have it's specific properties and realization, but there are many common
things left.

If it matter — my main task is to create server for protobuf protocol,
maybe for such a task there are already created solutions.

--
Alexander V Vershilov.


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


Re: [Haskell-cafe] Monad-control rant

2012-01-18 Thread Mikhail Vorozhtsov

On 01/18/2012 01:52 AM, Brandon Allbery wrote:

On Tue, Jan 17, 2012 at 06:29, Mikhail Vorozhtsov
mailto:mikhail.vorozht...@gmail.com>> wrote:

I wouldn't be too optimistic about convincing GHC HQ. Even making
Applicative a superclass of Monad can make Haskell98 nazis come
after you in ninja suits.


What?!  The only significant complaint I've seen here is that the
necessary language support for doing so without breaking more or less
every Haskell program currently in existence is difficult to achieve.
This is a /big/ exaggeration. What libraries exactly are going to be 
broken? Bytestring/Text (and all other data-structures-related libraries 
for that matter)? I don't think so. Network? Wouldn't be surprised if it 
goes without even a single patch. (Atto)Parsec/Binary/Cereal/*-Builder 
or Enumerator? A few type signatures (mainly contexts) and/or instances 
would need to be changed. Transformers? Some instances again. MTL? Looks 
surprisingly good.


I think with some coordinated effort we could switch the core libraries 
withing a week. On the client side of things I expect the change to go 
unnoticed by most people: by now virtually every custom monad has an 
Applicative instance. Personally, I wouldn't mind being hit by this 
hierarchy transformation, it is totally worth an hour of adjusting type 
contexts in my code (I'm currently maintaining ~17KLOC and I think I 
would need to touch only a handful of places).


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


Re: [Haskell-cafe] Need advice: Haskell in Web Client

2012-01-18 Thread dokondr
On Wed, Jan 18, 2012 at 10:47 AM, John Lenz  wrote:

>
>
> I don't see a great need of developing something like GWT for haskell,
> since we already have good support for all sorts of existing tools that
> span more than just haskell, like extjs, yui, and jqueryui.
>

Haskell makes my work doable in many areas where other PLs will take
enormous efforts and time to  achieve the same result.
It would be great if I could write Web client code in pure Haskell (no
HTML, no DOM, no Ajax, ..) compile it to Javascript and just run it in the
browser and do all GUI and backend communication work. Simple as that.

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