News aggregator

SCSS 2013 - Deadline Extension

General haskell list - Thu, 05/02/2013 - 9:21am
[Please post - apologies for multiple copies.] Deadline extension ================================================= SCSS 2013 Symbolic Computation in Software Science 5th International Symposium Castle of Hagenberg, Austria, July 5-6, 2013 Research Institute for Symbolic Computation (RISC) Johannes Kepler University Linz http://www.risc.jku.at/conferences/scss2013/ ================================================= Important Dates --------------- May 10, 2013: Abstract submission deadline (extended) May 13, 2013: Paper submission deadline (extended) June 3, 2013: Notification of acceptance June 17, 2013: Camera-ready copy deadline July 5-6, 2013: The symposium Scope -------- The purpose of SCSS 2013 is to promote research on theoretical and practical aspects of symbolic computation in software science. The symposium provides a forum for active dialog between researchers from several fields of computer algebra, algebraic geometry, algorithmic combinatorics, computational logic, and software analysis and v
Categories: Incoming News

Haskell job / adaptive learning

haskell-cafe - Thu, 05/02/2013 - 9:10am
Dear Haskellers, Erudify (http://erudify.com/) is looking for software engineers to join our team. We are developing an autonomous interactive online tutor. We sell our product to enterprise and provide it for free to schools and consumers. We are looking for software engineers who are smart and friendly, have several years of programming experience, and a passion for building practical and high quality software. Haskell is our main language and we are using JavaScript on the client side. The field of automated learning and teaching is still in its infancy and we are thrilled about the work we are doing to improve how people learn. So what are we looking for? We expect you to prefer design principles compatible with Unix and the Web. You make an effort to learn new technologies that could be helpful and you work to master those you already use. You have worked with a broad range of technologies in your career. You get things done and realise that trade-offs are necessary, but compromising the long-term g
Categories: Offsite Discussion

Haskell job / adaptive learning

General haskell list - Thu, 05/02/2013 - 9:07am
Dear Haskellers, Erudify (http://erudify.com/) is looking for software engineers to join our team. We are developing an autonomous interactive online tutor. We sell our product to enterprise and provide it for free to schools and consumers. We are looking for software engineers who are smart and friendly, have several years of programming experience, and a passion for building practical and high quality software. Haskell is our main language and we are using JavaScript on the client side. The field of automated learning and teaching is still in its infancy and we are thrilled about the work we are doing to improve how people learn. So what are we looking for? We expect you to prefer design principles compatible with Unix and the Web. You make an effort to learn new technologies that could be helpful and you work to master those you already use. You have worked with a broad range of technologies in your career. You get things done and realise that trade-offs are necessary, but compromising the long-term g
Categories: Incoming News

Representing Applicatives

Haskell on Reddit - Thu, 05/02/2013 - 8:21am
Categories: Incoming News

Edward Kmett: Representing Applicatives

Planet Haskell - Thu, 05/02/2013 - 8:19am

In the previous two posts, we've built up a whole range of applicatives, out of Const, Identity, Reader, Compose, Product, Sum, and Fix (and some higher-order analogues). Sum has given us the most trouble, but in some sense has been the most powerful, letting us write things like possibly eventually terminating lists, or trees, or in fact any sort of structure with branching alternatives. In this post, I want to think a bit more about why it is that Sum is the trickiest of the bunch, and more generally, what we can say about when two applicative structures are the "same". In the process of doing so, we'll invent something a lot like Traversable en passant.

Let's do some counting exercises. Product Identity Identity holds exactly two things. It is therefore isomorphic to ((->) Bool), or if we prefer, ((->) Either () ()). That is to say that a pair that holds two values of type a is the same as a function that takes a two-valued type and yields a value of type a. A product of more functors in turn is isomorphic to the reader of the sum of each of the datatypes that "represent" them. E.g. Product (Product Identity Identity) (Product (Const ()) Identity) is iso to ((->) (Either (Either () ()) ()), i.e. a data type with three possible inhabitants. In making this move we took Product to Either -- multiplication to sum. We can pull a similar trick with Compose. Compose (Product Identity Identity) (Product Identity Identity) goes to ((->) (Either () (),Either () ())). So again we took Product to a sum type, but now we took Compose to a pair -- a product type! The intuition is that composition multiplies the possibilities of spaces in each nested functor.

Hmm.. products go to sums, composition goes to multiplication, etc. This should remind us of something -- these rules are exactly the rules for working with exponentials. x^n * x^m = x^(n + m). (x^n)^m = x^(n*m). x^0 = 1, x^1 = x.

Seen from the right standpoint, this isn't surprising at all, but almost inevitable. The functors we're describing are known as "representable," a term which derives from category theory. (See appendix on representable functors below).

In Haskell-land, a "representable functor" is just any functor isomorphic to the reader functor ((->) a) for some appropriate a. Now if we think back to our algebraic representations of data types, we call the arrow type constructor an exponential. We can "count" a -> x as x^a, since e.g. there are 3^2 distinct functions that inhabit the type 2 -> 3. The intuition for this is that for each input we pick one of the possible results, so as the number of inputs goes up by one, the number of functions goes up by multiplying through by the set of possible results. 1 -> 3 = 3, 2 -> 3 = 3 * 3, (n + 1) -> 3 = 3 * (n -> 3).

Hence, if we "represent" our functors by exponentials, then we can work with them directly as exponentials as well, with all the usual rules. Edward Kmett has a library encoding representable functors in Haskell.

Meanwhile, Peter Hancock prefers to call such functors "Naperian" after John Napier, inventor of the logarithm (See also here). Why Naperian? Because if our functors are isomorphic to exponentials, then we can take their logs! And that brings us back to the initial discussion of type mathematics. We have some functor F, and claim that it is isomorphic to -^R for some concrete data type R. Well, this means that R is the logarithm of F. E.g. (R -> a, S -> a) =~ Either R S -> a, which is to say that if log F = R and log G =~ S, then log (F * G) = log F + log G. Similarly, for any other data type n, again with log F = R, we have n -> F a =~ n -> R -> a =~ (n * R) -> a, which is to say that log (F^n) =~ n * log F.

This gives us one intuition for why the sum functor is not generally representable -- it is very difficult to decompose log (F + G) into some simpler compound expression of logs.

So what functors are Representable? Anything that can be seen as a fixed shape with some index. Pairs, fixed-size vectors, fixed-size matrices, any nesting of fixed vectors and matricies. But also infinite structures of regular shape! However, not things whose shape can vary -- not lists, not sums. Trees of fixed depth or infinite binary trees therefore, but not trees of arbitrary depth or with ragged structure, etc.

Representable functors turn out to be extremely powerful tools. Once we know a functor is representable, we know exactly what its applicative instance must be, and that its applicative instance will be "zippy" -- i.e. acting pointwise across the structure. We also know that it has a monad instance! And, unfortunately, that this monad instance is typically fairly useless (in that it is also "zippy" -- i.e. the monad instance on a pair just acts on the two elements pointwise, without ever allowing anything in the first slot to affect anything in the second slot, etc.). But we know more than that. We know that a representable functor, by virtue of being a reader in disguise, cannot have effects that migrate outwards. So any two actions in a representable functor are commutative. And more than that, they are entirely independent.

This means that all representable functors are "distributive"! Given any functor f, and any data type r, then we have

  distributeReader :: Functor f => f (r -> a) -> (r -> f a) distributeReader fra = \r -> fmap ($r) fra  

That is to say, given an arrow "inside" a functor, we can always pull the arrow out, and "distribute" application across the contents of the functor. A list of functions from Int -> Int becomes a single function from Int to a list of Int, etc. More generally, since all representable functors are isomorphic to reader, given g representable, and f any functor, then we have: distribute :: (Functor f, Representable g) => f (g a) -> g (f a).

This is pretty powerful sauce! And if f and g are both representable, then we get the transposition isomorphism, witnessed by flip! That's just the beginning of the good stuff. If we take functions and "unrepresent" them back to functors (i.e. take their logs), then we can do things like move from ((->) Bool) to pairs, etc. Since we're in a pervasively lazy language, we've just created a library for memoization! This is because we've gone from a function to a data structure we can index into, representing each possible argument to this function as a "slot" in the structure. And the laziness pays off because we only need to evaluate the contents of each slot on demand (otherwise we'd have a precomputed lookup table rather than a dynamically-evaluated memo table).

And now suppose we take our representable functor in the form s -> a and paired it with an "index" into that function, in the form of a concrete s. Then we'd be able to step that s forward or backwards and navigate around our structure of as. And this is precisely the Store Comonad! And this in turn gives a characterization of the lens laws.

What this all gives us a tiny taste of, in fact, is the tremendous power of the Yoneda lemma, which, in Haskell, is all about going between values and functions, and in fact captures the important universality and uniqueness properties that make working with representable functors tractable. A further tiny taste of Yoneda comes from a nice blog post by Conal Elliott on memoization.

Extra Credit on Sum Functors

There in fact is a log identity on sums. It goes like this:

log(a + c) = log a + log (1 + c/a)

Do you have a useful computational interpretation of this? I've got the inklings of one, but not much else.

Appendix: Notes on Representable Functors in Hask.

The way to think about this is to take some arbitrary category C, and some category that's basically Set (in our case, Hask. In fact, in our case, C is Hask too, and we're just talking about endofunctors on Hask). Now, we take some functor F : C -> Set, and some A which is an element of C. The set of morphisms originating at A (denoted by Hom(A,-)) constitutes a functor called the "hom functor." For any object X in C, we can "plug it in" to Hom(A,-), to then get the set of all arrows from A to X. And for any morphism X -> Y in C, we can derive a morphism from Hom(A,X) to Hom(A,Y), by composition. This is equivalent to, in Haskell-land, using a function f :: x -> y to send g :: a -> x to a -> y by writing "functionAToY = f . g".

So, for any A in C, we have a hom functor on C, which is C -> Set, where the elements of the resultant Set are homomorphisms in C. Now, we have this other arbitrary functor F, which is also C -> Set. Now, if there is an isomorphism of functors between F, and Hom(A,_), then we say F is "representable". A representable functor is thus one that can be worked with entirely as an appropriate hom-functor.

Categories: Offsite Blogs

www.glc.us.es

del.icio.us/haskell - Thu, 05/02/2013 - 7:24am
Categories: Offsite Blogs

www.glc.us.es

del.icio.us/haskell - Thu, 05/02/2013 - 7:24am
Categories: Offsite Blogs

Yesod Web Framework: Yesod 1.2 released

Planet Haskell - Thu, 05/02/2013 - 7:00am

The Yesod team is pleased to announce the release of Yesod 1.2. You can get it with:

cabal install yesod-platform yesod-bin

The yesod binary is now a separate package which helps manage dependencies, but it does mean you need to remember to install 2 separate packages.

Yesod 1.1 was released in August. Shortly after, Michael started working for FP Complete. A lot has happened since then!

Yesod ecosystemYesod 1.2Representation system

Previously discussed in the post: a better representation system, cleaner internals, and the request local cache. Providing different representation types (JSON or HTML) used to be cumbersome at times, but now it is simple using selectRep.

getResource :: Handler TypedContent getResource = do selectRep $ do provideRep $ [hamlet|<div>|] provideRep $ object ["result" .= "ok"]Request local type-based caching

See the previous mentioned blog post, but you just need to create a newtype wrapper around some data and then you can cache it with the cached function.

Subsite overhaul

Subsites are now just a transformer over a master site

Flexible routing

routing dispatch is more flexible

Better streaming API

streaming has been simplified

Asset pipeline

Yesod has always made it easy to combine dynamic css and javascript since before Rails started using the term asset pipeline. What was missing was the same ease for static assets. Combining static assets is very important for optimal performance by reducing the total number of network requests. You can now easily combine CSS and Javascript with the combineScripts and combineStylesheets helpers. Here is the scaffolding change and you can also look at the haddock documentation.

Better testing

yesod-test was completely overhauled, making it easier to use and providing cleaner integration with hspec.. It is easy in Haskell to just lean against the type system for most things and skip testing, particularly if it is something that is hard to test with QuickCheck. But yesod-test (and wai-test) are there to prevent bugs that the type system cannot.

Even more
  • More efficient session handling.
  • yesod-auth email plugin now supports logging in via username in addition to email address.
  • probably more stuff we forgot to mention
Conclusion & more info

FPComplete's development of the School of Haskell has been great for the Haskell community to keep spreading knowledge. It has also been running with the changes for 1.2 for quite a while which should contribute to making 1.2 a more stable release.

[https://github.com/yesodweb/yesod/wiki/Changelog#yesod-12-not-yet-released](The high-level changelog) has been discussed in high-level here. [https://github.com/yesodweb/yesod/wiki/Detailed-change-list#not-yet-released-yesod-12](Detailed changes are here)

The book documentation for 1.2 has been started, but still needs more work to get fully up to date.

Most of the changes to upgrade your site to 1.2 should be fairly mechanical. I started a wiki page for the upgrade. If you have any issues, please note them there or on the mail list.

We hope you enjoy using Yesod 1.2

Categories: Offsite Blogs

Backward compatibility

haskell-cafe - Thu, 05/02/2013 - 6:27am
Hi All, Please don't interpret this as a rant: I'm just feeling a bit disappointed about probably having to give up on Haskell. Let's face it: this decision to change the default syntax in GHC7 means that right now Haskell looks about as stable as Ruby on Rails. I just tried to use Flippi. It broke because of the syntax change so I tried WASH. I couldn't even install it because of the syntax change. I persisted for a while but gave up because getPackageId doesn't exist in any form at all anymore. This was only the install script: what would WASH itself have in store for me to get my brain around? What are my choices here: 1) Revert to GHC6 or put pragmas and compiler switches everywhere, switch 2010 off globally with cabal or even make an alias of ghc: That means I'll gradually clash with people who decide ... 2) Convert all my code and a lot of other peoples' to the new syntax, thereby exacerbating the problem that ruled out 1. Either way, we're looking at a long period during which a large portion of
Categories: Offsite Discussion

Haskell Weekly News: Issue 266

General haskell list - Thu, 05/02/2013 - 5:03am
Welcome to issue 266 of the HWN, an issue covering crowd-sourced bits of information about Haskell from around the web. This issue covers the week of April 7 to 27, 2013. Quotes of the Week * hpc: the dirty secret of haskell programmers is that their power does not come from their PhD, but their bowtie * tibbe: I think I have implemented a reverse state monad by mistake. The numbers suggest I'm getting the values tunneled back from the future. :/ * SaulGorn: A formalist is one who cannot understand a theory unless it is meaningless. * cmccann: laziness by default is a shortcoming. eagerness by default is a bigger shortcoming. * monochrom: #haskell-blah has brilliant people too. for example me. * limo: OK, guys was nice meeting you and now I'm a proud owner of a GHCi icon on my desktop * otters: lens law #1: the implementation must be shorter than the type * MartinDeMello: Any sufficiently well-commented Lisp program contains an ML progr
Categories: Incoming News

www.glc.us.es

del.icio.us/haskell - Thu, 05/02/2013 - 2:48am
Categories: Offsite Blogs

steve-yegge.blogspot.fr

del.icio.us/haskell - Thu, 05/02/2013 - 2:32am
Categories: Offsite Blogs

steve-yegge.blogspot.fr

del.icio.us/haskell - Thu, 05/02/2013 - 2:32am
Categories: Offsite Blogs

lpuppet.banquise.net

del.icio.us/haskell - Thu, 05/02/2013 - 2:32am
Categories: Offsite Blogs

lpuppet.banquise.net

del.icio.us/haskell - Thu, 05/02/2013 - 2:32am
Categories: Offsite Blogs

lpuppet.banquise.net

del.icio.us/haskell - Thu, 05/02/2013 - 2:32am
Categories: Offsite Blogs

lpuppet.banquise.net

del.icio.us/haskell - Thu, 05/02/2013 - 2:32am
Categories: Offsite Blogs