News aggregator

Generalizing Kleisli-composition to arrows

Haskell on Reddit - Sun, 05/17/2015 - 9:55am

Is there a way to generalize the >=> operator from (a -> m b) -> (b -> m c) -> (a -> m c) to p a (m b) -> p b (m c) -> p a (m c) for some Category/Arrow-subclass p?

I managed to do this for ArrowChoice and Maybe using pattern matching:

infixr 9 .? (.?) :: ArrowChoice p => p b (Maybe c) -> p a (Maybe b) -> p a (Maybe c) p1 .? p2 = proc a -> do mb <- p2 -< a case mb of Just b -> p1 -< b Nothing -> returnA -< Nothing

But can this be done with >>= instead of pattern matching, in order to define this function for arbitrary monads?

submitted by pwhiddlestone
[link] [9 comments]
Categories: Incoming News

no Web-Security component in Haskell?

haskell-cafe - Sun, 05/17/2015 - 7:11am
Hallo, I did not found anything comparable to Spring Security[1][2] (Java) or Symfony Security[3] (PHP) in Haskell. Both components are used in web applications to grant or deny access to resources based on roles, ACLs or custom voters. A naive strategy would be to port the concepts of both components, which are very similar, to Haskell. They represent a lot of accumulated knowledge from many experts about web security. Or are there better ways to do web security in a powerful language like Haskell? Regards, Thomas Koch [1] http://projects.spring.io/spring-security [2] http://docs.spring.io/autorepo/docs/spring-security/3.1.7.RELEASE/apidocs [3] http://api.symfony.com/master/Symfony/Component/Security/Core/SecurityContext.html
Categories: Offsite Discussion

Looking for an equivalent to blockly for functional languages?

Haskell on Reddit - Sun, 05/17/2015 - 6:45am

Is there a blockly for functional languages? If there isn't, what would it look like?

https://developers.google.com/blockly/

submitted by TTimo
[link] [7 comments]
Categories: Incoming News

help with hsqml-demo-samples

Haskell on Reddit - Sun, 05/17/2015 - 12:06am

I want to start developing with hsQML. I spent the whole afternoon installing QT5, cabal, hsqml and setting up the sandbox. My whole goal for today was to run the factorial sample.

I can't believe I'm asking this because I feel like it should be obvious, but how do I run this? A google search doesn't show more than a handful tutorials, in fact searching 'hsqml' in this subreddit will show them all in a very short list. I already built the sample in a sandbox. If I do something like:

ghc --make src/Factorial1.hs

I get this error:

Could not find module `Paths_hsqml_demo_samples'

Is the line import Paths_hsqml_demo_samples in Factorial1.hs some sort of placeholder?

submitted by OrangePhi
[link] [2 comments]
Categories: Incoming News

The Eventual Monad

Haskell on Reddit - Sat, 05/16/2015 - 4:35pm
Categories: Incoming News

Help me change my mind about learning Haskell

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

Hi there.

I come from an OOP background: it was php, perl, python, java, ruby, scala for me. Once I've stumbled upon scala I've quickly fallen in love with proper static typing that actually helps you and after that - functional programming. I got comfortable with scalaz and some of the category concepts.

When learning scalaz and FP I've always looked at Haskell as the source of all this. I've read LYAHFTGG, but never actually tried writing code with Haskell. And I've asked myself - why is that.

I guess my reasoning is this:

  • Everything that I can think of can be done with Scala. Is there anything that Haskell can do and Scala can't?
  • I already have 3+ years of Scala experience. I'd have to start over with Haskell.
  • Haskell isn't safe haven as well. There's exceptions and head [] can still blow your program off.
  • Haskell IDE situation worries me. Intellij IDEA does a pretty good job being a Scala IDE - you can refactor, autocomplete, inspect, etc. I've tried two haskell plugins on idea and they both weren't on par feature wise.

So I've been thinking - is there even a point for me to learn Haskell? Or should I just deepen my knowledge of FP using Scala as a tool?

submitted by arturaz
[link] [47 comments]
Categories: Incoming News

lens over tea #3: folds

Haskell on Reddit - Sat, 05/16/2015 - 12:08pm
Categories: Incoming News

Philip Wadler: Summer School on DSL Design and Implementation

Planet Haskell - Sat, 05/16/2015 - 10:22am
The Scala team at EPFL is running a Summer School on DSL Design and Implementation, 12-17 July in Lausanne, Switzerland. They have a great line-up, including Martin Odersky, Tiark Rompf, Kunle Olukotun, and Matthew Flatt. I'll be there, speaking on A practical theory of language-integrated query and Quoted Domain Specific Languages: Everything old is new again.
Categories: Offsite Blogs

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="http://platform.twitter.com/widgets.js"></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.

Us

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.

You

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 matthias.fischmann@liqd.net 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 (http://worrydream.com/#!/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 >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion