Skip to content

Instantly share code, notes, and snippets.

benchFromFoldableTco :: Benchmark
benchFromFoldableTco = mkBenchmark
{ slug : "fromFoldableTco"
, title : "fromFoldable via repeated insert"
, sizes : (0..10 <#> (*) 100) <> (1..10 <#> (*) 1000)
, sizeInterpretation : "Number of entries"
, inputsPerSize : 10
, gen : \n -> resize n (arbitrary :: Gen (List (Tuple Int Int)))
, functions : [ benchFn "fromFoldable direct" fromFoldable
, benchFn "fromFoldable stack-safe" fromFoldable'

Row Types

When talking about Ermine, we often hear about "row types". What are row types exactly and how can we use them to reason about Ermine programs? This post is a brief attempt to make that connection.

First, we'll need some imports:

module Tutorial where 
@dmkolobov
dmkolobov / exercises.clj
Last active February 14, 2018 00:42
exercises.clj
(defrecord Person [name employees]) ;; Defines a Person product type.
;; Fields are accessed via (:name person) (:employees :person)
(defn employees-list
"Returns a list of all people directly or indirectly employed by 'person'."
[person]
(apply concat ;; (apply f x1 ... xn [y1 ... yn]) => (apply f x1 ... xn y1 ... yn)
[(:name person)] ;; a single-element vector containing the name of 'person'
(map employees-list (:employees person))))
@dmkolobov
dmkolobov / bool-grammar
Last active October 24, 2017 22:30
Hello!
```
bool ::= or | and
or ::= bool '||' bool
and ::= and '&&' not | not
not ::= '!' comp | comp
comp ::= (id ('<' | '>' | '<=' | '>=' | '=') id) | '(' bool ')'
```
@dmkolobov
dmkolobov / introduction
Created February 21, 2015 02:54
Hello!
Mozilla Developer Network (MDN) has a good series of articles describing how the internet work, in particular browsers and servers:
https://developer.mozilla.org/en-US/Learn/Web_Mechanics
After you've looked through those, try doing this course on HTML, which is the language used to describe what a webpage should contain.
http://www.codecademy.com/tracks/web
Additional resource to complement above course:
https://developer.mozilla.org/en-US/docs/Web/HTML