background preloader

Functional languages

Facebook Twitter

Elixir Conf 2014 - Keynote: Think Different by Dave Thomas. The State Monad: A Tutorial for the Confused? - Brandon.Si(mmons) I’ve written this brief tutorial on haskell’s State monad to help bridge some of the elusive gaps that I encountered in other explanations I’ve read, and to try to cut through all the sticky abstraction. This is written for someone who has a good understanding of the Maybe and List monads, but has gotten stuck trying to understand State.

I hope it’s helpful! The Data Declaration: To understand a monad you look at it’s datatype and then at the definition for bind (>>=). Most monad tutorials start by showing you the data declaration of a State s a in passing, as if it needed no explanation: But this does need explanation! The constructor State holds a function, not just a simple value like Maybe’s Just. Yikes! First of all the State monad is just an abstraction for a function that takes a state and returns an intermediate value and some new state value. Let’s bring the discussion back to actual code and try to make sure we understand those three points of weirdness outlined above. State s a. Functional parallel programming in Elixir | iJoshSmith. This article reviews a program that implements a parallelized algorithm, using a functional programming style made possible by a fantastic new language named Elixir.

Along the way I very briefly introduce Elixir, review the relevance of functional programming in modern computing, and explain what parallel programming is all about. There’s a lot of ground to cover, so let’s get started! The program This programming exercise is based on finding what I refer to as a wordset. A wordset is a list of words that, when written on separate lines, read the same both horizontally and vertically. For example: You can run the program from a command prompt, such as Terminal in OS X. The source code, along with instructions on how to run the program, is available on GitHub at Why Elixir? Over the past few months I studied various functional programming languages, as well as the concurrency and parallel programming models their practitioners espouse. Like this: Haskell | Programming Languages | Hammer Principle. Elixir, ReactJS, and the Technologies That Will Rule Until 2020.

My name is Ken Mazaika and I’m the CTO & Co-founder of The Firehose Project. I’m a strong believer in the idea that the software development environment is evolving at such a fast pace that it’s far more practical to learn the fundamentals instead of the next group of cutting edge technologies. However, beginners will often ask about the future of web development.

And it makes sense. With programming, as with any topic, it’s fun to talk about the next big thing. It’s never been a more exciting time to be a developer. In 1969, the Apollo Guidance Computer could process 41.6 instructions/second. It would be an understatement to say that technology is evolving rapidly. In this post, we’ll talk about some of these new cutting edge technologies. Babel & ES6 When developers began to say things to me like: “I really love JavaScript”, I was confused. But recently, JavaScript ecosystem has seen a lot of interesting changes. So let’s rewind a little bit. via gizmodo original via codepen.io. Elixir. Why I’m betting on Elixir. Background: I’ve spent the past 6 years building web applications in Ruby and the Rails framework. I’ve flirted with new programming languages as they came out, but Elixir is the first language that has been able to captivate me. Ruby Crushed It!

The ruby language and the Rails framework completely changed the way web applications were built; it started a religion of values that the community cared about. It pioneered the idea that the tools programmers use should be optimized for developer happiness and productivity. It made the bold challenge that it is developers’ jobs to make sure their code was adequately tested and worked. Other languages and frameworks scoffed at the approach, until it started winning.

Ruby went from humble beginnings as an obscure language to one of the most popular languages, largely because of the Rails framework and tremendous leadership from people like DHH, Wycats, Aaron Patterson, Jose Valim and a ton of other superstars. Run-away memory! The solution? Speed! You Could Have Invented Monads! (And Maybe You Already Have.) If you hadn't guessed, this is about monads as they appear in pure functional programming languages like Haskell. They are closely related to the monads of category theory, but are not exactly the same because Haskell doesn't enforce the identities satisfied by categorical monads. Writing introductions to monads seems to have developed into an industry. There's a gentle Introduction, a Haskell Programmer's introduction with the advice "Don't Panic", an introduction for the "Working Haskell Programmer" and countless others that introduce monads as everything from a type of functor to a type of space suit.

But all of these introduce monads as something esoteric in need of explanation. Many of the problems that monads try to solve are related to the issue of side effects. Side Effects: Debugging Pure Functions In an imperative programming language such as C++, functions behave nothing like the functions of mathematics. F,g :: Float -> Float f',g' :: Float -> (Float,String) which implies that.

Haskell

Lisp.