News aggregator

SPOJ - HaskellWiki

del.icio.us/haskell - Fri, 02/01/2013 - 3:02pm
Categories: Offsite Blogs

Optimizing performance problems with Aeson renderinglarge Text arrays

haskell-cafe - Fri, 02/01/2013 - 12:06pm
Hello, In summary, i'm working on an application that responds to a users query, a sequence index, with the union of a list of UUIDs that have "changed" since that same sequence index, split into 6 sections. I wish to respond to these queries via JSON to provide an easy to use web service, and for the most part, what I have works. The problem I am having is that profiling seems to show that the majority of the time spent in my application is encoding this to JSON, and also that the application is only 60% productive with 40% allocations happening in Data.Aeson.encode (and friends). Here's an overview of what I'm doing, the full code can be found at the end of this email. I am storing my data in memory as an IntMap, from sequence index to a changeset: IntMap ChangeSet Where a ChangeSet is essentially a tuple of HashSet's of UUIDs: data ChangeSet = ChangeSet { artistChanges :: !(HashSet MBID) , labelChanges :: !(HashSet MBID)
Categories: Offsite Discussion

Wierd behavior I noticed when working on a project. Can anyone explain why this happens?

Haskell on Reddit - Fri, 02/01/2013 - 11:37am
Prelude> 0.1 * 2 == 0.2 True Prelude> 0.1 * 3 == 0.3 False submitted by WrongSubreddit
[link] [36 comments]
Categories: Incoming News

why GHC cannot infer type in this case?

haskell-cafe - Fri, 02/01/2013 - 10:09am
Dmitry Kulagin wrote: One way to avoid the problem is to start with the tagless final representation. It imposes fewer requirements on the type system, and is a quite mechanical way of embedding DSL. The enclosed code re-implements your example in the tagless final style. If later you must have a GADT representation, one can easily write an interpreter that interprets your terms as GADTs (this is mechanical). For more examples, see the (relatively recent) lecture notes http://okmij.org/ftp/tagless-final/course/lecture.pdf {-# LANGUAGE TypeOperators, KindSignatures, DataKinds #-} {-# LANGUAGE NoMonomorphismRestriction, TypeFamilies #-} module TestExp where
Categories: Offsite Discussion

Why does not zipWith' exist

haskell-cafe - Fri, 02/01/2013 - 9:32am
Hello, Many texts explain the following Fibonacci code: fibs :: [Integer] fibs = 0 : 1 : zipWith (+) fibs (tail fibs) But this code is very slow because evaluation of (+) is done lazily. If we have the following strict zipWith', the code above becomes much faster. zipWith' f (a:as) (b:bs) = x `seq` x : zipWith' f as bs where x = f a b zipWith' _ _ _ = [] Data.List defines foldl' against foldl. But it does not define zipWith'. I'm curious why zipWith' does not exist in the standard libraries. --Kazu
Categories: Offsite Discussion

Joachim Breitner: Cologne→Brussels Thalys ticket for today to give away

Planet Haskell - Fri, 02/01/2013 - 8:51am

Since I can’t got to FOSDEM, I can’t make use of my Thalys train ticket. If anyone needs it, I’ll happily give it away. It is a 1st class (which was cheaper than 2nd class at the time of booking) ticket for Thalys from Cologne, 18:42, to Brussles Midi, 20:32, today. Just send me mail if you have a use for it.

Categories: Offsite Blogs

happs-2012-10-08.txt

del.icio.us/haskell - Fri, 02/01/2013 - 5:04am
Categories: Offsite Blogs

hdbc-odbc not getting any data using mssql storedprocedure

haskell-cafe - Fri, 02/01/2013 - 2:16am
Hi, I am trying to call a stored procedure (exec gp_somestoredproc 123,22) using microsoft sql server 2008 R2 using hdbc-odbc. Here is the haskell code: import Database.HDBC import Database.HDBC.ODBC import Control.Monad import Data.Maybe import qualified Data.ByteString.Char8 as B test1 = do c <- connectODBC "Driver={SQL Server};Server=?;Database=?;uid=sa;pwd=?;" p <- prepare c "exec gp_somestoredproc 123,22" -- returns no data -- p <- prepare c "exec [sys].sp_datatype_info_100 0,< at >ODBCVer=4;exec gp_somestoredproc 123,22" -- all is good e <- execute p [] -- returns 6 (number of rows) putStrLn $ "execute " ++ show e r <- fetchAllRows' p putStrLn $ "fetchAllRows' " ++ show r The problem is that this code returns the number of rows correctly but doesn't return data nor are there any errors. However, I ran a perl program using perl dbi and got the data correctly. Here is the perl code: #!/usr/bin/perl use DBI; my $user = 'sa'; my $pw = '????'; my $dsn = '????'; my $dbh =
Categories: Offsite Discussion

Yet another Conduit question

haskell-cafe - Thu, 01/31/2013 - 5:12pm
I am working with bulk sources and sinks, that is with a type like: Source m [a] Sink [a] m () The problem is that I would like to work on individual values in my conduit. I can have this: concat :: (Monad m) => Conduit [a] m a concat = awaitForever (mapM_ yield) But how can I do it the other way around ? I suppose it involves pattern matching on the different states my conduit might me in. But is that even possible to do it in a "non blocking" way, that is catenate data while there is something to read (up to a certain threshold), and send it as soon as there is nothing left to read ? Or doesn't that make any sense in the context of Conduits (in the sense that this conduit will be recheck for input before the upstream conduits will have a chance to operate) ? Another approach would be to have a map equivalent: conduitMap :: Conduit i m o -> Conduit [i] m [o] But I am not sure how to do this either ...
Categories: Offsite Discussion

Haskell Weekly News: Issue 256

General haskell list - Thu, 01/31/2013 - 4:39am
Welcome to issue 256 of the HWN, an issue covering crowd-sourced bits of information about Haskell from around the web. This issue covers the weeks of January 20 to 26, 2013. Quotes of the Week * elliott: cmccann: unfortunately it is too perfect an abstraction to be useful. * SamanthaD: shachaf: you're one of those dirty imperative communists who want the state to dictate everything! * monochrom: I refuse camel case and mark zuckerberg. same level. not negotiable. * mauke: a newtype is like an existing type but wearing glasses and a fake mustache and a sign saying "you've never seen me before" Top Reddit Stories * Taking magic out of GHC or: Tracing compilation by transformation (intro to Core transformations, inlining,.. Domain: ics.p.lodz.pl, Score: 59, Comments: 2 On Reddit: [1] http://goo.gl/lJmsb Original: [2] http://goo.gl/IbJ5O * Introduction to Haskell IO Domain: haskellforall.com, Score: 57, Comments: 26 On Reddi
Categories: Incoming News

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!

~d

Categories: Incoming News