2 Replies - 1726 Views - Last Post: 06 October 2013 - 03:27 PM

#1 Lemur  Icon User is offline

  • Pragmatism over Dogma
  • member icon



Reputation: 1335
  • View blog
  • Posts: 3,398
  • Joined: 28-November 09

Combinators

Posted 06 October 2013 - 02:58 PM

So I've been asking around with my Math friends and most of them are scratching their heads trying to figure out what the devil I'm on about. I've managed to stumble upon a very interesting branch of math called Combinatory Logic, and while it's enchanting and very powerful, I'm wondering what others opinions are on it.

https://leanpub.com/combinators

This book does a good job of describing implementations in Ruby.

http://www.haskell.o...mbinatory_logic

Seems that Haskell describes it in depth too.

What I'm wondering is why, if this is so useful and potent in abstracting common logic patterns, is it not more ubiquitous? Granted it has its difficulty, but still.

Here's a quick example of what I'm talking about, a Kestrel (K Combinator) in Ruby:

# The usual way
def registered_person(params = {})
  person = Person.new(params.merge(:registered => true))
  Registry.register(person)
  person.send_email_notification
  person
end

# Kestrel
def registered_person(params = {})
  returning Person.new(params.merge(:registered => true)) do |person|
    Registry.register(person)
    person.send_email_notification
  end
end



Quote

In Combinatory Logic, a Kestrel (or “K Combinator”) is a function that returns a constant function, normally written Kxy = x.


It's powerful stuff, and quite beautiful at that. Anyone heard of this or want to provide some more insight to this branch?

Is This A Good Question/Topic? 1
  • +

Replies To: Combinators

#2 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10180
  • View blog
  • Posts: 37,586
  • Joined: 27-December 08

Re: Combinators

Posted 06 October 2013 - 03:08 PM

Moved to Computer Science.

I'll be honest, I haven't really studied Combinatory Logic. I'm taking a Theory of Computation course this semester. The first day of class, several models of computation were introduced, including lambda calculus, recursive function theory (combinatory logic falls under this category), logic circuits, the von Neumann model, and a few others. The professor described them all as equivalent. He teaches this class using Circuits as the model of computation, which yields a more EE flavor than I'd like. His motivation for using circuits is that it's a model which students can see (as in, circuits are implemented in the mother board, so it should follow that if something can't be computed with circuits, it isn't computable on these other, more abstract models).

Combinatory logic really isn't taught in lower level CS and Math courses. I don't even think Abstract Algebra focuses on it too much. That's probably the problem in getting it out there.
Was This Post Helpful? 0
  • +
  • -

#3 Lemur  Icon User is offline

  • Pragmatism over Dogma
  • member icon



Reputation: 1335
  • View blog
  • Posts: 3,398
  • Joined: 28-November 09

Re: Combinators

Posted 06 October 2013 - 03:27 PM

I just know that any time I stumble on something and it near redefines the way I think about programming it's definitely significant and warrants more investigation on my part.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1