Another Word For It Patrick Durusau on Topic Maps and Semantic Diversity

November 4, 2014

Mapping Out Lambda Land:…

Filed under: Functional Programming,Programming — Patrick Durusau @ 10:51 am

Mapping Out Lambda Land: An Introduction to Functional Programming by Katie Miller.

From the post:

Anyone who has met me will probably know that I am wildly enthusiastic about functional programming (FP). I co-founded a group for women in FP, have presented a series of talks and workshops about functional concepts, and have even been known to create lambda-branded clothing and jewellery. In this blog post, I will try to give some insight into what the fuss is about. I will briefly explain what functional programming is, why you should care, and how you can use OpenShift to learn more about FP.

Good introduction to functional programming and resources on using OpenShift to learn FP.

Just in case you don’t recognize the name, Katie is the author of Lingo of Lamda Land, a poem depending on who is reading it.

October 31, 2014

COMMON LISP: An Interactive Approach

Filed under: Functional Programming,Lisp — Patrick Durusau @ 4:25 pm

COMMON LISP: An Interactive Approach by Stuart C. Shapiro.

From the preface:

Lisp is the language of choice for work in artificial intelligence and in symbolic algebra. It is also important in the study of programming languages, because, since its inception over thirty years ago, it has had full recursion, the conditional expression, the equivalence of program and data structure, its own evaluator available to the programmer, and extensibility—the syntactic indistinguishability of programmer-defined functions and “built-in” operators. It is also the paradigm of “functional,” or “applicative,” programming. Because of the varied interests in Lisp, I have tried to present it in a general and neutral setting, rather than specifically in the context of any of the special fields in which it is used.

Although published in 1992, this book remains quite relevant today. How many languages can you name that have with equivalence of program and data structure? Yes, that’s what I thought.

Notes from CSE 202 (2002) are available along with Stuart C. Shapiro & David R. Pierce, A Short Course in Common Lisp (2004).

October 28, 2014

Datomic Pull API

Filed under: Clojure,Datomic,Functional Programming,Programming — Patrick Durusau @ 7:19 pm

Datomic Pull API by Stuart Holloway.

From the post:

Datomic‘s new Pull API is a declarative way to make hierarchical selections of information about entities. You supply a pattern to specify which attributes of the entity (and nested entities) you want to pull, and db.pull returns a map for each entity.

Pull API vs. Entity API

The Pull API has two important advantages over the existing Entity API:

Pull uses a declarative, data-driven spec, whereas Entity encourages building results via code. Data-driven specs are easier to build, compose, transmit and store. Pull patterns are smaller than entity code that does the same job, and can be easier to understand and maintain.

Pull API results match standard collection interfaces (e.g. Java maps) in programming languages, where Entity results do not. This eliminates the need for an additional allocation/transformation step per entity.

A sign that it is time to catch up on what has been happening with Datomic!

Category Theory for Programmers: The Preface

Filed under: Category Theory,Functional Programming,Programming — Patrick Durusau @ 6:33 pm

Category Theory for Programmers: The Preface by Bartosz Milewski.

From the post:

For some time now I’ve been floating the idea of writing a book about category theory that would be targeted at programmers. Mind you, not computer scientists but programmers — engineers rather than scientists. I know this sounds crazy and I am properly scared. I can’t deny that there is a huge gap between science and engineering because I have worked on both sides of the divide. But I’ve always felt a very strong compulsion to explain things. I have tremendous admiration for Richard Feynman who was the master of simple explanations. I know I’m no Feynman, but I will try my best. I’m starting by publishing this preface — which is supposed to motivate the reader to learn category theory — in hopes of starting a discussion and soliciting feedback.

I will attempt, in the space of a few paragraphs, to convince you that this book is written for you, and whatever objections you might have to learning one of the most abstracts branches of mathematics in your “copious spare time” are totally unfounded.

My optimism is based on several observations. First, category theory is a treasure trove of extremely useful programming ideas. Haskell programmers have been tapping this resource for a long time, and the ideas are slowly percolating into other languages, but this process is too slow. We need to speed it up.

Second, there are many different kinds of math, and they appeal to different audiences. You might be allergic to calculus or algebra, but it doesn’t mean you won’t enjoy category theory. I would go as far as to argue that category theory is the kind of math that is particularly well suited for the minds of programmers. That’s because category theory — rather than dealing with particulars — deals with structure. It deals with the kind of structure that makes programs composable.

Composition is at the very root of category theory — it’s part of the definition of the category itself. And I will argue strongly that composition is the essence of programming. We’ve been composing things forever, long before some great engineer came up with the idea of a subroutine. Some time ago the principles of structural programming revolutionized programming because they made blocks of code composable. Then came object oriented programming, which is all about composing objects. Functional programming is not only about composing functions and algebraic data structures — it makes concurrency composable — something that’s virtually impossible with other programming paradigms.

See the rest of the preface and the promise to provide examples in code for most major concepts.

Are you ready for discussion and feedback?

October 18, 2014

Tupleware: Redefining Modern Analytics

Filed under: Distributed Computing,Functional Programming — Patrick Durusau @ 8:09 pm

Tupleware: Redefining Modern Analytics by Andrew Crotty and Alexander Galakatos.

From the post:

Up until a decade ago, most companies sufficed with simple statistics and offline reporting, relying on traditional database management systems (DBMSs) to meet their basic business intelligence needs. This model prevailed in a time when data was small and analysis was simple.

But data has gone from being scarce to superabundant, and now companies want to leverage this wealth of information in order to make smarter business decisions. This data explosion has given rise to a host of new analytics platforms aimed at flexible processing in the cloud. Well-known systems like Hadoop and Spark are built upon the MapReduce paradigm and fulfill a role beyond the capabilities of traditional DBMSs. However, these systems are engineered for deployment on hundreds or thousands of cheap commodity machines, but non-tech companies like banks or retailers rarely operate clusters larger than a few dozen nodes. Analytics platforms, then, should no longer be built specifically to accommodate the bottlenecks of large cloud deployments, focusing instead on small clusters with more reliable hardware.

Furthermore, computational complexity is rapidly increasing, as companies seek to incorporate advanced data mining and probabilistic models into their business intelligence repertoire. Users commonly express these types of tasks as a workflow of user-defined functions (UDFs), and they want the ability to compose jobs in their favorite programming language. Yet, existing analytics systems fail to adequately serve this new generation of highly complex, UDF-centric jobs, especially when companies have limited resources or require sub-second response times. So what is the next logical step?

It’s time for a new breed of systems. In particular, a platform geared toward modern analytics needs the ability to (1) concisely express complex workflows, (2) optimize specifically for UDFs, and (3) leverage the characteristics of the underlying hardware. To meet these requirements, the Database Group at Brown University is developing Tupleware, a parallel high-performance UDF processing system that considers the data, computations, and hardware together to produce results as efficiently as possible.

The article is the “lite” introduction to Tuppleware. You may be more interested in:

Tupleware: Redefining Modern Analytics (the paper):

Abstract:

There is a fundamental discrepancy between the targeted and actual users of current analytics frameworks. Most systems are designed for the data and infrastructure of the Googles and Facebooks of the world—petabytes of data distributed across large cloud deployments consisting of thousands of cheap commodity machines. Yet, the vast majority of users operate clusters ranging from a few to a few dozen nodes, analyze relatively small datasets of up to several terabytes, and perform primarily compute-intensive operations. Targeting these users fundamentally changes the way we should build analytics systems.

This paper describes the design of Tupleware, a new system specifically aimed at the challenges faced by the typical user. Tupleware’s architecture brings together ideas from the database, compiler, and programming languages communities to create a powerful end-to-end solution for data analysis. We propose novel techniques that consider the data, computations, and hardware together to achieve maximum performance on a case-by-case basis. Our experimental evaluation quantifies the impact of our novel techniques and shows orders of magnitude performance improvement over alternative systems.

Subject to the “in memory” limitation, speedups of 10 – 6,000x over other systems are nothing to dismiss without further consideration.

Interesting to see that “medium” data now reaches into the terabyte range. 😉

Are “mini-clouds” in the offing that provide specialized processing models?

The Tuppleware website.

I first saw this in a post by Danny Bickson, Tuppleware.

October 15, 2014

Inductive Graph Representations in Idris

Filed under: Functional Programming,Graphs,Types — Patrick Durusau @ 8:54 am

Inductive Graph Representations in Idris by Michael R. Bernstein.

An early exploration on Inductive Graphs and Functional Graph Algorithms by Martin Erwig.

Abstract (of Erwig’s paper):

We propose a new style of writing graph algorithms in functional languages which is based on an alternative view of graphs as inductively defined data types. We show how this graph model can be implemented efficiently and then we demonstrate how graph algorithms can be succinctly given by recursive function definitions based on the inductive graph view. We also regard this as a contribution to the teaching of algorithms and data structures in functional languages since we can use the functional-graph algorithms instead of the imperative algorithms that are dominant today.

You can follow Michael at: @mrb_bk or https://github.com/mrb or his blog: http://michaelrbernste.in/.

More details on Idris: A Language With Dependent Types.

October 9, 2014

These aren’t the reducing functions you are looking for

Filed under: Clojure,Functional Programming,Programming — Patrick Durusau @ 7:06 pm

These aren’t the reducing functions you are looking for by Christophe Grand.

From the post:

Transducers are powerful and easy to grasp when they claim they transform reducing functions. However once you scratch their surface you quickly realize that’s not their true nature: they transform stateful processes.

In a previous post, I explained why seeded transduce forces transducers to return stateful reducing functions. However this can be fixed. The current implementation of transduce reads:

Heavy sledding but the leading edge always is. Relevance depends on your need for/dedication to advancing a paradigm.

I first saw this in a tweet by Johnathan Winandy.

2014 State of Clojure & ClojureScript Survey

Filed under: Clojure,ClojureScript,Conferences,Functional Programming — Patrick Durusau @ 6:44 pm

2014 State of Clojure & ClojureScript Survey by Alex Miller.

From the post:

For the past four years, Chas Emerick has run an annual State of Clojure survey (expanded last year to cover ClojureScript as well). Due to recent happy arrivals in the Emerick household, Chas has asked Cognitect to run the survey this year.

The survey has been broken into two parts. A link to the second survey will appear after you submit the first, or you can use these links directly:

The surveys will be open until October 17th. Shortly thereafter we will release all of the data and some analysis.

If you’re not yet planning to attend the Clojure/conj in Washington DC, Nov 20-22, tickets are on sale now (regular registration rate ends Oct. 17th)!

Summary:

Two Important Dates:

Oct. 17th – Deadline for State of Clojure/ClojureScript 2014 surveys and regular registration for Clojure/conj.

Nov. 20-22Clojure/conj in Washington, DC.

Avoid entering Oct. 17th in your calendar by completing the surveys and purchasing your ticket to Clojure/conj after reading this post.

September 30, 2014

Lingo of Lambda Land

Filed under: Functional Programming,Semantics — Patrick Durusau @ 3:26 pm

Lingo of Lambda Land by Katie Miller.

From the post:

Comonads, currying, compose, and closures
This is the language of functional coders
Equational reasoning, tail recursion
Lambdas and lenses and effect aversion
Referential transparency and pure functions
Pattern matching for ADT deconstructions
Functors, folds, functions that are first class
Monoids and monads, it’s all in the type class
Infinite lists, so long as they’re lazy
Return an Option or just call it Maybe
Polymorphism and those higher kinds
Monad transformers, return and bind
Catamorphisms, like from Category Theory
You could use an Either type for your query
Arrows, applicatives, continuations
IO actions and partial applications
Higher-order functions and dependent types
Bijection and bottom, in a way that’s polite
Programming of a much higher order
Can be found just around the jargon corner

I posted about Kate Miller’s presentation, Coder Decoder: Functional Programmer Lingo Explained, with Pictures but wanted to draw your attention to the poem she wrote to start the presentation.

In part because it is an amusing poem but also for you to attempt an experiment that Stanley Fish reports on interpretation of poems.

Stanley’s experiment is recounted in “How to Recognize a Poem When You See One,” which appears as chapter 14 in Is There A Text In This Class? The Authority of Interpretative Communities by Stanley Fish.

