Re: [Haskell-cafe] Problem with HXT `when`

2013-09-25 Thread Vlatko Basic

Hi Albert,

thanks for your answer. It helped in some other issues I have.
I did experiment with parenthesis, but obviously not in the right place.


I found the filterA arrow to do the thing I want, like this:

getRowWithHeading caption =
filterA (deep (hasName th / hasText (==caption) )) /
hasName td 
getChildren


I like to ask you if you might know the answer to the following:

In a structure
   +---XTag a
   |   +---XText A text 1
   |
   +---XText Plain text 1
   |
   +---XTag a
   |   +---XText A text 2
   |
   +---XText Plain text 2
   ...

I must combine A text 1 with Plain text 1, etc., but they are in sequence on 
the same level.


Is it possible, in a simple way, to do it in a single arrow flow?
(Or only outside the arrow by pairing the list items?)

Something like:
  hasName a / getText   (getNextItem???  getText)


I assume not, but I'm still new to Haskell and would like to check.


br,

vlatko

 Original Message  
Subject: Re: [Haskell-cafe] Problem with HXT `when`
From: Albert Y. C. Lai tre...@vex.net
To: haskell-cafe@haskell.org
Date: 25.09.2013 03:22


On 13-09-21 05:13 AM, Vlatko Basic wrote:

I'd like to extract A texts from row with header Caption, and have
come up with this

runX $ doc
  (deep (hasName tr)   --
filter only TRs
 withTraceLevel 5 traceTree   --
shows correct TR
`when`
  deep (
 hasName th 
-- filter THs with specified text
 getChildren  hasText (==Caption)
  ) -- inner deep
   getChildren  hasName td -- shouldn't here be only
one TR?
   getChildren
   )
   getName  (getChildren  getText)  -- list has TDs
from all three TRs


Operator precedences:
infixr 1
   `when` infixl 9 (default)

Therefore, this expression redundantly parenthesized and systematically indented
to ensure that you are on the same page with the computer is:

runX $
 doc
 
 ( deep (hasName tr)
   
-- begin{conditionally prints but otherwise is arr id}
   ( withTraceLevel 5 traceTree
 `when`
 deep ( hasName th

getChildren

hasText (==Caption)
  ) -- inner deep
   )
-- end{conditionally prints but otherwise is arr id}
   
   getChildren
   
   hasName td
   
   getChildren
 )
 
 ( getName  (getChildren  getText) )

The condition on thCaption/th ends up controlling trace messages only; it is
not used to limit real processing.

when doesn't help even when used correctly: it doesn't ban data. guards and
containing ban data, but you have to put them at the right place, i.e.,
parenthesize correctly.

runX $
 doc
 
 ( deep ( hasName tr
  `containing`
  deep ( hasName th
 
 getChildren
 
 hasText (==Caption)
   )
)
   
   getChildren
   
   hasName td
   
   getChildren
 )
 
 ( getName
   
   (getChildren  getText)
 )

___
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] Hackage 2 switchover imminent

2013-09-25 Thread Duncan Coutts
On 24 September 2013 22:38, Duncan Coutts dun...@well-typed.com wrote:

 For issues with accounts or permissions please contact the
 administrators by email at adm...@hackage.haskell.org

Sorry, that should be: ad...@hackage.haskell.org

Ie singular admin, not plural. I got myself confused because there are
several admins.

-- 
Duncan Coutts, Haskell Consultant
Well-Typed LLP, http://www.well-typed.com/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Haskell Weekly News: Issue 281

2013-09-25 Thread Daniel Santa Cruz
Welcome to issue 281 of the HWN, an issue covering crowd-sourced bits
of information about Haskell from around the web. This issue covers the
week of September 15 to 21, 2013.

Quotes of the Week

   * jmcarthur: weak algebraic structures? ha! i prefer my algebraic
 structures to put up more of a fight.

   * newsham: teach a man to pred and he will pred to zero. teach a man
 to succ and he will succ forever

