Skip to content

Instantly share code, notes, and snippets.

Joonatan Saarhelo joonazan

Block or report user

Report or block joonazan

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
View scrape-css.js
var listSelectors = require('list-selectors');
var fs = require('fs')
module.exports = function(elmsource) {
function makeLine(prefixedName) {
const name = prefixedName.substr(1)
return `${name} = "${name}"`
}
View basic_proofs.idr
%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
View water.c
#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;
}
View buggy.elm
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
View buggy.elm
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
View gist:bb52254a63f774600b49ca4d14527bf6
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
@joonazan
joonazan / ParseLibrary.elm
Created Apr 15, 2017
Invalid recursion in Elm 0.18 still causes runtime error
View ParseLibrary.elm
module ParseLibrary exposing (typeSignature)
import Combine exposing (..)
import Dict exposing (Dict)
type Type
= TArrow Type Type
| TName String
| TRecord (Dict String Type)
View e_custom_ll.cpp
#include <iostream>
#include <list>
#include <algorithm>
using namespace std;
int n;
int *aita;
void print_solution(int tertiary){
View Child.elm
module Child exposing (init, update, Message(InterestingMessage))
init = 0
type Message
= InterestingMessage
| InternalMessage
update message model = model
View main.elm
module Child exposing (init, update, Message(InterestingMessage))
init = 0
type Message
= InterestingMessage
| InternalMessage
update message model = model
You can’t perform that action at this time.