Skip to content

Instantly share code, notes, and snippets.

number_of_atoms = 10e80 -- quantity
size_of_universe = 46e9 * 3.15569e7 -- light years to seconds
smallest_distance = 5.3910632e-44 -- seconds
speed_of_light = 299792458
bits_in_universe = (
{- x -} log(size_of_universe / smallest_distance) / log(2)
{- y -} + log(size_of_universe / smallest_distance) / log(2)
a = 5
b = 3
c = a + b = 15
a a a a a
b c c c c c
b c c c c c
b c c c c c
Arduino
1. $65.94 -- Buy Ardunio Yun -- http://www.amazon.com/Arduino-A000008-Y%C3%9AN/dp/B00F6YJK3S
2. $8.95 -- Buy LCD Shield -- http://www.amazon.com/ZITRADES-Keypad-Display-Arduino-Duemilanove/dp/B00BOMPW60
3. $6.97 -- Buy Jumper Cables -- http://www.amazon.com/RioRand-Dupont-Male-Male-Female-Female-Female-Male/dp/B00J5NSOVA
3. Program ticker software
4. ???
5. Profit!
Total $81.86
-- Explicitly stating the order of computation `a (b c)` makes this not compile
-- While, if we used a C style, order of computation would be explicit by default `a(b(c))` vs `a(b, c)`
example1 = a b c
where
a first second = first ++ second
b = "hey"
c = " world"
-- Explicitly stating `a (b c)` makes this compile
example2 = a b c
var Dockerfile;
if (!req.body.modules.length) {
Dockerfile = multiline.stripIndent(function () { return undefined; /*
FROM haskell-online-ghc
ADD execute.sh .
*/ });
} else {
Dockerfile = multiline.stripIndent(function () { return undefined; /*
FROM haskell-online-ghc
myFunction :: Record -> Record -> a
foobar = myFunction Record { meow = "face" }
Record { meow = "face" }
-- vs --
myFunction :: (Record, Record) -> a
foobar = myFunction(
Running sch2hdl...
Command Line: sch2hdl -batch C:/Users/Ryan/pong/sch2HdlBatchFile
Release 14.7 - sch2hdl P.20131013 (nt64)
Copyright (c) 1995-2013 Xilinx, Inc. All rights reserved.
Started : "Synthesize - XST".
Running xst...
Command Line: xst -intstyle ise -ifn "C:/Users/Ryan/pong/pong_top.xst" -ofn "C:/Users/Ryan/pong/pong_top.syr"
Reading design: pong_top.prj
`timescale 1ns / 1ps
module BinToDec(
input mclk,
input [7:0] sw,
output reg [3:0] an,
output reg [6:0] seg,
output reg [7:0] Led
);
func apply<A, B> (data : A, fn : B) -> A {
return fn(data) // '(A) -> $T2' is not identical to 'B'
}
func apply<A, B : A -> A> (data : A, fn : B) -> A { // Expected '>' to complete generic parameter list
return fn(data)
}