Top Reddit Stories

   * Edward C++Hands
 Domain: bartoszmilewski.com, Score: 83, Comments: 102
 On Reddit: [1] http://goo.gl/64LLo4
 Original: [2] http://goo.gl/0H0yr7

   * Perfect streaming using `pipes-bytestring`
 Domain: haskellforall.com, Score: 59, Comments: 45
 On Reddit: [3] http://goo.gl/oSlzZP
 Original: [4] http://goo.gl/8xwZjc

   * Adding safe coercions to Haskell
 Domain: joachim-breitner.de, Score: 58, Comments: 23
 On Reddit: [5] http://goo.gl/2vs5M9
 Original: [6] http://goo.gl/n0RYA3

   * Which programming languages do you like besides Haskell, and why?
 Domain: self.haskell, Score: 55, Comments: 104
 On Reddit: [7] http://goo.gl/nzgwJQ
 Original: [8] http://goo.gl/nzgwJQ

   * GHC HEAD: merged checkable minimal complete definitions (#7633)
 Domain: ghc.haskell.org, Score: 48, Comments: 36
 On Reddit: [9] http://goo.gl/VoZVYL
 Original: [10] http://goo.gl/5F61AX

   * Do companies ever hire someone who has no Haskell experience to be a
 Haskell programmer? If I pursue such a job, how important would a

 Domain: self.haskell, Score: 44, Comments: 50
 On Reddit: [11] http://goo.gl/KA998k
 Original: [12] http://goo.gl/KA998k

   * [Haskell-cafe] PSA: do not install xcode 5 if you are using ghc 7.6
 Domain: haskell.org, Score: 43, Comments: 4
 On Reddit: [13] http://goo.gl/ut6k6p
 Original: [14] http://goo.gl/1G8Syo

   * Model Analysis - The New York Times’ Erik Hinton breaks down a
 Fashion Week special
 Domain: source.mozillaopennews.org, Score: 40, Comments: 4
 On Reddit: [15] http://goo.gl/NdVw6l
 Original: [16] http://goo.gl/bYB8JS

   * Programming reactively with both barrels
 (experiences of Haskell/FRP for mobile games)
 Domain: blog.reactiveprogramming.org, Score: 39, Comments: 7
 On Reddit: [17] http://goo.gl/QXacUo
 Original: [18] http://goo.gl/wLJwt6

   * Why monads have not taken the Common Lisp world by storm [r/lisp]
 Domain: reddit.com, Score: 33, Comments: 14
 On Reddit: [19] http://goo.gl/tZUVWx
 Original: [20] http://goo.gl/w5KHqc

   * 13,000 readers
 Domain: self.haskell, Score: 28, Comments: 11
 On Reddit: [21] http://goo.gl/lTys0R
 Original: [22] http://goo.gl/lTys0R

   * A type for IO actions that do not throw exceptions
 Domain: self.haskell, Score: 25, Comments: 49
 On Reddit: [23] http://goo.gl/Ao8HyB
 Original: [24] http://goo.gl/Ao8HyB

   * ANN: Scotty 0.5.0 Released
 Domain: github.com, Score: 24, Comments: 15
 On Reddit: [25] http://goo.gl/jgGJhO
 Original: [26] http://goo.gl/BejPTF

   * Haskell version freezing
 Domain: blog.docmunch.com, Score: 23, Comments: 8
 On Reddit: [27] http://goo.gl/9LJSjY
 Original: [28] http://goo.gl/Ikd86k

   * PHOAS For Free by Edward Kmett
 Domain: fpcomplete.com, Score: 21, Comments: 8
 On Reddit: [29] http://goo.gl/RDt1BV
 Original: [30] http://goo.gl/o0phN7

   * Cellular Automata, Part III by Edward Kmett
 Domain: fpcomplete.com, Score: 20, Comments: 0
 On Reddit: [31] http://goo.gl/AKCfGw
 Original: [32] http://goo.gl/x7GtH1

   * Translating Haskell programs to Coq [/Gallina] programs
 Domain: github.com, Score: 20, Comments: 2
 On Reddit: [33] http://goo.gl/IQAp3K
 Original: [34] http://goo.gl/qcib77

   * ANN: pipes-csv: a fast, streaming csv parser based on cassava and pipes
 Domain: github.com, Score: 20, Comments: 9
 On Reddit: [35] http://goo.gl/aITtGX
 Original: [36] http://goo.gl/yrzZ7n

Top StackOverflow Questions

   * What does the “Just” syntax mean in Haskell?
 votes: 12, answers: 4
 Read on SO: [37] http://goo.gl/f17UEP

   * How can I understand “:t ((==) *)” in haskell?
 votes: 10, answers: 1
 Read on SO: [38] http://goo.gl/CwyBn4

   * why polymorphism is so costly in haskell(GHC)?
 votes: 10, answers: 3
 Read on SO: [39] http://goo.gl/4MjcbH

   * Break and continue in GHCi debugger without use of breakpoints
 votes: 9, answers: 0
 Read on SO: [40] http://goo.gl/HrtcXZ

   * Why is there no `-XDeriveApplicative` extension?
 votes: 8, answers: 1
 Read on SO: [41] http://goo.gl/4dcRF1

   * Downsides to ScopedTypeVariables
 votes: 7, answers: 2
 Read on SO: [42] http://goo.gl/UjBcsg

   * Haskell design encompassing several monads
 votes: 7, answers: 1
 Read on SO: [43] http://goo.gl/EwWd5d

   * How to correct my OOP tendencies when programming in Haksell
 votes: 7, answers: 3
 Read on SO: [44] 

[Haskell-cafe] Haskell Job Opportunity (Remote Work)

2013-09-25 Thread Benny
Hello,

ShotVibe is an early-stage Israeli startup company in the mobile photo
sharing space. We are looking for an experienced or expert level Haskell
programmer for backend web related projects. The work will be done by you
remotely, using a freelancer model, with the potential for longer term work
in the near future (also remote).

One of the projects we have is a server application that queues messages
that are to be sent to end user mobile phones, and pushes them through the
push notification APIs supplied by Google and Apple. The work needed here
involves some bug fixes, and some new features. This project will likely
eventually be open sourced.

Another project that we need to be written from scratch is a web
application that handles photo uploads and processes them (including
verifying user authentication with our main web backend, image resizing,
and storing images on Amazon S3). This will probably end up only a few
hundred lines of Haskell code, but involves integrating a bunch of stuff
together.

We are also interested in experimenting in using Haskell for some other
areas of our backend where we are currently using Python.

If you are interested you may contact me at: be...@shotvibe.com

Please feel free to forward this email to any friends or acquaintances that
may be interested.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe