News aggregator

Templates as typeclasses?

haskell-cafe - Fri, 05/09/2014 - 11:55am
Tobias Dammers wrote: In this regard it is worth mentioning HSXML The document in HSXML is a monoid rather than a monad. It is hard to find a good reason for the document be a monad except for using a do notation, which is not needed in HSXML. The above "Hello, World!" example looks in HSXML as h1 (span "Hello") (span "world!") (Note that we don't need the space after `Hello'.) This produces the desired output (in plain text, HTML or XML). If we don't need span, we can just write h1 "Hello" "world!" The main difference from Blaze shows up if we attempt h1 (p "Hello") "world!" It will be a type error. The error message says No instance for (Build (DC CT_inline d0) (DC CT_block d0) t) arising from a use of `h1' No instance for (Build (DC CT_inline d0) (DC CT_block d0) (DC CT_inline d0)) arising from a use of `p' That is, (p "Hello") produces block-level content and h1 requires its ch
Categories: Offsite Discussion

is there any use for this MutableState monad i made?

Haskell on Reddit - Fri, 05/09/2014 - 11:53am

i built a state monad using a reader w/ an ioref in it, but i'm not sure if there are any practical uses for it over the existing state monad, but i guess u could use it with lenses for proper mutable variables

also it's probably really buggy, i didnt test it much

code is in a gist here, needs flexibleinstances, multiparamtypeclasses

submitted by Intolerable
[link] [3 comments]
Categories: Incoming News

Erlang Workshop 2014: deadline extension

General haskell list - Fri, 05/09/2014 - 10:57am
Hello all, the PC has decided to extend the paper submission deadline for the 13th ACM SIGPLAN Erlang Workshop. Final dates are the following, no further extensions will be granted: Submissions due: Sunday, 18 May, 2014 [extended, final] Author notification: Friday, 12 June, 2014 [extended] Final copy due: Sunday, 22 June, 2014 [unchanged, ACM strict deadline] Workshop date: September 5, 2014 [unchanged] Apologies for any duplicates you may receive. FINAL CALL FOR PAPERS [deadline extension] =================================== Thirteenth ACM SIGPLAN Erlang Workshop ----------------------------------------------------------- Göteborg, Sweden, September 5, 2014 Satellite event of the 19th ACM SIGPLAN International Conference on Functional Programming (ICFP 2014) September 1-3, 2014 Erlang is a concurrent, distributed functional programming language aimed at systems with requirements of massive concurrency, soft real time response, fault tolerance, and high availab
Categories: Incoming News

Need a program to count word occurrences in a string

Haskell on Reddit - Fri, 05/09/2014 - 9:19am

Is anyone able to do this? It's for a small project me and my brother are working on. We would truly appreciate it

Ideally it would work something like this, string: "red blue green red"


red 2

blue 1

green 1

submitted by the16
[link] [9 comments]
Categories: Incoming News

CFP: FARM 2014: Deadline extended!

General haskell list - Fri, 05/09/2014 - 8:54am
Dear Haskell interested, You might want to be aware that the deadline for FARM 2014, 2nd ACM SIGPLAN International Workshop on Functional Art, Music, Modelling and Design, has been extended to the *** 15 May, 2014 *** All the best, /Henrik
Categories: Incoming News

Announcement: First Dutch FinTech Hackaton

haskell-cafe - Fri, 05/09/2014 - 7:51am
Hi all, Always wanted to show the industry what Functional Programming can do? Have a look at for this is a great opportunity to do so! please spread the word, I think it would be very cool if a FP-team would participate. Cheers! Han Joosten _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >
Categories: Offsite Discussion

Philip Wadler: I'll be voting Green in the European elections – and here's why

Planet Haskell - Fri, 05/09/2014 - 6:48am

Alex Andreou writes in The Guardian:
I hear results of straw polls showing that a majority of people in this country feel "uncomfortable" with immigration. ... I am disappointed by both the Conservatives and Labour's stance on immigration. It seems to me they are trying to address multiple audiences; on the one hand they want to comfort the uncomfortable, on the other there seems to be a nudge-nudge, wink-wink message between the lines intended for people like me that says "don't worry". By doing that, they legitimise Ukip's highly dangerous message, because they allow Farage to point to imitators and boost the brand validity of his "original" snake oil.

I don't think I can bring myself to vote for the Liberal Democrats again. Tuition fees, austerity, bedroom tax, welfare cap, Atos, Royal Mail – the list goes on. This left me looking at the Green party, as the default remaining choice. The surprise was that the more I looked at them, the more I liked them. Their policies appear to me eminently sensible and unabashedly progressive, in most areas. They are the only party which has refused to be drawn into the immigrant-bashing competition with the others, and the only which proposes a vote in the general elections for EU citizens based on residency, rather than nationality. Their commitment to minority rights, including LGBT, is second to none. They alone seem to understand that discussion and collaboration, rather than confrontation, is the way to reform the EU. Their candidates seem passionate and compassionate. My scrutiny left me thinking: why wasn't I planning to vote for them in the first place, especially when there is proportional representation?
Categories: Offsite Blogs

Simplifying an abstract syntax tree via recursion schemes

Haskell on Reddit - Fri, 05/09/2014 - 5:19am

Ok, so, I'm trying to learn various recursion schemes to help make my code nicer. I have an abstract syntax tree thusly:

data ExprF a self where Const :: Symbolic → ExprF a self Zero ∷ ExprF a self Add :: self → self → ExprF a self Subtract ∷ self → self→ ExprF a self Sum :: [self] → ExprF a self Product :: [self] → ExprF a self Tuple ∷ [self] → ExprF a self Polynomial ∷ self → [PowerSeriesCoefficient a] → ExprF a self Apply ∷ Operator → [self] → ExprF a self Power :: self → self → ExprF a self Psuedoscalar ∷ ExprF a self Exp ∷ self → ExprF a self Cos ∷ self → ExprF a self UnaryOperator ∷ UnaryOperator → self → ExprF a self BinaryOperator ∷ BinaryOperator → self → self → ExprF a self type TExpr a = Fix (ExprF a)

I have implemented evaluation like so:

type Env a = Data.Map.Map Symbolic a eval ∷ Algebra.Ring.C a ⇒ Env a → TExpr anno → a eval env = cata (evalAlg env) evalAlg ∷ Algebra.Ring.C a ⇒ Env a → ExprF anno a → a evalAlg env = eval' where eval' (Const var) = fromJust $ Data.Map.lookup var env eval' (Sum xs) = Data.List.Stream.foldr1 (+) xs eval' (Product xs) = Data.List.Stream.foldr1 (*) xs eval' (UnaryOperator op val) = evalUnary op val eval' (Add a b) = a + b eval' (Subtract a b) = a - b eval' _ = undefined --etc evalUnary ∷ Algebra.Ring.C a ⇒ UnaryOperator → a → a evalUnary Negate val = negate val

Now, the question is... What would be the nicest way of implementing simplification using a recursion scheme? I'm currently doing it with another catamorphism like this:

simplify ∷ TExpr anno → TExpr anno simplify = cata alg where alg (Add a b) = simplifyAdd a b alg a = Fix a simplifyAdd (Fix (Sum xs)) s = Fix (Sum (s:xs)) --etc

however, this seems to be full of boilerplate Fixing and so on. Is there a nicer morphism?

(My full code is at )

submitted by deltaSquee
[link] [21 comments]
Categories: Incoming News

ML Family Workshop -- Last call for presentations

General haskell list - Fri, 05/09/2014 - 3:37am
Important dates Monday May 19 (any time zone): Abstract submission Monday June 30: Author notification Thursday September 4, 2014: ML Family Workshop Higher-order, Typed, Inferred, Strict: ACM SIGPLAN ML Family Workshop Thursday September 4, 2014, Gothenburg, Sweden (immediately following ICFP and preceding OCaml Users and Developers Workshop) Call For Papers ML is a very large family of programming languages that includes Standard ML, OCaml, F#, SML#, Manticore, MetaOCaml, JoCaml, Alice ML, Dependent ML, Flow Caml, and many others. All ML languages, beside the great deal of syntax, share several fundamental traits. They are all higher-order, strict, mostly pure, and typed, with algebraic and other data types. Their type systems inherit from Hindley-Milner. The development of these languages has inspired a significant amount of computer science research and influenced a number of programming languages, including Haskell, Scala and Clojure,
Categories: Incoming News

Brazilian type checking - Fri, 05/09/2014 - 1:11am
Categories: Offsite Blogs

Using mutable array after an unsafeFreezeArray, and GC details

glasgow-user - Fri, 05/09/2014 - 12:18am
I have an unusual application with some unusual performance problems and I'm trying to understand how I might use unsafeFreezeArray to help me, as well as understand in detail what's going on with boxed mutable arrays and GC. I'm using the interface from 'primitive' below. First some basic questions, then a bit more background 1) What happens when I do `newArray s x >>= \a-> unsafeFreezeArray a 2) And what if a do a `cloneMutableArray` on `a` and likewise use the resulting array? Background: I've been looking into an issue [1] in a library in which as more mutable arrays are allocated, GC dominates (I think I verified this?) and all code gets slower in proportion to the number of mutable arrays that are hanging around. I've been trying to understand how this is working internally. I don't quite understand how the "remembered set" works with respect to MutableArray. As best I understand: the remembered set in generation G points to certain objects in older generations, which objects hold references to ob
Categories: Offsite Discussion

New gtk2hs 0.12.4 release

gtk2hs - Wed, 11/21/2012 - 12:56pm

Thanks to John Lato and Duncan Coutts for the latest bugfix release! The latest packages should be buildable on GHC 7.6, and the cairo package should behave a bit nicer in ghci on Windows. Thanks to all!


Categories: Incoming News