Giter Site home page Giter Site logo

fplabs's Introduction

FPLabs

Functional programming labs for C#/LINQ, F#, and JS

Welcome to Troy's functional programming labs prepared for the North Dallas .NET User Group. In these labs we will explore the concepts behind functional programming and apply them using C#, JavaScript, and F#.

Warning: not all of the code in the examples will compile. Sometimes this is deliberate, sometimes I just say its deliberate!

Why Do We Care?

  • About doing more with less code
  • Most FP code has 2x to 10x fewer lines of code than OOP

Other Reasons We Care

  • Microservices
  • Big Data
  • Search
  • Collections
  • Research
  • Startups
  • All the cool kids are doing it

Where did this come from?

Generations of Computing


What happens when you code using FP

Even Neil DeGrasse Tyson gives you respect!


the basics...

Lists, Collections, Oh My!

data


Abstraction = Using Functions

f(x)

  • OOP abstracts low level operations into classes.
  • FP abstracts away things like loops and interfaces

Most .NET developers already use some aspects of FP in tools such as LINQ, arrow functions, collections, etc

Expressions

expr

Immutablity

Pure functions

  • No side effects
  • Returns the same output for the same input (singleton)

immutable

  • Static functions = singletons
  • Most complexity and bugs in an application are a result of pervasive use of state and side effects of stateful code
  • Encapsulation

Anonymous Functions

Delegates

Lambdas

()=>
  =>

Func<T,Tresult>

Pure Function Lab


Levels of Abstraction

1. Abstraction level 0: no functions

  1. Abstraction Level 1: First Order Functions

  2. Abstraction Level 2: Higher Order Functions + Combinator Libraries

  3. Abstraction Level 3: Typeclasses, Abstracting over Combinator Libraries

  4. Abstraction Level 4: Abstracting over Typeclasses


The languages

Best F# Intro Ever

Level 3 Functional Programming Site

Resources

Programming without IFs

Advanced Labs

Create your own big data processor with map/reduce

fplabs's People

Contributors

oldgittroy avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Forkers

ztittle

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.