News aggregator

Philip Wadler: Status Report 5

Planet Haskell - Sat, 05/16/2015 - 10:00am

I am recovered. My bone marrow biopsy and my scan at the National Amyloidosis Centre show no problems, and my urologist has discharged me. Photo above shows me and Bob Harper (otherwise known as TSOPLRWOKE, The Society of Programming Language Researchers With One Kidney Each) at Asilomar for Snapl.
My thanks again to staff of the NHS. Everyone was uniformly friendly and professional, and the standard of care has been excellent. My thanks also to everyone who wished me well, and especially to the SIGPLAN EC, who passed a get-well card around the world for signing, as shown below. I am touched to have received so many good wishes.
Related: Status Report, Status Report 2, A paean to the Western General, Status Report 3, Status Report 4.

Categories: Offsite Blogs

Philip Wadler: Status Report 4

Planet Haskell - Sat, 05/16/2015 - 8:35am

It seemed as if no time had passed: the anaesthetist injected my spine, and next thing I knew I was waking in recovery. Keyhole surgery to remove my left kidney was completed on Tuesday 17 March, and I expect to leave the Western General on Saturday 21 March. Meanwhile, progress on diagnosing the amyloid spotted in my liver: I had a bone marrow biopsy on Thursday 19 March, and two days of testing at the National Amyloidosis Centre in London are to be scheduled. NHS has provided excellent care all around.

My room was well placed for watching the partial eclipse this morning. A nurse with a syringe helped me jury rig a crude pinhole camera (below), but it was too crude. Fortunately, there was exactly the right amount of cloud cover through which to view the crescent sun. My fellow patients and our nurses all gathered together, and for five minutes it was party time on the ward.

Update: I left the hospital as planned on Saturday 21 March. Thanks to Guido, Sam, Shabana, Stephen, and Jonathan for visits; to Marjorie for soup; to Sukkat Shalom council for a card and to Gillian for hand delivery; and to Maurice for taking me in while my family was away.

Related: Status report, Status report 2, A paean to the Western General, Status report 3.

Categories: Offsite Blogs

Philip Wadler: Multiple inheritance, revisited

Planet Haskell - Sat, 05/16/2015 - 8:33am
Via @ReifyReflect (Sam Lindley) and @PedalKings. Previously: Multiple inheritance.
<script async="" charset="utf-8" src=""></script>
Categories: Offsite Blogs

Haskell job / open source / berlin or remote

Haskell on Reddit - Sat, 05/16/2015 - 7:51am

We are looking for a haskell developer to work on a privacy-preserving user data management / single-sign-on system.


We are looking for a full-time free-lancer physically located in Berlin, Germany and able to start immediately, but remote work and other arrangements may be possible. Let us know your preferences!

We are four developers after this hire (plus product ownership / management). We are operating out of a small office in Berlin-Neukölln and a co-working space for the spill-over, and are planning to move to a new office later this year.


We are looking for somebody with experience in Haskell (or at least in related languages), a passion for effective and beautiful code, willingness to be productive (sorry for the cliches), and both strong opinions and the ability to compromise.

Some of the relevant topics are cryptography, network protocols, information flow control and authorization control. You should least at see yourself developing an interest in these; but we are not looking for a specialist and will give you some time to figure things out.

What now?

Please apply to:

Dr. Matthias Fischmann Primary key fingerprint: 4185 93B1 BBF5 D064 62B6 9FA6 0DE4 AA9C 5446 EBF4

Applications should include one to three pieces of software, including at least one that you are fond of and one written by you (the two can be the same, but do not have to). The Interviews will include one conversation about the code you submit, and one about thentos or one of the core libraries we use.

submitted by 34798s7d98t6
[link] [5 comments]
Categories: Incoming News

Do you have children?

Haskell on Reddit - Sat, 05/16/2015 - 2:05am

First a bit about me. I am currently working as a web developer, I haven't had any formal CS education, and I basically suck at programming in general.

