Skip to content

Instantly share code, notes, and snippets.

@ErikLuimes
ErikLuimes / quicksort.swift
Created February 21, 2018 06:38
Haskell quicksort implementation in swift
//: Playground - noun: a place where people can play
/*: Quicksort
I wanted to see how closely swift can resemble the Haskell quicksort example
````
quicksort :: (Ord a) => [a] -> [a]
quicksort [] = []
quicksort (x:xs) =
let smallerSorted = quicksort [a | a <- xs, a <= x]
#
git filter-branch --force --index-filter \
'git rm --cached --ignore-unmatch PATH-TO-YOUR-FILE-WITH-SENSITIVE-DATA' \
--prune-empty --tag-name-filter cat -- --all
@ErikLuimes
ErikLuimes / DataStore.swift
Last active May 20, 2016 11:29
Realm DataStore
import Foundation
import RealmSwift
public struct DataStore
{
public static let sharedInstance: DataStore = DataStore()
private (set) var writeQueue = dispatch_queue_create("nl.mayainteractive.project.realm.write", DISPATCH_QUEUE_SERIAL)
private (set) var mainRealm = try! Realm()