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
| module Math | |
| 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 |
| %default total | |
| ||| First pins down range is limited from 0 to 9 or a `Strike` | |
| data FirstThrow = FirstPinsDown (Fin 10) | Strike | |
| -- ||| Second pins down range should be limited by FirstThrowPinsdown count - 9 or a `Spare` | |
| -- ||| This currently isn't; up next: figuring out how to do this; ignore the Spare for now! | |
| -- data SecondThrow = Second FirstThrowPinsDown | Spare | |
| data SecondThrow = SecondPinsDown (Fin 10) | Spare |
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.
Abstraction| Encapsulation |
|---|
| 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 | |