As functional programmers or wannabe functional programmers, you are probably not the “right” audience for this experiment. (But, feel free to try it.)

Stanley’s experiment came about from a list of authors given to one class, centered on a blackboard (yes, many years ago) to which, for the second class, Stanley drew a box around the list of names and inserted “p. 43” on the board. Those were the only changes between the classes.

The second class was one on interpretation of religious poetry and they were instructed this list was a religious poem and they should being applied the techniques learned in the class to its interpretation.

Stanley’s account of this experiment is masterful and I urge you to read his account in full.

At the same time, you will learn a lot about semantics if you ask a poetry professor to have one of their classes produce an interpretation of this poem. You will discover that “not knowing the meaning of the terms” is no barrier to the production of an interpretation. Sit in the back of the classroom and don’t betray the experiment by offering explanations of the terms.

The question to ask yourself at the end of the experiment is: Where did the semantics of the poem originate? Did Katie Miller imbue it with semantics that would be known to all readers? Or do the terms themselves carry semantics and Katie just selected them? If either answer is yes, how did the poetry class arrive at its rather divergent and colorful explanation of the poem?

Hmmm, if you were scanning this text with a parser, whose semantics would your parser attribute to the text? Katie’s? Any programmers? The class’?

Worthwhile to remember that data processing chooses “a” semantic, not “the” semantic in any given situation.

Coder Decoder: Functional Programmer Lingo Explained, with Pictures

Filed under: Functional Programming,Haskell — Patrick Durusau @ 2:51 pm

by Katie Miller.

From the description:

For the uninitiated, a conversation with functional programmers can feel like ground zero of a jargon explosion. This talk will help you to defend against the blah-blah blast by demystifying several terms commonly used by FP fans with bite-sized Haskell examples and friendly pictures. The presentation will also offer a glimpse of how some of these concepts can be applied in a simple Haskell web application. Expect appearances by Curry, Lens, and the infamous M-word, among others.

Slides: http://decoder.codemiller.com/#/

Haskell demo source code: https://github.com/codemiller/wubble

Informative and entertaining presentation on functional programming lingo.

Not all functional programming lingo, but enough to make you wish your presentations were this clear.

Clojure Cup 2014 – Voting Ends October 06 23:59 UTC

Filed under: Clojure,ClojureScript,Functional Programming — Patrick Durusau @ 10:17 am

Clojure Cup 2014 – Voting Ends October 06 23:59 UTC

From the webpage:

Here are the apps competing in Clojure Cup 2014. You may vote for as many of them as you like, using your Twitter account. At the end of the voting period the App with the most votes will receive the Public Favorite award.

Voting ends October 06 23:59 UTC

Don’t bother trying to discern your local time from 23:59 UTC. Vote as soon as you read this post!

If you want to encourage functional programming in general and Clojure in particular, vote for your favorite.

Looking at the prizes, you will want to start working on your Clojure chops for Clojure Cup 2015!

September 25, 2014

Clojure in Unity 3D: Functional Video Game Development

Filed under: Clojure,Functional Programming,Games,Programming — Patrick Durusau @ 10:17 am

Clojure in Unity 3D: Functional Video Game Development by Ramsey Nasser and Tims Gardner.

I had never considered computer games from this perspective:

You have to solve every hard problem in computer science, 60 times a second. Brandon Bloom.

Great presentation, in part because of its focus on demonstrating results. Interested viewers left to consult the code for the details.

Combines Clojure with Unity (a game engine) that can export to PS4.

Is being enjoyable the primary difference between video games and most program interfaces?

A project to watch!

Useful links:

http://github.com/clojure-unity

@timsgardner , Tims Gardner

@ra , Ramsey Nasser, http://nas.sr/

@jplur_ , Joseph Parker, http://selfsamegames.com/

Unity (Game Engine) (Windows/Mac OS)

PS: I need to get a PS4 in order to track game development with Clojure. If you want to donate one to that cause, contact me for a shipping address.

I won’t spend countless hours playing games that are not Clojure related. I am juggling enough roles without adding any fantasy (computer-based anyway) ones. 😉

September 20, 2014

Transducers

Filed under: Clojure,Functional Programming — Patrick Durusau @ 7:06 pm

