News aggregator

Origin of "(Learn|Write) You(rself)? (a|an|Some) [language]" idiom?

Haskell on Reddit - Fri, 09/04/2015 - 7:15am

There are a number of instructional programming works out there with names that match this pattern (e.g. Learn You a Haskell for Great Good!, Write Yourself a Scheme in 48 Hours, Learn You Some Erlang for Great Good!, Learn You an Agda And Achieve Enlightenment). Amusingly, Google search suggestions seem to indicate that people sometimes extrapolate from it and search for "Learn You an Idris" or "Learn You an OCaml", neither of which actually exists. Given that the examples I've been able to find all come from functional languages, and given that the author of Learn You Some Erlang says that he was inspired by LYAH, it seems like this fashion may have started with Haskell. This StackExchange thread seems to corroborate, with the first answer mentioning that it may have come from the movie Borat. Does anyone have more definitive or detailed information about this?

submitted by hexbienium
[link] [25 comments]
Categories: Incoming News

Constrained monads

Haskell on Reddit - Fri, 09/04/2015 - 5:54am
Categories: Incoming News

Could anyone critique the interface of my first Haskell library?

Haskell on Reddit - Fri, 09/04/2015 - 4:44am

Could anyone give some feedback on the interface of the first Haskell library I have written?

I’m concerned about two things:

  1. I return values in a MonadReader so that the config does not need to be passed in on every call by the client. This is useful if the client needs to make multiple requests, but I suspect they will often only need to make 1. Do you think I should have two versions of these functions: one in the reader monad, and one that takes the config as an argument?

  2. I’m not sure how to lay out the modules for the monad/typeclasses and data declarations. At the moment they are in Control.Monad.Pusher and Data.Pusher, but should all the library modules be under the single module: Network.Pusher?

Let me know if you have any other comments. Thanks!

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

Turning the database inside out

Haskell on Reddit - Fri, 09/04/2015 - 4:40am

I recently stumbled upon this post and this video about systems architecture. Even though the video is old and not strictly related to Haskell, i find it relevant for this channel and for the Haskell community in general. Sometimes we spend time catching up with systems which are old in their design anyway, while being creative is one of the things that pushes a community forward. I use CouchDB every day in hard development conditions at eHealth Africa and it helped us enormously with its essential and robust design, which i believe is inspired by the concepts presented in the video. Maybe the next revolutionary database will be written in Haskell? ;)

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

Docs for packages installed with stack

Haskell on Reddit - Thu, 09/03/2015 - 11:45pm

Could someone please tell me where can I find the documentation for the packages installed with stack? I did a stack path but did not find any path for the documentation.

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

Douglas M. Auclair (geophf): 1Liners August 2015

Planet Haskell - Thu, 09/03/2015 - 5:21pm
  • August 20th, 2015: Okay this: \(a,b) -> foo a b c d e Somehow curry-i-tize the above expression (make a and b go away!) Is this Applicative?
    • JP @japesinator uncurry $ flip flip e . flip flip d . flip flip c . foo
    • Conor McBride @pigworker (|foo fst snd (|c|) (|d|) (|e|)|)
  • August 19th, 2015: points-free define unintify: unintify :: (Int, Int) -> (Float, Float) where unintify (a,b) = (fromIntegral a, fromIntegral b)
  • August 19th, 2015: points-free define timeser: timeser :: (Float, Float) -> (Float, Float) -> (Float, Float) where timeser (a,b) (c,d) = (a*c, b*d)
  • August 18th, 2015: foo :: (Float, Float) -> (Float, Float) -> Int -> (Float, Float) points-free if: foo (a,b) (c,d) e = ((c-a)/e, (d-b)/e) Arrows? Bimaps?
Categories: Offsite Blogs

Douglas M. Auclair (geophf): 1Liners July 2015

Planet Haskell - Thu, 09/03/2015 - 5:18pm
  • July 29th, 2015: ... on a roll: Point-free-itize
    foo :: (a -> b, a -> b) -> (a, a) -> (b, b)
    foo (f,g) (x,y) = (f x, g y)
    • \[ c^3 \] @das_kube uncurry (***)
  • July 29th, 2015: I can't believe this wasn't a #1Liner already. Point-free-itize dup:
    dup :: a -> (a,a)
    dup x = (x,x)
    • Antonio Nikishaev @lelff join (,)
    • \[ c^3 \] @das_kube id &&& id
  • July 23rd, 2015: define pairsies so that, e.g.: pairsies [1,2,3] = {{1, 2}, {1, 3}, {2, 3}} pairsies :: [a] -> Set (Set a)
    • pairsies list = concat (list =>> (head &&& tail >>> sequence))
  • July 23rd, 2015: define both :: (a -> b) -> (a,a) -> (b,b)
    • Chris Copeland @chrisncopeland point-freer: both = uncurry . on (,)
    • Brian McKenna @puffnfresh both = join bimap
  • July 23rd, 2015: point-free-itize: gen :: Monad m => (m a, m b) -> m (a, b)
    • Bob Ippolito @etrepum gen = uncurry (liftM2 (,))
  • July 17th, 2015: You may have seen this before, but here we go. point-free-itize swap:
    swap :: (a,b) -> (b,a)
Categories: Offsite Blogs

Douglas M. Auclair (geophf): 1Liners Pre-July 2015

