Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block giuliohome

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
robert-claypool / app_offline.htm
Created Jul 21, 2015
A simple "app offline" template for ASP.NET
View app_offline.htm
<!DOCTYPE html>
<meta charset="UTF-8">
<body style="margin:3em;font-family:sans-serif">
<p>This site is offline for maintenance.</p>
vjeux /
Last active Jun 19, 2019
Ocaml / functional programming

I'm taking down this post. I just posted this as a side comment to explain a sentence on my latest blog post. This wasn't meant to be #1 on HN to start a huge war on functional programming... The thoughts are not well formed enough to have a huge audience. Sorry for all the people reading this. And please, don't dig through the history...

isaacabraham / io-monad.fsx
Last active May 28, 2019
F# port of the first half of John De Goes "FP to the max" (
View io-monad.fsx
#load @".paket\load\net452\FSharpPlus.fsx"
open FSharpPlus
open System
module rec IO =
let run (IO computation) = computation()
type IO<'T> =
ArthurHub / ClipboardHelper.cs
Last active May 23, 2019
Helper class for setting HTML and plain text formatting to clipboard (
View ClipboardHelper.cs
/// <summary>
/// Helper to encode and set HTML fragment to clipboard.<br/>
/// See<br/>
/// <seealso cref="CreateDataObject"/>.
/// </summary>
/// <remarks>
/// The MIT License (MIT) Copyright (c) 2014 Arthur Teplitzki.
/// </remarks>
public static class ClipboardHelper
battermann / io.fsx
Last active Jul 3, 2018
IO Monad in F#
View io.fsx
module IO =
type IO<'a> =
| Return of (unit -> 'a)
| Suspend of (unit -> IO<'a>)
let rec run x =
match x with
| Return v -> v()
View Differ.fs
type DifferenceType<'TKey, 'T> =
| Added of 'TKey * 'T
| Removed of 'TKey * 'T
| Modified of 'TKey * 'T * 'T * seq<string * (string * string)> with
member this.Key =
match this with
| Added (key, _)
| Removed (key, _)
| Modified (key, _, _, _) -> key
CarstenKoenig / Hylo.fs
Last active Feb 19, 2018
Factorial using a Hylomorphism in F#
View Hylo.fs
type List<'i,'r> = Nil | Cons of 'i*'r
type FixList<'i> = FixList of List<'i,FixList<'i>>
let rec fmap (f : 'a -> 'b) (l : List<'i,'a>) : List<'i,'b> =
match l with
| Nil -> Nil
| Cons (x, tail) -> Cons (x, f tail)
// you can express hylo directly without using ana and cata (by either following the
decisionmechanics / spark_random_forest.R
Created Mar 21, 2017
Predicting wine quality using a random forest classifier in SparkR
View spark_random_forest.R
url <- ""
df <-
read_delim(url, delim = ";") %>%
dplyr::mutate(taste = as.factor(ifelse(quality < 6, "bad", ifelse(quality > 6, "good", "average")))) %>%
dgfitch / simple_wcf.fs
Created Nov 3, 2010
A sample WCF host and client in F#, extremely simple but a starting point
View simple_wcf.fs
open System
open System.ServiceModel
open System.ServiceModel.Description
[<ServiceContract(ConfigurationName = "PublishService", Namespace = "")>]
type IPublishService =
abstract member TestMethod : name:string -> string
You can’t perform that action at this time.