Transducers by Rich Hickey. (Strange Loop, 2014)

Rich has another go at explaining transducers at Strange Loop 2014.

You may want to look at Felienne’s Hermans live blog on the presentation: Transducers – Rich Hickey

I first saw Rich’s video in a tweet by Michael Klishin.

September 17, 2014

Convince your boss to use Clojure

Filed under: Clojure,Functional Programming,Marketing — Patrick Durusau @ 7:18 pm

Convince your boss to use Clojure by Eric Normand.

From the post:

Do you want to get paid to write Clojure? Let’s face it. Clojure is fun, productive, and more concise than many languages. And probably more concise than the one you’re using at work, especially if you are working in a large company. You might code on Clojure at home. Or maybe you want to get started in Clojure but don’t have time if it’s not for work.

One way to get paid for doing Clojure is to introduce Clojure into your current job. I’ve compiled a bunch of resources for getting Clojure into your company.

Take these resources and do your homework. Bringing a new language into an existing company is not easy. I’ve summarized some of the points that stood out to me, but the resources are excellent so please have a look yourself.

Great strategy and list of resources for Clojure folks.

How would you adapt this strategy to topic maps and what resources are we missing?

I first saw this in a tweet by Christophe Lalanne.

Stuff Goes Bad: Erlang in Anger

Filed under: Erlang,Functional Programming,Programming — Patrick Durusau @ 6:37 pm

Stuff Goes Bad: Erlang in Anger by Fred Herbert.

From the webpage:

This book intends to be a little guide about how to be the Erlang medic in a time of war. It is first and foremost a collection of tips and tricks to help understand where failures come from, and a dictionary of different code snippets and practices that helped developers debug production systems that were built in Erlang.

From the introduction:

This book is not for beginners. There is a gap left between most tutorials, books, training sessions, and actually being able to operate, diagnose, and debug running systems once they’ve made it to production. There’s a fumbling phase implicit to a programmer’s learning of a new language and environment where they just have to figure how to get out of the guidelines and step into the real world, with the community that goes with it.

This book assumes that the reader is proficient in basic Erlang and the OTP framework. Erlang/OTP features are explained as I see fit — usually when I consider them tricky — and it is expected that a reader who feels confused by usual Erlang/OTP material will have an idea of where to look for explanations if necessary.

What is not necessarily assumed is that the reader knows how to debug Erlang software, dive into an existing code base, diagnose issues, or has an idea of the best practices about deploying Erlang in a production environment. (footnote numbers omitted)

With exercises no less.

Reminds me of a book I had some years ago on causing and then debugging Solr core dumps. 😉 I don’t think it was ever a best seller but it was a fun read.

Great title by the way.

I first saw this in a tweet by Chris Meiklejean.

September 5, 2014

International Conference on Functional Programming 2014 – Update

Filed under: Functional Programming,Haskell — Patrick Durusau @ 4:28 pm

International Conference on Functional Programming 2014 – Paper and Videos by yallop.

Links to papers and videos for ICFP 2014.

As an added bonus, links to:

ICFP 2012

ICFP 2013

Haskell 2014 accepted papers

PLDI 2014 accepted papers

Just in time for the weekend!

I first saw this in a tweet by Alejandro Cabrera.

September 4, 2014

T3TROS (ClojureScript)

Filed under: Clojure,ClojureScript,Functional Programming,Games — Patrick Durusau @ 6:00 pm

T3TROS (ClojureScript)

From the webpage:

We are re-creating Tetris™ in ClojureScript. We are mainly doing this to produce the pleasure and to celebrate the 30th anniversary of its original release in 1984. Our remake will enable us to host a small, local tournament and to share a montage of the game’s history, with each level resembling a different version from its past. (We are working on the game at least once a week):

  • DevBlog 1 – data, collision, rotation, drawing
  • DevBlog 2 – basic piece control
  • DevBlog 3 – gravity, stack, collapse, hard-drop
  • DevBlog 4 – ghost piece, flash before collapse
  • DevBlog 5 – game over animation, score
  • DevBlog 6 – level speeds, fluid drop, improve collapse animation, etc.
  • DevBlog 7 – draw next piece, tilemap for themes
  • DevBlog 8 – allow connected tiles for richer graphics
  • DevBlog 9 – live board broadcasting
  • DevBlog 10 – chat room, more tilemaps, page layouts
  • DevBlog 11 – page routing, username

