Skip to content

Instantly share code, notes, and snippets.

typeSignature =
lazy <| \() ->
sepBy (whitespace *> string "->" *> whitespace) nonFunctionType
|> andThen (
reducer TArrow
>> Maybe.map succeed
>> Maybe.withDefault (fail "expected type, got nothing")
)
reducer : (a -> a -> a) -> List a -> Maybe a
typeSignature =
lazy <| \() ->
sepBy (whitespace *> string "->" *> whitespace) nonFunctionType
|> andThen (
reducer TArrow
>> Maybe.map succeed
>> Maybe.withDefault (fail "expected type, got nothing")
)
reducer : (a -> a -> a) -> List a -> Maybe a
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <time.h>
uint64_t water_on_pillars(uint64_t pillars[], size_t len) {
if (len < 3) {
return 0;
}
%default total
p_implies_p : p -> p
p_implies_p x = x
data And a b = MkAnd a b
data Or a b = Left a | Right b
p_implies_p_and_p : p -> And p p
var listSelectors = require('list-selectors');
var fs = require('fs')
module.exports = function(elmsource) {
function makeLine(prefixedName) {
const name = prefixedName.substr(1)
return `${name} = "${name}"`
}