Disclaimer: I'm a linux noob
apt-get update
apt-get install haskell-platform libcurses5
cabal update
cabal install cabal-install
cd /tmp
cabal unpack idris
cd idris-0.9.15.1
Disclaimer: I'm a linux noob
apt-get update
apt-get install haskell-platform libcurses5
cabal update
cabal install cabal-install
cd /tmp
cabal unpack idris
cd idris-0.9.15.1
type Matrix = | |
| Matrix of decimal [,] | |
static member create l = Matrix l | |
member this.elements = | |
match this with | |
| Matrix l -> l | |
member this.rowcount = this.elements |> Array2D.length1 | |
member this.columncount = this.elements |> Array2D.length2 |
type Matrix = | |
| Matrix of decimal list list | |
static member create l = Matrix l | |
static member unit n = | |
seq { | |
for r in 1..n do | |
yield seq { | |
for c in 1..n do | |
yield if r = c then 1M |
TAB "Tesla Model S" – Tom Janssens | |
D = x-x-0-2-3-2 | |
D7 = x-x-0-2-1-2 | |
A = x-0-2-2-2-0 | |
G = 3-2-0-0-0-3 | |
D | |
Oh Lord, won’t you buy me a Tesla Model S? | |
A |
function $(selector) { | |
if (typeof (selector) == "function") { | |
document.addEventListener('DOMContentLoaded', selector) | |
} else { | |
return [].reduce.call(document.querySelectorAll(selector), function (acc, element) { | |
return acc.concat([element]); | |
}, []) | |
} | |
} |
using System; | |
using System.Collections.Generic; | |
using System.Globalization; | |
using System.Linq; | |
using System.Threading; | |
using System.Web; | |
using System.Web.Mvc; | |
using System.Web.Routing; | |
namespace Pauwels.AspNet |
Today I was having a discussion on twitter, and after re-reading my timeline and seeing this tweet, I decided to blog about it.
AbstractionEncapsulation |
---|
type RgbColor = {r:int;g:int;b:int} with | |
static member create r g b = {r=r;g=g;b=b} | |
static member fmap f left right = {r=f left.r right.r;g=f left.g left.b; b = f left.b right.b } | |
static member (-) (l,r) = RgbColor.fmap (-) l r | |
static member (*) (l,r) = RgbColor.fmap (*) l r | |
member left.squaredDistance right = | |
let diffColor = (left - right) | |
let squaredColor = diffColor * diffColor | |
diffColor.r + diffColor.g + diffColor.b | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace FPExplainedV2 | |
{ | |
// another implementation to test category theory; this time I implement a list... | |
public class FList<TObject> |
open System.Runtime.Serialization | |
[<DataContract>] | |
type Vector3D = { | |
[<DataMember>] x: decimal | |
[<DataMember>] y: decimal | |
[<DataMember>] z: decimal | |
} with | |
member this.width = this.x | |
member this.height = this.y |