What could possibly go wrong with an additive video game as the target of a programming exercise? 😉

Shaun LeBron has posted Interactive Guide to Tetrix in ClojureScript.

The interactive guide is very helpful!

Will echoes of Tetris™ tempt you into functional programming? What video classics will you produce?

August 28, 2014

SICP Distilled (Clojure)

Filed under: Clojure,Functional Programming,Scheme — Patrick Durusau @ 10:36 am

SICP Distilled (Clojure) by Tom Hall.

Tom has started a Kickstarter campaign to finance the authoring of a Cloure-based companion to SICP.

A companion which Tom describes as:

As the book [SICP] itself is available online for free I want to make the perfect accompaniment to it – an ebook summarising the key ideas, short videos describing them, screencasts of solving some of the exercises, translation of the examples into Clojure, example projects, partial solutions for you to complete (similar to 4clojure and Clojure koans) and a place to discuss solving them with people.

Project will be funded on Tue, Sept. 16, 2014 4:12 EDT.

This should be enough notice for even the most disorganized of us to pledge in support of SICP Distilled (Clojure).

Please pass this along, tweet, re-post, etc.

August 26, 2014

Abstraction, intuition,…

Filed under: Functional Programming,Monads,Teaching — Patrick Durusau @ 3:02 pm

Abstraction, intuition, and the “monad tutorial fallacy” by Brent Yorgey.

From the post:

While working on an article for the Monad.Reader, I’ve had the opportunity to think about how people learn and gain intuition for abstraction, and the implications for pedagogy. The heart of the matter is that people begin with the concrete, and move to the abstract. Humans are very good at pattern recognition, so this is a natural progression. By examining concrete objects in detail, one begins to notice similarities and patterns, until one comes to understand on a more abstract, intuitive level. This is why it’s such good pedagogical practice to demonstrate examples of concepts you are trying to teach. It’s particularly important to note that this process doesn’t change even when one is presented with the abstraction up front! For example, when presented with a mathematical definition for the first time, most people (me included) don’t “get it” immediately: it is only after examining some specific instances of the definition, and working through the implications of the definition in detail, that one begins to appreciate the definition and gain an understanding of what it “really says.”

Unfortunately, there is a whole cottage industry of monad tutorials that get this wrong….

It isn’t often that you see a blog post from 2009 that is getting comments in 2014!

I take the post to be more about pedagogy than monads but there are plenty of pointers to monad tutorials in the comments.

Another post mentioned in the comments that you may find useful: Developing Your Intuition For Math by Kalid Azad.

What if you ran a presentation from back to front? Started with concrete examples of your solution in action in multiple cases. Explain the cases. Extract the common paths or patterns. Then run out of time before you can repeat what everyone already knows about the area? Would that work?

The Hitchhiker’s Guide to…

Filed under: Clojure,Functional Programming,Haskell,Lisp — Patrick Durusau @ 2:06 pm

The Hitchhiker’s Guide to the Curry-Howard Correspondence by Chris Ford.

From the description:

Slides can be found here: speakerdeck.com/ctford/the-hitchikers-guide-to-the-curry-howard-correspondence

Functions are proofs. Um, I can see how that might work. Go on.

Types are propositions. Really? In what sense?

In fact, a function is the proof of the proposition its type represents. Woah, you’ve lose me now.

Don’t Panic!

The Curry-Howard Correspondence is an elegant bridge between the planet of logic and the planet of programming, and it’s not actually that hard to understand.

In this talk I’ll use the Idris dependently-typed functional programming language for examples, as its type system is sophisticated enough to construct interesting automated proofs simply by writing functions. This talk is not designed to convert you into a theoretical computer scientist, but to share with you a wonderful sight in your journey through the vast and peculiar universe of programming.

A familiarity with functional programming would be useful for appreciating this talk, but it will not require any significant prior study of theoretical computer science.

Great presentation by Chris Ford at EuroClojure!

