News aggregator

[ANN] Bindings to the re2 regular expression library

Haskell on Reddit - Tue, 06/03/2014 - 2:45pm

Hackage: http://hackage.haskell.org/package/re2

Haddock: https://john-millikin.com/software/haskell-re2/reference/haskell-re2/latest/

re2 is a really interesting regex library. It's based on finite-state automata instead of a backtracking parser, and guarantees linear-time execution with bounded memory consumption. The author, Russ Cox, wrote an article about it at http://swtch.com/~rsc/regexp/regexp3.html

My binding is a departure from the standard Haskell regex API in that there's no giant typeclasses, no fundeps, and no operators. It's still pretty basic and there's a few features missing, but it should be usable for most common regex use cases.

The re2 syntax is documented at re2/wiki/Syntax. Here's a few examples:

$ ghci -XOverloadedStrings ghci> import Regex.RE2 ghci> find "\\w+$" "hello world" Just (Match [Just "world"]) ghci> replaceAll "([a-z]+)" "123 456 abc def" "[\\1]" ("123 456 [abc] [def]",2) submitted by jmillikin
[link] [3 comments]
Categories: Incoming News

Magnus Therning: Dealing with Microsoft Products, or Battling Loss of Gumption

Planet Haskell - Tue, 06/03/2014 - 2:37pm

I was slightly frustrated and irritated with a situation at work today, which caused me to think about the word “gumption” as it’s used in Pirsig’s Zen and the Art of Motorcycle Maintenance. That led me to Wikipedia’s article on gumption trap which in turn led me to learn about the concept of learned helplessness.

So, what was the situation and how is it connected to learned helplessness?

The rest is just slightly tongue-in-cheek

What to standardise on

I’m in situation where the powers-that-be have standardised on applications. Not on open formats or open protocols, but on specific applications that use proprietary formats and proprietary protocols. Of course these applications suck. That’s what a lack of competition does, it removes any will for a company to actually make improvements to their applications! Some of these applications have captured such a large market share that reverse engineering of the formats was inevitable. Yay! That means I can use a sane OS and vastly better applications. However, one protocol is not reverse engineered yet and I’m forced to use the standard application. This application is painful to use and only runs on a crap OS.

How bad can it be? you ask. The application is Outlook, the OS is Windows! Yes! It’s that bad. Hence the thoughts of gumption, or rather the loss of it. Which is exactly what starting Outlook causes. Every time!

Connection to learned helplessness

It continues to amaze me that companies standardise on Windows and applications that only run on Windows. There are better alternatives, especially in this day and age with fast networks and powerful and fast execution environments that completely sidestep the whole question of which OS to run. Still there seems to be very little will to upgrade to Linux, or to standardise on web-based applications. Why is that? In the past I’ve thought it might be the network effect. Most often I’ve come to the conclusion that it most likely is simple inertia. What’s the explanation for the inertia though?

This is where learned helplessness can offer an explanation. People have been conditioned and have grown so used to Windows and other Microsoft products that they simply don’t recognise that there now is a way out. No matter how many escape routes that become avilable people simply won’t see them.

What to do about it

As the experiments on dogs showed there is hope (from the wikipedia page):

To change their expectation and to recover the dogs from helplessness, experimenters had to physically pick up the dogs and move the legs in a close replication of the physical actions the dogs needed to take to remove themselves from the electrified grid. This had to be replicated at least 2 times before the dogs would exhibit the functional response of jumping over the barrier to get away from the electrified grid. Threats, rewards, and observed demonstrations had no observed effect in helping the dogs to independently move away from the shocks.

Oh how I whish I could pull off the direct translation to my work place: re-install my co-workers computers and replace servers and services. Too bad that’s not a realistic plan. What I can do though is civil disobedience (or maybe it should be called something like civil disobedience in the workplace instead). By simply not conforming and at the same time showing that there are better ways of getting the job done others will hopefully notice and either adopt my way, or come up with something that suits them better (which I then can learn from). Even if that doesn’t happen at least I’ll keep my gumption at healthy levels

What I’m doing at the moment

This is what I’m doing at work right now to avoid loss of gumption:

  • Use Linux as my main OS.
  • Run Windows in a VM.
  • Use pandoc to generate MSWord docs.
  • Use LibreOffice.

Finally, for Outlook. The decision of the powers-that-be to disable IMAP forces me to:

  • Limit my mail reading to twice per day.
  • Be logged into Skype to make up for not reading mail more often.

Categories: Offsite Blogs

Tips & tricks for speeding up builds?

Haskell on Reddit - Tue, 06/03/2014 - 12:33pm

