On Sat, 27 Oct 2012 00:17:27 +0200, Gwern Branwen wrote:
- "with which popular believe" (popular belief?)
Changed
- "between day and night" (night and day is more idiomatic in English,
isn't it?)
I changed it, although, according to Google, "between day and night" is
used very often as w
It's the Endo monoid.
?> :t ala Endo foldMap -- see newtype package
ala Endo foldMap :: Foldable t => t (a -> a) -> a -> a
?> ala Endo foldMap [(+1), (*2)] 8
17
?> :i ala
ala ::
(Newtype n o, Newtype n' o') =>
(o -> n) -> ((o -> n) -> b -> n') -> b -> o'
-- Defined in Control.Newtype
O
Funny, I was thinking this morning about using something like this to convert
to/from Church numerals:
church n = foldl (.) id . replicate n
unchurch f = f succ 0
I think it's a nice pattern.
Nick
On Friday, October 26, 2012 11:41:18 AM Greg Fitzgerald wrote:
> Hi Haskellers,
>
> I've recent
Iavor's pretty-show package is quite handy for these kind of tasks as well.
Highly recommended: http://hackage.haskell.org/package/pretty-show
Since Iavor package is not tree-centric, it'll probably not generate as
nice output as you can for real tree-like-data. However, since it works on
arbitrar
On Fri, Oct 26, 2012 at 4:51 PM, Henk-Jan van Tuyl wrote:
>
> L.S.,
>
> I thought you might be interested to know, that I have translated one of
> prof. Edsger W. Dijkstra's writings to English[0]. I will submit this
> translation to the E. W. Dijkstra Archive of the University of Texas[1].
Comme
I think Alfredo meant the link to module's haddock which had not been
generated when you sent out the announcement.
Roman
* Ivan Lazar Miljenovic [2012-10-27 07:37:10+1100]
> Which links _aren't_ clickable? If you mean the one to diagrams-contrib,
> since it isn't imported I can't link to that m
sorry for the buggy code
> let parseOrIgnore p s = either (const s) id $ parse p s
> let parseAllOrIgnore = compose . map parseOrIgnore [p1, p2, p3]
> parseAllOrIgnore "abbbcccbbba"
On Fri, Oct 26, 2012 at 2:11 PM, Greg Fitzgerald wrote:
> Hmm, neato. but didn't make life any easier!
>
> Data.
Hmm, neato. but didn't make life any easier!
Data.Monoid> (appEndo . mconcat . map Endo) [(+10), (+20)] 3
33
Data.Monoid> (foldr (.) id) [(+10), (+20)] 3
33
I had hoped for something like:
> mconcat [(+10), (+20)] 3
But I suppose that's nonsense, considering this works:
> mconcat [(++"10"), (
> Thiago Negri writes:
> Can you please show some examples where it might be useful?
> I miss the point.
I guess if he already has a list of functions, Endo won't help. Endo just
lets you treat functions as monoids, so you can foldMap, etc. In that case,
foldr (.) id is pretty idiomatic, a
L.S.,
I thought you might be interested to know, that I have translated one of
prof. Edsger W. Dijkstra's writings to English[0]. I will submit this
translation to the E. W. Dijkstra Archive of the University of Texas[1].
Some of the highlights:
- can submarines swim?
- redefining mathem
Which links _aren't_ clickable? If you mean the one to diagrams-contrib,
since it isn't imported I can't link to that module directly.
One thing I just realised: compared to drawTrees, drawVerticalTree reverses
the direction of sub-trees (in that it isn't just equivalent to rotating it
clockwise 9
Can you please show some examples where it might be useful?
I miss the point.
Thanks,
Thiago.
2012/10/26 John Wiegley :
>> Greg Fitzgerald writes:
>
>> I've recently found myself using the expression: "foldr (.) id" to compose a
>> list (or Foldable) of functions.
>
> You want the Endo monoi
> Greg Fitzgerald writes:
> I've recently found myself using the expression: "foldr (.) id" to compose a
> list (or Foldable) of functions.
You want the Endo monoid:
ghci> appEndo (Endo (+ 10) <> Endo (+ 20)) $ 3
33
John
___
Haskell-C
Hi Haskellers,
I've recently found myself using the expression: "foldr (.) id" to compose
a list (or Foldable) of functions. It's especially useful when I need to
map a function over the list before composing. Does this function, or the
more general "foldr fmap id", defined in a library anywhere
Would this be relevant?
https://github.com/jonsterling/Data.Records
On Fri, Oct 26, 2012 at 11:17 AM, Jon Fairbairn
wrote:
> Twan van Laarhoven writes:
>
> > On 24/10/12 12:08, Jon Fairbairn wrote:
> >>
> >> Is there a convenient way of handling a data structure with lots
> >> of fields of dif
Twan van Laarhoven writes:
> On 24/10/12 12:08, Jon Fairbairn wrote:
>>
>> Is there a convenient way of handling a data structure with lots
>> of fields of different types that may or may not be filled in?
>>
>
> Not sure about convenience, but here is a type safe solution
> with O(log n) lookups
The idea is pretty good, although I suggest you make clickable the
Haddock's link to modules, because I had to navigate the source in order to
find some application
as well as nice tree visualizations :)
Cheers,
A.
On 26 October 2012 14:58, Ivan Lazar Miljenovic
wrote:
> For a project I'm workin
For a project I'm working on, I got sick of writing out trees by hand.
Data.Tree has a drawTree function, but whilst it's better than
nothing, I prefer a more top-down "traditional" approach to drawing
trees.
So I wrote a package to do just that:
http://hackage.haskell.org/package/pretty-tree
(I
Dear all,
next Monday, 29th of October, our monthly Haskell Meeting will take
place at 19h30 at Cafe Puck. Everybody interested in functional
programming is wellcome. Please go to
http://www.haskell-munich.de/dates
for more information and push the button, if you intend to join.
With hope
Hi Paul,
On 25/10/12 16:22, Paul Visschers wrote:
> Hello everyone,
>
> I've been playing around with the data kinds extension to implement
> vectors that have a known length at compile time. Some simple code to
> illustrate:
> [...]
> In this code I have defined a repeat function that works in a
20 matches
Mail list logo