Necessary utilities: graphviz, dot2tex, xsel. Install these:
$ sudo apt install graphviz
$ sudo apt install xsel
$ pip3 install dot2tex
<?xml version="1.0" encoding="utf-8"?> | |
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="en-US"> | |
<info> | |
<title>Forester Citation Style</title> | |
<id>http://www.zotero.org/styles/forester-citation-style</id> | |
<author> | |
<name>Eigil Fjeldgren Rischel</name> | |
</author> | |
<category citation-format="label"/> | |
<category field="generic-base"/> |
#!/usr/bin/env python3 | |
import sys | |
import re | |
import urllib.request | |
import requests | |
import os | |
import logging | |
from bs4 import BeautifulSoup |
#!/usr/bin/env python3 | |
import requests | |
import sys | |
import os | |
## Send stdin as an email with first cmdline arg as subject | |
# could also hardcode thes |
using Catlab.GAT | |
using Catlab.Theories | |
using Flux | |
struct EucSpc | |
dim::Int | |
end | |
struct ParaEucFun | |
domdim::Int |
#!/usr/bin/env python | |
import urllib as ul | |
import re | |
import sys | |
import os.path | |
#Pandoc turns this: [foo]([[My Foo Page]]) | |
#Into this: [[file:%5B%5BMy%20Foo%20Page%5B%5B][foo]] | |
#We want this: [[file:My Foo Page.org][foo]] |
#!/usr/bin/python3 | |
import arxiv | |
import sys | |
import PyPDF4 | |
import re | |
## Usage: arxiref.py 1711.07059 | |
## or: arxiref.py paper.pdf | |
## If given something that looks like an arXiv id, searches for something with that name | |
## If given a filename, treats it as a pdf, looks for an arXiv id on page 1, then proceeds as in first case |
So, haskell is a "Pure Functional" language, which basically means that functions behave(almost) like mathematical functions, rather than how they behave in other languages. So in most other languages a function can do whatever before it returns, print some text, wipe the root partition, launch nukes against China, whatever. In haskell, that's (almost) not allowed: a function takes an argument, returns an argument, and that's it.
So how do you accomplish anything? Software has to actually do stuff, so how do you interact with anything? To explain that, we need a brief interlude to explain types in haskell. First there are simple types like int
, string
, so on. Just like a type in C. Then you have parametric types, like List
. So you can have a List int
, or a List string
, and that's a linked list of integers or strings. Lastly, we need to explain parametric types. For example, you might have a function that takes the length of a list. The thing about that function is that it actually doesn't care abou
{{ | |
--Arbitrary haskell code in double curly brackets | |
--Top-level definitions are available throughout text | |
emph s = "*" ++ s ++ "*" | |
}} | |
This will be rendered raw. | |
{{ | |
-- String-typed expressions will be printed into the final text wherever they appear | |
emph "This will be emphasized" |
{-# LANGUAGE DataKinds, GADTs, StandaloneDeriving, FlexibleInstances, FlexibleContexts #-} | |
import Data.Foldable hiding (foldl) | |
import Data.Traversable | |
import Data.Monoid | |
import Control.Applicative | |
-- vector stuff -- | |
data Nat = Z | S Nat |