Skip to content

Instantly share code, notes, and snippets.

@mikehaertl
mikehaertl / gist:3258427
Created August 4, 2012 15:40
Learn you a Haskell - In a nutshell

Learn you a Haskell - In a nutshell

This is a summary of the "Learn You A Haskell" online book under http://learnyouahaskell.com/chapters.


1. Introduction

  • Haskell is a functional programming language.
@CanTheAlmighty
CanTheAlmighty / DictionaryTwoWay.swift
Last active August 25, 2021 07:58
Two-Way Dictionary in Swift
struct DictionaryTwoWay<S:Hashable,T:Hashable> : DictionaryLiteralConvertible
{
// Literal convertible
typealias Key = S
typealias Value = T
// Real storage
private var st : [S : T] = [:]
private var ts : [T : S] = [:]
@cmelchior
cmelchior / SerializeToJson.java
Last active September 20, 2022 04:30
Serialize Realm objects to JSON using GSON
// GSON can parse the data.
//
// Deserialization:
// Note there is a bug in GSON 2.3.1 that can cause it to StackOverflow when working with RealmObjects.
// To work around this, use the ExclusionStrategy below or downgrade to 1.7.1
// See more here: https://code.google.com/p/google-gson/issues/detail?id=440
//
// Serialization:
// <Type>RealmProxy objects are created by the Realm annotation processor. They are used to control
// access to the actual data instead of storing them in fields and it is therefore them we need to register a