# News aggregator

### ANN: clustering-0.1.0

### Why does GHC immediately think of TemplateHaskell?

[link] [4 comments]

### What to you think about the Fsharp piping operators in prelude.hs

What do you think about the F# pipeline operators in prelude·hs. I think they are very convenient and readable to perform sequential operations. F# has only the |>, but I defined the |>> to represent map and |?> to represent filter.

Example:

-- Fsharp Operators (|>) x f = f x (|>>) x f = map f x (?>>) x f = filter f x > let (|>) x f = f x > > let (|>>) x f = map f x > let (?>>) x f = filter f x > take 3 (reverse (filter even [1..10])) [10,8,6] > [1..10] |> filter even |> reverse |> take 3 [10,8,6] > > [1..10] |>> (^2) |>> (/10) |>> (+100) [100.1,100.4,100.9,101.6,102.5,103.6,104.9,106.4,108.1,110.0] > > [1..10] ?>> even [2,4,6,8,10] > > [1..10] ?>> even |>> (+1) [3,5,7,9,11] > >Other example:

parseCSVcont content = (header, matrix) where header = content |> splitLines |>> splitComma |> head matrix = content |> splitLines |>> splitComma |> tail |>> map readDouble submitted by eniacsparc2xyz[link] [9 comments]

### Created a simple (incomplete) JSON Parser using Applicatives

https://github.com/kevinmeredith/json_parser

If you could please take a look at Model.hs and JsonParser.hs - for my own learning.

submitted by kevin_meredith[link] [comment]

### Douglas M. Auclair (geophf): February 2015 1HaskellADay Problems and Solutions

**February 2015**

- February 27th, 2015: Let's put all our primes in a circle, shall we? http://lpaste.net/121154 Ah, how cute! Today's #haskell problem suggested by @jamestanton @bretthall defines a solution, with some analysis, at http://lpaste.net/121292
- February 26th, 2015: Okay, check this! Today's #haskell problem is as easy as 1, 2, 3! http://lpaste.net/121250 An easy as π solution is posted at http://lpaste.net/121273 ... mmm! π! But is it apple π or ... raspberry π? #couldntresist
- February 25th, 2015: I'd like moccha sprinkles on my double capicua, please. http://lpaste.net/121153 No. Wait. Today's #haskell problem suggested by a tweet from @OnThisDayinMath
- February 24th, 2015: Not satisfied with a simple square-from-square problem @BenVitale takes it up a notch and asks us to cube dat square! http://lpaste.net/121060 We have one solution out of 20k squares posted at http://lpaste.net/121150 : [(39204,39304)]
- February 23rd, 2015: I hereby christen this week a fun-with-numb3rs week, and start us off by learning that 'easierest' is a word, http://lpaste.net/121034, just like 'ginormous.' And the winner is...no, wait! Ladies and gentlemen, we have MULTIPLE winners! http://lpaste.net/121052 Good thing the solution isn't the Lotto No, wait. The problem statement wasn't read carefully by the solution-poster. I blame that wicked, wicked @geophf! Bad geophf! Bad! ;)
- February 20th, 2015: It's a #Borderlands2 Truxican Standoff for you to resolve in today's #haskell problem http://lpaste.net/120819 The solution is simple really: just a projection into a monad category in order to do some monoidal deduction is all! http://lpaste.net/120916
- February 19th, 2015: For today's #haskell problem we learn that 'AEKL' is a word in English http://lpaste.net/120775 (no, it's not, actually) A megalokaryocyte-solution is posted at http://lpaste.net/120816 (now, that's a common word ... NOT! ;)
- February 18th, 2015: Instead of doing today's #haskell problem, let's go ice skating. No, let's do BOTH! http://lpaste.net/120722 Okay, a loquacious solution? garrulous? Yes. Once one cuts through all the attempts, it's a simple solution, too: http://lpaste.net/120873 ... and updated the solution with the monoidal guarantee-by-implication that the result is unique (instead of just hoping it is) #coercivelogic
- February 17th, 2015: For today's #haskell problem we are asked to 'fix' our monetary problems (or the library, at least) http://lpaste.net/120630 Made Data.Monetary.USD a Fractional instance http://lpaste.net/109653 and eliminated floating point creep #haskell #money #precision
- February 16th, 2015: Getting a jump-start on the day with two really, really hard math problems for today's #haskell problem http://lpaste.net/120560 A solution in which we learn a baseball costs a nickel ... IN WHICH CENTURY? http://lpaste.net/120560
- February 13th, 2015: Today's SCARY #haskell problem comes by way of @OnThisDayinMath http://lpaste.net/120422 Tonight's late-night movie, Friday the 13th, part III http://lpaste.net/120466 as the solution to today's #haskell problem.
- February 12th, 2015: Gurer ner gvzrf jura ... yeah. That. http://lpaste.net/120388 Today's #haskell problem, thanks to @KenKenPuzzle The solution shows us that it's INTENSE unscrambling words http://lpaste.net/120407
- February 11th, 2015: Change adds up quickly in today's #haskell problem http://lpaste.net/120320 So, but ... does that mean programming is like ... maths? Nah! http://lpaste.net/120333 A solution to today's #haskell problem
- February 10th, 2015: The price of a letter (or of all letters of the alphabet) http://lpaste.net/120236 is the question for today's haskell problem. In the solution we learn the geophfmeister is down-low on the B.I.G. 323, yo! http://lpaste.net/120294
- February 9th, 2015: 'Oh, no!' ... just another Manic Monday ... AND today's #haskell problem http://lpaste.net/120196 Oh, noes! Mr. Bill!http://lpaste.net/120208 A solution to the oh, no!-problem.
- February 6th, 2015: It's Friday! Friday! Hava #haskell problem on Friday! Fun-fun-fun! Lookin' forward to the weekend! http://lpaste.net/120087 Groovin' to aRebecca Black solution at http://lpaste.net/120095
- February 5th, 2015: Triangles and Squares as numbers http://lpaste.net/120037 for today's Haskell problem. A Triangulated-squares solution is provided by @bretthall at http://lpaste.net/120040
- February 4th, 2015: Three birds in the hand is better than today's #haskell problem http://lpaste.net/119926 an ornithologist's delight inspired by @KenKenPuzzle. The solution, using MultiMaps, PartitionedSets, and Arrows is (@geophf-obviously) "WOOT! WOOT! WOOT!" http://lpaste.net/120065
- February 3rd, 2015: We entertain a foolish attempt at a #haskell problem, and then we get serious with six sewing seamstresses http://lpaste.net/119867 A silly seamstress solution is posted at http://lpaste.net/119888
- February 2nd, 2015: Today's #haskell exercise is all about the #SuperBowl! (No, it's not, but that makes for good copy), or 110, 210, ... http://lpaste.net/119791 The moral (and solution) to this story is: Don't eat cheerios seasoned with basil. http://lpaste.net/119823 Or something like that. Inspired by @bretthall solution, I expanded to include last-3-of-4 digits for solutions to bases 4,5,6 @jamestanton

