CapsLock is RCTRL ... i do this on all keyboards
FN CapsLock is RCTRL ... was accidently toggling capslock with fn+capslock
LCTRL is FN ... arrow/pg/home on right half, FN+arrow I now prefer on ALL keyboards... so nice
Copyright © 2017 Fantasyland Institute of Learning. All rights reserved.
A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.
val square : Int => Int = x => x * x
# Aliases for common git commands. E.g., enter "git d" for "git diff" | |
# These settings live in the ~/.gitconfig file. | |
[alias] | |
b = branch | |
ba = branch -a | |
ci = commit | |
co = checkout | |
d = diff | |
dc = diff --cached |
Quite a lot of different people have been on the same trail of thought. Gary Bernhardt's formulation of a "functional core, imperative shell" seems to be the most voiced.
"Imperative shell" that wraps and uses your "functional core".. The result of this is that the shell has fewer paths, but more dependencies. The core contains no dependencies, but encapsulates the different logic paths. So we’re encapsulating dependencies on one side, and business logic on the other side. Or put another way, the way to figure out the separation is by doing as much as you can without mutation, and then encapsulating the mutation separately. Functional core — Many fast unit tests. Imperative shell — Few integration tests
-- The meta-circular interpreter from section 5 of Reynolds's Definitional | |
-- Interpreters for Higher Order Programming Languages | |
-- (http://www.cs.uml.edu/~giam/91.531/Textbooks/definterp.pdf) | |
data EXP | |
= CONST Const | |
| VAR Var | |
| APPL Appl | |
| LAMBDA Lambda | |
| COND Cond |
Type classes are a language of their own, this is an attempt to document some features.
Work in progress.
(Hackage) EDSL, Ivory
-- | Things that can be safely stored in references.
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE OverloadedLabels #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
{-# LANGUAGE MagicHash #-} | |
{-# LANGUAGE ScopedTypeVariables #-} |
module Printf | |
%default total | |
data Format = FInt Format -- %d | |
| FString Format -- %s | |
| FOther Char Format -- [a-zA-Z0-9] | |
| FEnd -- | |
format : List Char -> Format |
{- | |
This code shows how to check if a type-level list contains a given type. | |
It first shows the approach required for older versions of GHC (< 7.6.x) | |
and then a version using closed type families supported in GHC 7.8.1 and greater. | |
-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} |