Functional-First
Programming with F#





Tomas Petricek, Alan Turing Institute + fsharpWorks
@tomaspetricek | tomasp.net | fsharpworks.com

software stacks trainings

mac and linux cross platform tutorials

F# Software Foundation

user groups open source Xamarin

community www.fsharp.org research

support contributions diversity

FUNCTIONAL

A function from \(A\) to \(B\) is an object \(f\)
such that every \(a\in A\) is uniquely associated
with an object \(f(a)\in B\).

A function is the purpose for which
something is designed or exists.

Form follows function

#1 - TYPE PROVIDERS

SIMPLICITY

The elimination of ornament

1: 
2: 
3: 
public interface FactoryFactory<T> {
  public Factory<T> getFactory();
}
1: 
2: 
3: 
4: 
5: 
6: 
7: 
newtype StateT s m a =
  StateT { runStateT :: (s -> m (a,s)) }

instance (Monad m) => Monad (StateT s m) where
  return a = StateT $ \s -> return (a,s)
  (StateT x) >>= f = StateT $ \s -> x s >>= \(v,s') ->
    runStateT (f v) s'     

Dot-driven development

F# Data library for data access

Custom type providers

#2 - DOMAIN MODELING

MATERIALS

Enough strudiness to be able to build it

Types to model the domain

Behind the scenes of Elm-style

#3 - COMPOSITION

MATERIALS

Variability to design whatever you need

Suave and Giraffe libraries

Composing web parts from web parts

SUMMARY

Modernism is associated with an analytical approach to the function of buildings, a strictly rational use of new materials, an openness to structural innovation and the elimination of ornament.

Functional-First Programming


Function as in purpose

Form follows function

Abstraction vs ornament



Tomas Petricek, Alan Turing Institute + fsharpWorks
@tomaspetricek | tomasp.net | fsharpworks.com