I was unemployed for a couple of months and I decided to learn Haskell, just to see what all the fuss was about. I followed the usual path (Learn you some Haskell, Real World Haskell) and failed miserably. Not that the books are bad, it's just that I am old and stupid.

Then I started working on a Java project...

What I kept thinking is what it would be like to try and explain Java (or any other imperative language) to someone that the first language that they learned was Haskell ("...but of course it makes sense to say that x = x + 1")...

What kind of developers would the next generation be, if their first programming language is Haskell?

I am the father of a 4 year old and I would love to be able to teach Haskell to my child when he is old enough. But for that to happen some things need to change, and a lot more need to happen...

The most important thing that is required in my opinion is a programming environment that is accessible and easy to use, I think that why the lucky stiff with his Hackety Hack project was in the right path, and also the guidelines set forth by Bret Victor (!/LearnableProgramming) is the way that the next generation should be taught coding.

A question is how do you explain concepts such as Monad and Functor to a child... Well, you don't. All children that write code will use derivatives, integration and a fair amount of linear algebra in their code without knowing anything about calculus or linear algebra.

That is what is beautiful and important about coding, you first discover and use concepts and when the time comes you learn the formal definitions.

So I would like to ask from all Haskell developers to take some time and consider the next generation of developers, our children. How will they code, how will they think about software...

submitted by nikosquant
[link] [29 comments]
Categories: Incoming News

Deriving Show instance with ADT that has phantom type