Planet Haskell - Thu, 09/03/2015 - 5:13pm
  • Point-free define: foo :: (Ord a, Ord b) => [([a], [b])] -> (Set a, Set b)
    • Андреев Кирилл @nonaem00 foo = (Set.fromList . concat *** Set.fromList . concat) . unzip
  • point-free-itize computeTotalWithTax :: Num b => ((a, b), b) -> b computeTotalWithTax ((a, b), c) = b + c
  • point-free-itize foo (k,v) m = Map.insert k b m with obvs types for k, v, and m.
  • point-free-itize: shower :: forall a. forall b. Show a => [b -> a] -> b -> [a] shower fns thing = map (app . flip (,) thing) fns
  • row :: String -> (Item, (USD, Measure)) given csv :: String -> [String] and line is = "apple,$1.99 Lb" hint: words "a b" = ["a","b"] ... all types mentioned above are in today's @1HaskellADay problem at
  • For Read a, point-free-itize: f a list = read a:list (f is used in a foldr-expression)
    • Or you could just do: map read
  • point-free-itize f such that: f a b c = a + b + c
Categories: Offsite Blogs

platform 2014.2.0.0 for Windows

haskell-cafe - Thu, 09/03/2015 - 1:54pm
Where do I download Haskell Platform 2014.2.0.0 for Windows? - the current (new?) Haskell Platform page doesn't link to old versions anymore (I want to build wxHaskell 0.92, but I gather it doesn't build with ghc 7.10 right now) Andrew Butterfield School of Computer Science & Statistics Trinity College Dublin 2, Ireland
Categories: Offsite Discussion

Trying to learn Haskell, but where is the standard API documentation?

Haskell on Reddit - Thu, 09/03/2015 - 9:47am

Obviously coming from Java background here, API might even be wrong term. Anyways, what I'm looking for is something exactly like this:

Meanwhile in Haskell docs page there is nothing like that. Stackoverflow answers suggest Hoogle, but I'd rather just look at a list of functions thanks.

submitted by mergem
[link] [16 comments]
Categories: Incoming News

Roadmap to better database bindings?

Haskell on Reddit - Thu, 09/03/2015 - 9:35am

In the ICFP 2015 talk 04 An Optimizing Compiler for a Purely Functional Web Application Language a comment was made at end that one reason Haskell performs poorly in web benchmarks is because of its database binding libraries.

What needs to be done to improve this situation?

The comment occurs approx 15m into the talk:

submitted by mn-haskell-guy
[link] [15 comments]
Categories: Incoming News

Felipe Almeida Lessa: Using Caps Lock as Menu/Apps keys on Emacs

Planet Haskell - Thu, 09/03/2015 - 9:28am

I’m an ergoemacs-mode user, a mode that changes most key bindings so that they put less strain on your hands.  For example, it uses Alt instead of Ctrl most of the time, which is easier to press: use your curled thumb instead of a karate chop.  Also, many commands are activated by first pressing the Menu/Apps key (that key near the Right Ctrl which usually opens the context menu).  For example, pressing Menu then T allows you to switch buffers.

However, the keyboard on my new notebook doesn’t have a dedicated Menu key.  Instead, one needs to press Fn+Right Ctrl, which is of course extremely painful.

Menu key hidden on the Right Ctrl.


I’ve found a workaround, though.  A very hackish workaround.

The ergoemacs-mode FAQ suggests using Caps Lock as a Menu/Apps key for Mac users.  Using xmodmap it’s trivial to make Caps Lock a Menu key:

$ xmodmap -e "keycode 66 = Menu"

However, using xmodmap properly with Gnome is nigh impossible.  It’s recommend to use xkb instead, but xkb doesn’t support mapping Caps Lock to the Menu key out-of-the-box (at least not yet).  At this point, having wandered through many documentation pages, I’ve decided to try using some of the xkb options that already exist.

At first I tried setting Caps Lock as the Hyper key.  However, by default the Hyper key gets the same modifier code as the Super key (which is usually the key with the Windows logo).  There’s a straightforward way of separating them, but I couldn’t find a way to make it play nice with Gnome.  And even if I could, it’s not clear to me if I could use the Hyper key as a substitute for the Menu key on emacs.

When ready to admit defeat, I’ve set the Caps Lock behavior to “Caps Lock is disabled” in preparation of trying a hack using xmodmap.  Much to my surprise, I accidentally discovered that emacs then began treating the disabled Caps Lock key as <VoidSymbol>! The gears started turning in my head, then I added the following line to my ~/.emacs file:

(define-key key-translation-map (kbd "<VoidSymbol>") (kbd "<menu>"))

Surprisingly, it worked!  Now pressing Caps Lock then T will switch buffers, for example.  As a bonus, pressing Caps Lock accidentally while on another application won’t do anything.

It’s not clear to me how fragile this hack really is.  I’ll update this blog post if I ever find some drawback to it.  But right now it seems to work quite nicely.

Categories: Offsite Blogs

ETAPS 2016 2nd call for papers

General haskell list - Thu, 09/03/2015 - 7:34am
****************************************************************** CALL FOR PAPERS: ETAPS 2016 19th European Joint Conferences on Theory And Practice of Software Eindhoven, The Netherlands, 2-8 April 2016 ******************************************************************
Categories: Incoming News