Specialization with Constraints

GHC also gives an option to SPECIALIZE a type-class instance declaration. I tried this with the (expanded) code of Foo.hs, by putting the following: instance (Num r, V.Vector v r, Factored m r) => Num (VT v m r) where {-# SPECIALIZE instance ( Factored m Int => Num (VT U.Vector m Int)) #-} VT … Read more

Real-world applications of zygohistomorphic prepromorphisms

Sharon Curtis and Shin-Cheng Mu have a Functional Pearl using zygomorphisms to find maximally dense segments (a generalization of maximum segment sums). Zygomorphisms are seemingly a good fit for sliding window problems once you are accustomed to them. http://www.iis.sinica.edu.tw/~scm/2010/functional-pearl-maximally-dense-segments/ I’d nominate the authors for extra credit as they’ve avoided the use of the fixed-point Mu … Read more

What’s the status of multicore programming in Haskell?

In the 2009-2012 period, the following things have happened: 2012: From 2012, the parallel Haskell status updates began appearing in the Parallel Haskell Digest. 2011: Parallel and Concurrent Programming in Haskell, a tutorial. version 1.1 released by Simon Marlow Haskell and parallelism, mentioned in an article in the Economist magazine, Jun 2nd 2011. Parallel tree … Read more

Why is there “data” and “newtype” in Haskell? [duplicate]

Both newtype and the single-constructor data introduce a single value constructor, but the value constructor introduced by newtype is strict and the value constructor introduced by data is lazy. So if you have data D = D Int newtype N = N Int Then N undefined is equivalent to undefined and causes an error when … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)