# News aggregator

### GHC 7.4.2 on Ubuntu Trusty

### Timing execution of individual functions in ghci?

### Seemingly impossible programs

In case this one went under the radar, at POPL'12, Martín Escardó gave a tutorial on seemingly impossible functional programs:

Programming language semantics is typically applied to

prove compiler correctness and allow (manual or automatic) program

verification. Certain kinds of semantics can also be applied to

discover programs that one wouldn't have otherwise thought of. This is

the case, in particular, for semantics that incorporate topological

ingredients (limits, continuity, openness, compactness). For example,

it turns out that some function types (X -> Y) with X infinite (but

compact) do have decidable equality, contradicting perhaps popular

belief, but certainly not (higher-type) computability theory. More

generally, one can often check infinitely many cases in finite time.

I will show you such programs, run them fast in surprising instances,

and introduce the theory behind their derivation and working. In

particular, I will study a single (very high type) program that (i)

optimally plays sequential games of unbounded length, (ii) implements

the Tychonoff Theorem from topology (and builds finite-time search

functions for infinite sets), (iii) realizes the double-negation shift

from proof theory (and allows us to extract programs from classical

proofs that use the axiom of countable choice). There will be several

examples in the languages Haskell and Agda.

A shorter version (coded in Haskell) appears in Andrej Bauer's blog.

### ghci balkiness on OS X?

### GADTs and defining Functor?

So I am trying to mimmic an example to use a Free monad and one problem I have hit is when I start using typeclasses in the GADT constructors.

Here is a reduced example that gets the error output of Could not deduce (a1 ~ a) that happens when implementing the functor.

{-# LANGUAGE GADTs #-} module Test where data Something blah where ResultA :: Int -> (Int -> blah) -> Something blah ResultB :: (Num a) => (a -> blah) -> Something blah ResultC :: (Num a) => Int -> a -> Something blah -- ResultD :: (Show s) => Int -> s -> Something blah instance Functor Something where fmap f (ResultA i g) = ResultA i (f . g) fmap f (ResultB g) = ResultB (f . g) fmap f (ResultC i d) = ResultC i (f d) -- fmap f (ResultD i d) = ResultD i (f d)Secondly, when I throw in a second kind of typeclass (ResultD), it also tries to equate those.

I have tried FlexibleContexts and FlexibleInstances, but that hasn't gotten me anywhere.

As a moderate beginner, I had a hunch that maybe I was missing the extra kind on Something. But Functor corrects my attempt on that.

The first argument of ‘Functor’ should have kind ‘* -> * ’, but ‘Something blah’ has kind ‘ * ’

Am I allowed to use typeclasses on GADTs? What am I fundamentally missing?

Note, the real context is cereal's Serialize typeclass, not Num--but this example should be prelude-only friendly.

submitted by levischuck[link] [7 comments]

### "we have a procedure for applying and composing those functions: ... matrix multiplication"

### A taste of Haskell (tutorial)

### api-builder: a library for quickly creating library wrappers for JSON APIs

### Student looking for internship.

Hi everyone, i'm a french CS student in my 4th year, and i'd like to apply for an internship this summer (or a summer job but i guess it might be that much harder to find).

I would really love to find an internship where i could use functionnal programming, and why not Haskell!

In France, it would be mostly Ocaml and that would be fine, but do you have any idea where i could find an internship where i would use Haskell?(i'm not limiting myself with the location, could be EU, NA, or anything really :) )

Every suggestions are welcome, thanks all.

(Also if my english is bad, you may correct me, i'll improve faster)

edit: /u/gallais pointed out in MP that i should says clearly if i prefer internship in a lab or in an enterprise, i already tried out both, and i like both so no clear priority here. Next year i'll mostly follow courses on data mining and algorithms so that may be a preference.

submitted by superancetre[link] [6 comments]