• Stars
    star
    363
  • Rank 117,374 (Top 3 %)
  • Language
    Elixir
  • Created over 8 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Organize material to teach functional programming using Elixir

A Taste of Functional Programming

Material to introduce functional programming using the Elixir language

Objectives

  • Exposure to functional concepts
  • Use functional parts of your existing language of choice you’ve never used before
  • Lead you to pursue a functional language more in-depth

Paradigm evolution

  • Mathematics (lambda calculus)
  • Computer science
  • spawn of languages and paradigms
    • functional, procedural, imperative, declarative, object-oriented programming (OOP)
  • OOP overload...

OOP limitations

[W]e’re going to be living in a multicore, distributed, concurrent — all the buzz words — world.
The conventional models we’ve been doing, the OO stuff… is not going to survive in that
kind of environment.” - Dave Thomas
“OOP promised a cure for the scourge of software complexity. …its weaknesses have become
increasingly apparent. Spreading state all over the place leads to concurrency issues
and unpredictable side effects.” - Dave Thomas

Think Functional

  • Functions
    • Easy to reason about
    • reliable
    • pure
      • don't modify variables outside of scope
      • no side effects
      • deterministic (reproduciable results)
  • Data transformation
    • ie. Unix pipes - cat foo.log | grep bar | wc -l
  • No side-effects
    • Side effects are:
      • modifying state
      • has observable interaction with external functions
  • Immutability
    • Immutable data is known data
    • Data that is created is not changed
    • Copy and alter
      • Compilers can perform optimizations because of this
      • Garbage collectors are smart about this
    • Avoid race conditions
  • Higher-order functions
    • Functions can receive functions as arguments and return functions
  • Where is my for loop?
    • recursion
    • map, reduce, filter, reject, take, etc.

Some (impure and pure) functional languages

  • LISP, Scheme, Clojure, Erlang, Scala, OCaml, Haskell, F#, Elm, Elixir

Elixir

“Elixir is a dynamic, functional language designed for building scalable and
maintainable applications. Elixir leverages the Erlang VM, known for running low-latency,
distributed and fault-tolerant systems, while also being successfully used in web development
and the embedded software domain.” - http://elixir-lang.org

Approachable code examples that highlight functional concepts

Sources

More Repositories

1

neural_network_elixir

Neural network written in Elixir
Elixir
115
star
2

simple-supervision

Very simple supervision setup that protects against divide by zero
Elixir
41
star
3

opentok

Ruby gem for opentok api
Ruby
26
star
4

learning-ruby

Code examples from my years of teaching Ruby at Spokane Community College
Ruby
18
star
5

neural-net-elixir-v1

Neural network written in Elixir
Elixir
14
star
6

neural-networks

Building neural networks. Using Ruby and Elixir
Ruby
13
star
7

erlang-chat-demo

Wildfireapp chat demo
Erlang
6
star
8

beginning-erlang-for-ruby-developers

Ruby
6
star
9

mongoid-starter-app

Rails Mongoid Starter App
Ruby
4
star
10

Code-Kata-Exercise

Spokane/CDA Ruby User Group - Code Kata Exercise on Oct 7th, 2009
Ruby
4
star
11

pivotaltracker-widget

Manage dashboard for PivotalTracker.com
Ruby
3
star
12

neural_network

Neural network written in Ruby
Ruby
3
star
13

phoenix-is-not-your-application

A super duper simple example of "Phoenix is not your application"
Elixir
3
star
14

my-pivotal-wip

A user Sinatra app visualizing Work In Progress for a project in Pivotal Tracker
Ruby
3
star
15

team-roster-app

AngularJS code used in the tutorial I wrote for the Software Developer's Journal
HTML
3
star
16

highlinecc_intro_to_rails

Sample Rails app I created in a quick demonstration
Ruby
2
star
17

Learn-Ruby-by-Testing-First

Inspired by http://testfirst.org and http://rubykoans.com
Ruby
2
star
18

introduction-to-erlang-presentation

Showoff Presentation I gave at the Silicon Valley Web Builders Group
Ruby
2
star
19

twittercompare

Compare mutual followers between two Twitter accounts
Ruby
2
star
20

twitter-followers-histogram

Histogram showing the amount of followers your followers have
Ruby
1
star
21

Ruby-Chops

Web site to showcase iphone/ruby/rails screencasts
Ruby
1
star
22

attributes_sort

Sorting a collection of objects by one or more attributes
Ruby
1
star