I've noticed over the years that perhaps the biggest factor in my coding performance tends to be build and test times (even though I do spend most of my time in the REPL). Is there a guide out there for keeping your build times down with ghc? I'm trying to build an intuition for how to structure my code and how to pick language extensions in order to keep my process fast.

(P.S. One example I've noticed is files with a lot of records (schema definitions). These seem particularly slow, I suspect that -XGenerics could be one possible culprit, although that particular extension is hard to give up!)

submitted by rehno-lindeque
[link] [19 comments]
Categories: Incoming News

Hackvote, my Yesod site; code review requested

Haskell on Reddit - Tue, 06/03/2014 - 10:24am

Github: https://github.com/MaxGabriel/hackvote-yesod Site: http://yesodonrails.com/hackdays

Each month, my company has a hackday where everyone works on a project and at the end, we vote on the winner. For this month's hackday, I made the voting app we use with Yesod. Broad overview of the functionality:

  1. You can create a new hackday, naming it something like "May 30th Hackday"
  2. You can add people's projects to it
  3. Each person has 3 votes. Your remaining votes are just stored in a session—a user login model is too cumbersome for a room full of people on their phones.
  4. There's no security model right now, which is nice for showing people the site. Eventually it'd be nice to have HTTP basic auth, which we already use for things like company dashboards

I'm pretty new to both Yesod and Haskell, so any criticism is welcome. Some things I wasn't sure of:

  • Where do people put files that aren't handlers, i.e. app logic type files? In /app?
  • Where do people put model related code? I just added things to Model.hs; I guess for a bigger app I would break things out into other files and have Model.hs import them.
  • Is there a way to use the database's default values when inserting rows (for things like current time) rather than specifying them?
  • (I have alot more questions, but I'll probably move those into separate StackOverflow posts)
submitted by MaxGabriel
[link] [4 comments]
Categories: Incoming News

Free Alternative/MonadPlus?

Haskell on Reddit - Tue, 06/03/2014 - 8:52am

After multiple faulty attempts I've came upon the following Free Alternative instance:

https://gist.github.com/bosu/4fdf685091ea7e0cb26f

AFAICT, the Alternative laws hold. What am I missing?

submitted by borissu
[link] [4 comments]
Categories: Incoming News

Functional Jobs: Sr. Software Engineer at Clutch Analytics (Full-time)

Planet Haskell - Tue, 06/03/2014 - 8:37am

Position Description:

Windhaven Insurance is seeking an experienced Software Engineer to join a small elite team who are disrupting the auto insurance industry with innovative technology. You will work in a startup atmosphere as part of a subsidiary of a rapidly growing larger company. This means that along with programming, you’ll have a hand in the larger issues, such as product architecture and direction.

Required:

  • Someone who knows at least one functional language such as: Elixir, Erlang, Lisp, Scheme, Haskell, ML, Clojure, Racket, Ocaml or F#
  • Someone who ENGAGES a.k.a “gives a damn” about what we do and how technology can help make us more competitive in the marketplace.
  • Someone who COLLABORATES. We have the flattest organization in the industry designed with one main goal – the TEAM. Are you hungry to make a significant impact in the tech world?
  • Someone who RESPECTS Teammates, customers and the community.

Special Requirements:

You need to have made an achievement, in any field, of significance worth talking about, that required grit, determination and skill. This can be a personal achievement that few know about, or it could have gotten coverage by the media. It doesn’t matter, what does matter is some demonstration of grit, determination and skill. If it can be described succinctly, please describe the achievement in your cover letter, if not, be prepared to tell us all about it during the interview.

Professional & Technical Qualifications:

  • Experience with languages such as Elixir or Erlang
  • Experience with Ember.js (or Angular.js)
  • Experience with NoSQL data stores, such as Couchbase, Riak, etc.
  • DevOps experience a plus
  • Ability to explain technical issues and recommend solutions
  • Strong team player with a high degree of flexibility
  • Excellent verbal and written communication skills

Get information on how to apply for this position.

Categories: Offsite Blogs

Tags - HaskellWiki

del.icio.us/haskell - Tue, 06/03/2014 - 5:46am
Categories: Offsite Blogs

Tags - HaskellWiki

del.icio.us/haskell - Tue, 06/03/2014 - 5:46am
Categories: Offsite Blogs

Comonads in Haskell

Haskell on Reddit - Tue, 06/03/2014 - 4:30am
Categories: Incoming News

Apple Introduces Swift

Lambda the Ultimate - Mon, 06/02/2014 - 1:53pm

Apple today announced a new programming language for their next version of Mac OS X and iOS called Swift.

The Language Guide has more details about the potpourri of language features.

Categories: Offsite Discussion