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
db = RunewordDB (fromList
[ ( ["ber", "tir", "um", "mal", "lum"]
, Runeword
{ name = "Beast"
, item = "scepter"
, description =
[ "fanaticism 9 when quipped"
, "+40% ias"
, "+240-270% dmg"
, "20% crushing blow"
@Heimdell
Heimdell / Monkey.rb
Last active January 2, 2016 16:49
chmod +x Runewords.rb && ./Runewords.rb
module Kernel
# Ook, ook, ook!
def custom_init &block
self.new.instance_eval do
block.call self
self
end
module SchemeParser where
import Control.Applicative
import Text.ParserCombinators.Parsec hiding ((<|>))
data Ast = Term String | List [Ast]
deriving Show
{-# LANGUAGE TemplateHaskell #-}
import Data.Lens.Template
import qualified Data.Map as Map
import Data.Map (Map)
import System.Random
import StatefulLens
@Heimdell
Heimdell / .gitignore
Last active August 29, 2015 13:56
SDL bindings
*.out
*.a
#pragma once
#include <cmath>
#include <iostream>
using namespace std;
static constexpr int pow(int x, int n) {
@Heimdell
Heimdell / Behaviour.hs
Last active August 29, 2015 13:57
How to understand X? Make it yourself. So, this is my understanding of Functional Reactive Programming (powered by arrows).
module Behaviour where
import Prelude hiding (id, (.), head, tail, zip, unzip, map, repeat, cycle)
import Control.Applicative
import Control.Arrow
import Control.Category
import Data.Stream
{-# LANGUAGE Arrows, TypeOperators #-}
import Prelude hiding (id, (.))
import SF
-- this is the timer - returns length of the tick
ticks :: () :-> Double
ticks = constant 1
-- Modelling the physics.
{-# LANGUAGE
TemplateHaskell,
Arrows
#-}
module Thing where
import Prelude hiding (id, (.))
import Control.Arrow
@Heimdell
Heimdell / ListAsFunctions.hs
Last active August 29, 2015 14:01
Proof, that lists could be modelled as functions.
{-# LANGUAGE RankNTypes #-}
type List a =
forall b.
(a -> b -> b) -> (b -> b)
nil :: List a
nil _ a = a
infixr 5 ><