Skip to content

Instantly share code, notes, and snippets.

absurdhero / Parser.kt
Last active Mar 20, 2018
monadic parser combinator in Kotlin
View Parser.kt
package net.raboof.parser
// based on
data class Result<TInput, TValue>(val value: TValue, val rest: TInput)
class Parser<TInput, TValue>(val f: (TInput) -> Result<TInput, TValue>?) {
operator fun invoke(input: TInput): Result<TInput, TValue>? = f(input)
infix fun or(other: Parser<TInput, TValue>): Parser<TInput, TValue> {
absurdhero / test_results.html
Created Jul 31, 2013
MonoGame MonoMac test failures
View test_results.html
<!DOCTYPE html>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
.plus {
display: inline-block;