haskell-cafe - Sat, 05/16/2015 - 12:45am
Going through the Data Types Ala Carte paper I found this definition: data Expr f = In (f (Expr f)) I tried to use "deriving Show"... data Expr f = In (f (Expr f)) deriving Show I found out that doesn't work with ADT's that have phantom types. I tried StandaloneDeriving too since GHC recommended it: {-# LANGUAGE StandaloneDeriving #-} data Expr f = In (f (Expr f)) deriving Show instance deriving Show (Expr f) Got this error: src/Main.hs:32:1-31: No instance for (Show (f (Expr f))) … arising from a use of ‘showsPrec’ In the second argument of ‘(.)’, namely ‘(showsPrec 11 b1)’ In the second argument of ‘showParen’, namely ‘((.) (showString "In ") (showsPrec 11 b1))’ In the expression: showParen ((a >= 11)) ((.) (showString "In ") (showsPrec 11 b1)) When typechecking the code for ‘showsPrec’ in a standalone derived instance for ‘Show (Expr f)’: To see the code I am typ
Categories: Offsite Discussion

cast to specific Typeclass

haskell-cafe - Fri, 05/15/2015 - 7:59pm
Hello everyone, I'm trying to implement traversal over data structures and found Data.Typeable very useful for that. But it seems to be impossible to cast to specific typeclass, so that we can cast Typeable to something that is Show'able for example. It'd be usefull to have something like: data CanShow = forall a. CanShow a toConcrete :: (Typeable a) => a -> Maybe CanShow Implementing such datatypes for needed classes would allow to do some kind of class casting. Is it possible to implement this somehow? Is it a limitation of the implementation or a principal one? Thanks! Regards, Teodor.
Categories: Offsite Discussion

Transforming ASTs

haskell-cafe - Fri, 05/15/2015 - 5:08pm
This might be a duplicated message. The first time I posted it I had not subscribed to haskell cafe. Suppose the following data type for encoding Boolean expressions: data BExpr a = BTrue | BFalse | Id String | Not a | And a a | Or a a | BEq a a deriving (Functor) type Expr = Fix BExpr It is easy to produce a string representation of an expression or evaluate it: estr :: BExpr String -> String eval :: BExpr Bool -> Bool with the cata function from Data.Functor.Fixedpoint. Could you suggest a solution for transforming trees encoded as Exp into equivalent Expr (e.g Not Not a ~> a)? cata does not work since it expects a function f a -> a while a transformation would be f a -> f a. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >
Categories: Offsite Discussion

Call for concurrency bugs!

haskell-cafe - Fri, 05/15/2015 - 2:14pm
Hi cafe, I've been working on a little library for testing concurrent Haskell programs, and would really like some test cases not constructed by myself to throw it at. If anyone has any examples of buggy concurrency (preferably where it's tricky to provoke the bugs with conventional testing techniques) that I could use: either open bugs, or things which have been fixed but were awkward to do so, that would be really useful. This is leading up to a paper, hopefully, so examples may go into that: anonymously, if preferred. Thank you. -- Michael Walker ( _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >
Categories: Offsite Discussion

Haskell Weekly News

General haskell list - Fri, 05/15/2015 - 1:07pm
*Top Picks:* - Is Servant <>the most type-safe HTTP server library ever? Are the type signatures hard to read <>? In addition to its utmost relevance as a web library, Servant is also an awesome case study in the type safety vs type readability trade-off spectrum, brought to you by Alp Mestanogullari and Julian Arni. HN <> and /r/haskell <> - Ozan Sener compiles Pandoc into JS via GHCJS and creates a web interface to it using the Reflex FRP library <>. Markup.Rocks <> is much loved on /r/haskell <>. See also HN <>. - Is Haskell a "Startup Secret Weapon"? Ale
Categories: Incoming News

Parametricity and the difference between <*> and >>=

Haskell on Reddit - Fri, 05/15/2015 - 12:27pm

Can parametricity be used to explain the difference between (<*>) :: f (a -> b) -> f a -> f b and (>>=) :: m a -> (a -> m b) -> m b? More concretely, can it be proven that the function in f (a -> b) is always independent of the other term, while the lifted function (a -> m b) can always depend on the other term?

I want to use this to say something about the context-free-ishness of applicative parser combinators, and why it's so hard to optimize the grammar of a monadic parser combinator.

submitted by vincentrevelations
[link] [5 comments]
Categories: Incoming News

cabal is giving a weird error when attempting to install pandoc on Ubuntu 14.04

Haskell on Reddit - Fri, 05/15/2015 - 12:24pm

Hi. I am attempting to install Hakyll on my Chromebook's Ubuntu 14.04 chroot and I keep running into issues. I also ran into this problem when attempting to install on my 14.04 DigitalOcean droplet, but did not have this issue on my Manjaro install on my big PC.

My order of operations was to apt-get install haskell-platform and then cabal update and cabal install hakyll. The last command has a lot of dependencies that it attempts to install and it does work successfully, but when it gets to pandoc I get this error:

$ cabal install hakyll Resolving dependencies... [1 of 1] Compiling Main ( /tmp/pandoc-, /tmp/pandoc- ) Linking /tmp/pandoc- ... /usr/lib/ghc/unix- In function `pPrPr_disableITimers': (.text+0x300): multiple definition of `pPrPr_disableITimers' /root/.cabal/lib/unix- first defined here collect2: error: ld returned 1 exit status Failed to install pandoc- cabal: Error: some packages failed to install: hakyll- depends on pandoc- which failed to install. pandoc- failed during the configure step. The exception was: ExitFailure 1 pandoc-citeproc-0.7.1 depends on pandoc- which failed to install.

This error seems to be similar to the error in this post, but I am not really sure how to fix it. I am still getting my feet wet with Haskell in general and this is my first time using cabal to install anything (and use anything outside of the default packages).

I would appreciate it if someone could guide me on how to resolve this error. Thanks in advance.

EDIT: So I gave up on trying to fiddle around with the haskell-platform and ghc 7.6.* and whatever version of cabal that it comes with. I found this Gist describing how to install ghc 7.10.1 and cabal from source. I followed the instructions (just ran all the commands in order) and they worked on Ubuntu 14.04 perfectly.

EDIT 2: So because this whole compilation/installation process required over 1 GB of RAM, to get this running on my DigitalOcean droplet I had to shut it down and scale it up from 500 MB to 2 GB. When the process was done I scaled it back down and it appears that doing so broke ghc (I tested it right before and right after scaling it back down). I assume it will still work on my Chromebook, so I am fine if that is the case.

submitted by AIDS_Pizza
[link] [6 comments]
Categories: Incoming News

Can I specify the a in a phantom type to be limitedto a sum type?

haskell-cafe - Fri, 05/15/2015 - 7:47am
How can I create Answers of type Gender, Race, or Age? These should be possible: λ> Answer Male λ> Answer White λ> Answer Black λ> Answer 28 Others such as using a string should not be possible: λ> Answer "a string" -- should throw type error {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE StandaloneDeriving #-} module Tutorial where data Gender = Male | Female deriving (Show) data Race = White | Black deriving (Show) type Age = Int data Answer a where Answer :: Gender -> Answer Gender deriving instance Show (Answer w)
Categories: Offsite Discussion

Equality Contstraint?

haskell-cafe - Fri, 05/15/2015 - 2:17am
I am poking around in Arrow to understand it better. There is the following definition: second :: a b c -> a (d,b) (d,c) second f = arr swap >>> first f >>> arr swap where swap :: (x,y) -> (y,x) swap ~(x,y) = (y,x) Can someone explain what the ~ is? Searching the net resulted in frustration. I kind of think it is some kind of equality constraint but can’t find documentation. Perhaps if I knew what it was called I might succeed in finding something. If it is an equality constraint, please provide a reference if you have one. I did not find anything in a search including GHC, etc. Thanks
Categories: Offsite Discussion

Comparing Functions for Equality?

Haskell on Reddit - Thu, 05/14/2015 - 8:20pm

I read in A Book of Abstract Algebra, by Prof. Charles Pinter, that:

If f and g are functions from Real to Real, then f and g are equal if and only if f(x) = g(x) for every real number x.

When I tried to compare functions in ghci, I saw this compile-time error:

Prelude> let f x = "foo" Prelude> let g x = "foo" Prelude> f == g <interactive>:7:3: No instance for (Eq (t0 -> [Char])) arising from a use of `==' In the expression: f == g In an equation for `it': it = f == g

Is it simply too much work, not possible, to compare every input for the compiler? Or it's out of the compiler's scope?

submitted by kevin_meredith
[link] [19 comments]
Categories: Incoming News

Data constructor ‘Minus’ comes from an un-promotable type ‘Ints’

haskell-cafe - Thu, 05/14/2015 - 5:36pm
Hello, I clearly don’t really know what I’m doing…but at least I know it…. Here we defined the Naturals…and then attempt to construct the Integers…. naturals I can now define + and * and prove things about them…1 * x == x etc….nice..but lets put that on one side. Borrow bits and bobs from singletons Borrow bits and bobs from singletons..i.e. the isomorphic values…my proofs in nat now map to SNat…double nice. Create the integers by following my nose……(the integers are the equivalence class of pairs of naturals….) i.e. we have “positive” or “negative” or “zero”… Ok….this works as a set of values….but…. I can’t prove anything about these because the data constructors for my integers aren’t “promotable”… I cant do the same trick I did with Nat. “:k Zero” ….. Data constructor ‘Zero’ comes from an un-promotable type ‘Ints’ In a type in a GHCi command: Zero I’ve tried rejigging this in various futile and ignorant m
Categories: Offsite Discussion

Why does the inferred type of this expression change when I bind it to a varid?

Haskell on Reddit - Thu, 05/14/2015 - 4:03pm

I'd like a function that takes an Integer and gives back the number of digits in it. Here's the output from my ghci session:

GHCi, version 7.6.3: :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Prelude> :t (length . show) (length . show) :: Show a => a -> Int Prelude> let digits = length . show Prelude> :t digits digits :: () -> Int Prelude>

So, length . show has the right type on its own, but when I bind it to the name digits, it suddenly gets a much more restrictive type. What causes this, and how can I avoid it?

Sure, it works if I just specify the type I want, but I'm surprised that the type inference gets it right some of the time and wrong other times.

submitted by penguinland
[link] [5 comments]
Categories: Incoming News