Types and Programming Languages
Purely Functional Data Structures
Introduction to Algorithms (OK to skim through first 2 chapters)
Study source of containers and unordered-containers
// mål att parsa basic datalog: | |
// fact(A, B). | |
// rule(x, y) :- fact(A, y). | |
// en feedback på readme:en är att flytta installation lite längre upp för | |
// att det känns som ganska standard istället för längst ner i de flesta paket. | |
import { Helpers } from '@honungsburk/kombo'; | |
// import { Done, Loop, spaces, Trailing, Unit } from '@honungsburk/kombo/dist/cjs/Advanced'; | |
// import { loop, oneOf, oneOfMany, Parser, run, sequence, Step, succeed, symbol, variable } from '@honungsburk/kombo/dist/cjs/Simple'; |
module QueryTriple where | |
import Control.Monad | |
import Data.Maybe | |
import Data.List | |
import Data.Char | |
-- based on https://fkettelhoit.github.io/bottom-up-datalog-js/docs/dl.html | |
type Ent = String |
-- Does anyone understand what this code does? | |
-- What is a and b? | |
-- We add two amounts | |
-- We know that an "amount" is an Int | |
type TransferId1 = Int | |
type Amount1 = Int | |
add1 :: Amount1 -> Amount1 -> Amount1 |
from __future__ import print_function | |
import pickle | |
import os.path | |
from googleapiclient.discovery import build | |
from google_auth_oauthlib.flow import InstalledAppFlow | |
from google.auth.transport.requests import Request | |
from email.mime.text import MIMEText | |
import base64 | |
# Script is altered version of the one provided in the official documentation. |
(* simple lisp interpreter *) | |
type sym = string | |
datatype exp = Sym of sym | |
| List of exp list | |
| Num of int | |
| Str of string | |
| Bool of bool | |
| Lam of (sym list) * ((sym * exp) list) * exp |
using System.Collections.Generic; | |
using System.Linq; | |
namespace ProjectCC | |
{ | |
class World | |
{ | |
private List<Entity> Entities; | |
private List<System> Systems; |
import Game.AAAGameDevEnv (GameEngine (..), GameData (..)) | |
main = frostbite $ bf3 | |
frostbite :: GameData -> GameEngine | |
frostbite game = Engine { | |
version = 2.3.2, | |
directX = yes, | |
realLifePhysics = enabled, | |
gameStuff = game |
import java.util.ArrayList; | |
public class Layer { | |
private ArrayList<Neuron> nodes; | |
public Layer(int nodeCount, int inputCount) { | |
nodes = new ArrayList<>(); | |
for (int i = 0; i < nodeCount; i++) { | |
nodes.add(new Neuron(inputCount)); | |
} |
Types and Programming Languages
Purely Functional Data Structures
Introduction to Algorithms (OK to skim through first 2 chapters)
Study source of containers and unordered-containers
params :: Parser Params | |
params = do | |
ps <- takeWhile (notInClass ":\r") `sepBy` space |