Skip to content

Instantly share code, notes, and snippets.

(import <nixpkgs> { }).haskellPackages.developPackage { root = ./.; }
let
config = {
packageOverrides = pkgs: {
sway-dev = pkgs.sway.overrideAttrs (oldAttrs: {
version = "dev";
src = ./.;
});
};
};
j = {
'a': 1,
'b': {
'a': 2,
'c': "toto",
'd': [1, 2, 3],
'e': {
'd': "hello",
'x': [{'1': 2}]
}
$In\xrightarrow[]{\text{f}}Out$

class Person, class PersonWithId(id: PersonId, person: Person)

type PersonWithId = (PersonId, Person)

case class Person[ID](id: ID, name: String)

@tpolecat: Yes, and one with no id could be Person[Unit].

@tpolecat: If you don't mind having that database cruft in your model. I generally like to externalize it.

package flat
import java.io.{BufferedReader, InputStreamReader}
import java.util.zip.{ZipEntry, ZipInputStream}
import org.apache.spark.{SparkConf, SparkContext}
import org.apache.spark.input.PortableDataStream
import org.apache.spark.rdd.RDD
object Main {
export abstract class LinkedList<A> {
abstract head(): A
abstract tail(): LinkedList<A>
abstract size(): number
abstract getN(n: number): A
abstract add(a: A): LinkedList<A>
abstract addAt(a: A, i: number): LinkedList<A>
abstract append(a: A): LinkedList<A>
abstract isEmpty(): boolean
static empty<A>(): LinkedList<A> {

Manually overriding the typeclass dictionary in Purescript

The reifySymbol from the purescript-symbols package

In my effort to understand the recently added RowToList Purescript feature, I have been reading Liam Goodacre's post, which made me take a closer look at the purescript-symbols package.

I was puzzled by the implementation of the reifySymbol function. Here it is:

@mebubo
mebubo / README.md
Created October 20, 2016 18:43 — forked from jareware/README.md
Conversion script between the TTML & SRT subtitle formats

premiere-subtitle-convert

Conversion script between the TTML & SRT subtitle formats. This is particularly useful with Adobe Premiere, as it doesn't understand the SRT format (which is joyously simple and interoperable). TTML-XML is probably the most straightforward subtitle format it does understand, hence this tool.

Note that due to the simplicity of the SRT format, this conversion is extremely lossy for all the bells and whistles supported by TTML. Not like you'd want fixed-pixel font sizes etc in your subtitles anyway, but you've been warned.

javascript:(function () { var childWindow; document.addEventListener('mouseup', function(e) { var selection = window.getSelection().toString().trim(); if (selection) { if (!childWindow) { childWindow = window.open("about:blank", "Translate", "width=500,height=500"); } childWindow.location = "https://lingvolive.ru/translate/fr-ru/" + selection; } }); })();