Skip to content

Instantly share code, notes, and snippets.

View Heimdell's full-sized avatar
🔨
Right tool for the right job

Андреев Кирилл Heimdell

🔨
Right tool for the right job
  • Ульяновск
View GitHub Profile
@Heimdell
Heimdell / Eval.hs
Last active May 28, 2019 19:20
Lexically (and hyper-statically) scoped concatenative language
{-# LANGUAGE FlexibleContexts #-}
module Eval
( EvalError (..)
, eval
, letrec
) where
import Control.Monad.Catch (Exception)
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
module Instr where
import Prelude hiding (drop)
import Data.Map (Map)
import Data.String
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/*
* I need these functions.
*/
public static class ListExt {
/*
https://github.com/ephtracy/voxel-model/blob/master/MagicaVoxel-file-format-vox-extension.txt
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/*
* I need these functions.
*/
public static class ListExt {
/*
@Heimdell
Heimdell / Free.hs
Last active February 18, 2019 21:38
{-# OPTIONS_GHC -fglasgow-exts #-}
{-# Language LambdaCase #-}
{-# Language TypeApplications #-}
{-# Language ScopedTypeVariables #-}
{-# Language ExplicitForAll #-}
{-# Language AllowAmbiguousTypes #-}
{-# Language TypeFamilies #-}
{-# Language DataKinds #-}
{-# Language EmptyCase #-}
{-# language DeriveFunctor #-}
import Control.Applicative ((<|>))
import qualified Data.Map as Map
import Data.Map (Map)
import Data.Maybe
newtype FrameStack k v = FrameStack
@Heimdell
Heimdell / list.js
Last active February 5, 2019 15:56
// Задача: написать односвязный иммутабельный список и несколько функций для него.
let List = {
// Пустой список. Поскольку он иммутабельный, хватит и одного на все списки.
//
empty: undefined,
// Присоединить элемент head к списку tail.
@Heimdell
Heimdell / example.js
Last active January 28, 2019 15:24
Utils for trees: Grid Snap and Navigation
let R = require("./node_modules/ramda")
let treeUtils = require("./tree-utils")
let {inspect} = require("util")
show = x => inspect(x, {depth: null})
log = console.log
///////////////////////////////////////////////////////////////////////////////
@Heimdell
Heimdell / frp.js
Last active December 15, 2018 19:28
/*
Array is too dumb.
*/
class Subscribers {
constructor () {
this.counter = 0
this.mapping = new Map()
}
add(sink) {