### Manuel M T Chakravarty: Type-safe Runtime Code Generation with LLVM

The embedded high-performance language Accelerate has got a new backend based on LLVM, which generates code for multicore GPUs and CPUs. In a new paper, we describe this code generator, which is —as far as we are aware— the first practical code generator that is fully type preserving from the source language down to generating low-level LLVM intermediate code (in SSA form). In addition to its novel safety features, the new backend generates vectorised SIMD code for x86_64 CPUs (using LLVM’s vectorisation support) and achieves competitive performance on a range of preliminary benchmarks.

### Haskell Logo Keycaps Interest Check

### ANNOUNCE postgresql-query and postgresql-config

### Coherent type classes

I'm trying to understand the trade off between coherent type class instances with newtypes and possible alternatives.

Assume a language where type class instances are typed and passed explicitly.

typeclass Monoid<A> { op(A, A) : A; id : A; } reduce<A, M : Monoid<A>>(xs : [A], m : M) : A = foldr(m.op, m.zero, xs); singleton IntSumMonoid : Monoid<Int> { op = (+); id = 0; } singleton IntProductMonoid : Monoid<Int> { op = (*); id = 1; }I believe this rules out type inference. Are there other drawbacks?

submitted by jedahu[link] [4 comments]

### Dimitri Sabadie: al 0.1.0.2 – documentation and default paths

This is a very short article to make you notice that al received two important changes:

- I uploaded documentation (hourra!) ;
- OpenAL paths will default to default installation on
**Windows systems**.

I tested the latter with a Windows 64b:

cabal updatecabal install al

That’s all. You should try it out as well. If you have errors about OpenAL libraries and/or header files, check whether OpenAL is correctly installed. If the error comes up again, proceed as I said here.

Also, I take people on linux feedback about installs ;).

### ghci and dynamically linking to Objective-C objectson Mac OS X

### how to get the first element which satisfies some conditions from a list?

I'm encountering a problem that I want to find out the first element which satisfies some conditions from a list.

for example, give a list of Char : l = ['a','b','c','d'] and a function trans:

trans :: Char -> Int trans 'a' = 2 trans 'b' = 3 trans 'c' = 1 trans 'd' = 0

What I want to do is to build a function which get the char c, whose (tans c) value is the maximum of the list l.

I tried to write a function like this:

find list = list !! (head $ findIndices (\x -> trans x == maximum (map tans list)) list)

It looks like really complex. So is there and build-in function or better solution?

Thanks.

submitted by Arcovitcher[link] [18 comments]