The only problem I had was coordinating the slides, which aren’t very visible in the presentation, with the slide deck you can download.

Definitely a watch more than once video.

Enjoy!

Useful links (references in the slides):

Edwin Brady, Indris

Edwin Brady, Programming in Indris: A Tutorial

Brian McKenna, EvenOdd in Agda, Idris, Haskell, Scala

Philip Wadler, Propositions as Types (Updated, June 2014)

August 25, 2014

Desperately Seeking Algorithms!

Filed under: Algorithms,Clojure,Functional Programming — Patrick Durusau @ 2:33 pm

I don’t know for sure that Christophe Grand is “desperately” seeking algorithms but he has tweeted a request for “favorite algorithms” to be cast into posts similar to:

Tarjan’s strongly connected components algorithm

I dislike algorithms that are full of indices and mutations. Not because they are bad but because I always have the feeling that the core idea is buried. As such, Tarjan’s SCC algorithm irked me.

So I took the traditional algorithm, implemented it in Clojure with explicit environment passing, then I replaced indices by explicit stacks (thanks to persistence!) and after some tweaks, I realized that I’ve gone full circle and could switch to stacks lengths instead of stacks themselves and get rid of the loop. However the whole process made the code cleaner to my eye. You can look at the whole history.

Here is the resulting code:

See the Tarjan post for the Clojure version. Something similar is planned for “favorite” algorithms.

What algorithm are you going to submit?

Pass this along.

August 20, 2014

Mapping Out Lambda Land:…

Filed under: Functional Programming — Patrick Durusau @ 4:24 pm

Mapping Out Lambda Land: An Introduction to Functional Programming by Katie Miller.

From the post:

Anyone who has met me will probably know that I am wildly enthusiastic about functional programming (FP). I co-founded a group for women in FP, have presented a series of talks and workshops about functional concepts, and have even been known to create lambda-branded clothing and jewellery. In this blog post, I will try to give some insight into what the fuss is about. I will briefly explain what functional programming is, why you should care, and how you can use OpenShift to learn more about FP.

With the publicity around OpenShift and functional programming, it seems entirely reasonable to put them together.

Katie gives you a quick overview of functional programming along with resources and next steps for your OpenShift account.

I first saw this in a post by Jonathan Murray.

International Conference on Functional Programming 2014

Filed under: Functional Programming — Patrick Durusau @ 3:39 pm

The 19th ACM SIGPLAN International Conference on Functional Programming Complete Proceedings of ICFP 2014 available for free for one year.

I count thirty-one (31) papers that you can access for the next year.

Be aware the ACM has imposed a petty 10 second “wait” screen even though the articles are available without charge.

I first saw this in a tweet by David Van Horn.

August 12, 2014

Functional Examples from Category Theory

Filed under: Category Theory,Functional Programming — Patrick Durusau @ 6:24 pm

Functional Examples from Category Theory by Alissa Pajer.

Summary:

Alissa Pajer discusses through examples how to understand and write cleaner and more maintainable functional code using the Category Theory.

You will need to either view at full screen or download the slides to see the code.

Long on category theory but short on Scala. Still, a useful video that will be worth re-watching.

August 8, 2014

Understanding Clojure Transducers Through Types

Filed under: Clojure,Functional Programming — Patrick Durusau @ 3:02 pm

Understanding Clojure Transducers Through Types by Franklin Chen.

From the post:

Yesterday, Rich Hickey published a blog post, “Transducers are Coming”, which attracted a lot of attention.

I have a confession to make, which I have made before: I find it very difficult to understand ideas or code not presented with types. So I decided that the only way I could possibly understand what “transducers” are would be to actually implement them in a typed language. I ended up doing so and am sharing my findings here.

Franklin’s post is some of the discussion that Rich Hickey promised would follow!

Read both the post and the comments, which includes further comments from Rich Hickey on transducers.

I first saw this in a tweet by Bruno Lara Tavares.

August 6, 2014

Transducers Are Coming

Filed under: Clojure,Functional Programming — Patrick Durusau @ 1:47 pm

Transducers Are Coming by Rich Hickey.

From the post:

Transducers are a powerful and composable way to build algorithmic transformations that you can reuse in many contexts, and they’re coming to Clojure core and core.async.

Two years ago, in a blog post describing how reducers work, I described the reducing function transformers on which they were based, and provided explicit examples like ‘mapping‘, ‘filtering‘ and ‘mapcatting‘. Because the reducers library intends to deliver an API with the same ‘shape’ as existing sequence function APIs, these transformers were never exposed a la carte, instead being encapsulated by the macrology of reducers.

In working recently on providing algorithmic combinators for core.async, I became more and more convinced of the superiority of reducing function transformers over channel->channel functions for algorithmic transformation. In fact, I think they are a better way to do many things for which we normally create bespoke replicas of map, filter etc.

So, reducing function transformers are getting a name – ‘transducers‘, and first-class support in Clojure core and core.async.

A glimpse of ongoing work on Clojure.

Would not be too late to start reading about transducers now.

I first saw this in a tweet by Cognitect, Inc.

August 1, 2014

A Very Gentle Introduction to Relational Programming

Filed under: Clojure,Functional Programming,Logic,Programming — Patrick Durusau @ 3:51 pm

A Very Gentle Introduction to Relational Programming & Functional Programming by David Nolen.

From the webpage:

This tutorial will guide you through the magic and fun of combining relational programming (also known as logic programming) with functional programming. This tutorial does not assume that you have any knowledge of Lisp, Clojure, Java, or even functional programming. The only thing this tutorial assumes is that you are not afraid of using the command line and you have used at least one programming language before in your life.

A fairly short tutorial but one where “relational” in the title is likely to result in confusion. Here “relational” is meant in the sense of “logical.”

Another one of those ambiguity problems.

July 30, 2014

CIS 194: Introduction to Haskell (Spring 2013)

Filed under: Functional Programming,Haskell,Programming — Patrick Durusau @ 1:25 pm

CIS 194: Introduction to Haskell (Spring 2013) by Brent Yorgey.

From the description:

Haskell is a high-level, pure functional programming language with a strong static type system and elegant mathematical underpinnings, and is being increasingly used in industry by organizations such as Facebook, AT&T, and NASA. In the first 3/4 of the course, we will explore the joys of pure, lazy, typed functional programming in Haskell (warning: euphoric, mind-bending epiphanies may result!). The last 1/4 of the course will consist of case studies in fun and interesting applications of Haskell. Potential case study topics include automated randomized testing, software transactional memory, graphics generation, parser combinators, or others as time and interest allow. Evaluation will be based on class participation, weekly programming assignments, and an open-ended final project.

Lectures, homework, and resources on Haskell.

I particularly liked this resource and comment:

The #haskell IRC channel is a great place to get help. Strange as it may seem if you’ve spent time in other IRC channels, #haskell is always full of friendly, helpful people.

Good to know there are places like that left!

I first saw this in a tweet by Kludgy.

July 29, 2014

Collection Pipeline

Filed under: Clojure,Collection Pipeline,Functional Programming,Programming — Patrick Durusau @ 4:24 pm

Collection Pipeline by Martin Fowler.

From the post:

Collection pipelines are a programming pattern where you organize some computation as a sequence of operations which compose by taking a collection as output of one operation and feeding it into the next. (Common operations are filter, map, and reduce.) This pattern is common in functional programming, and also in object-oriented languages which have lambdas. This article describes the pattern with several examples of how to form pipelines, both to introduce the pattern to those unfamiliar with it, and to help people understand the core concepts so they can more easily take ideas from one language to another.

With a bit of Smalltalk history thrown in, this is a great read. Be mindful of software stories. You will learn that useful features have been dropped, ignored, re-invented throughout software history.

Enjoy!

July 28, 2014

Abstract Algebra, Category Theory, Haskell

Filed under: Algebra,Category Theory,Functional Programming,Haskell — Patrick Durusau @ 3:09 pm

Abstract Algebra, Category Theory, Haskell: Recommended Reading Material

A great annotated reading list for Abstract Algebra, Category Theory, and Haskell.

As an added feature, there are links to the cited works on Google Books. You won’t be able to see entire works but enough to choose between them.

« Newer PostsOlder Posts »

Powered by WordPress