In functional programming you often want to apply a function partly. A simple example is a function add
.
It would be nice if we could use add
like:
var res2 = add(1, 3); // => 4
var add10To = add(10);
var res = add10To(5); // => 15
// https://raw.githubusercontent.com/donnut/typescript-ramda/master/ramda.d.ts | |
// https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/lodash/lodash.d.ts | |
declare namespace fp { | |
interface Dictionary<T> { | |
[index: string]: T; | |
} | |
interface CurriedFunction1<T1, R> { |
[{x:0.4,c:"#373737",t:"#ffffff",g:true,f:1,w:0.5,h:0.6},"\n\n\n\n\n\nEsc",{x:0.09999999999999998,w:0.5,h:0.6},"\n\n\n\n\n\nF1",{x:0.10000000000000009,w:0.5,h:0.6},"\n\n\n\n\n\nF2",{x:0.10000000000000009,w:0.5,h:0.6},"\n\n\n\n\n\nF3",{x:0.09999999999999964,w:0.5,h:0.6},"\n\n\n\n\n\nF4",{x:0.10000000000000009,w:0.5,h:0.6},"\n\n\n\n\n\nF5",{x:0.10000000000000009,w:0.5,h:0.6},"\n\n\n\n\n\nF6",{x:0.09999999999999964,w:0.5,h:0.6},"\n\n\n\n\n\nF7",{x:0.10000000000000053,w:0.5,h:0.6},"\n\n\n\n\n\nF8",{x:6.55,w:0.5,h:0.6},"\n\n\n\n\n\nF9",{x:0.09999999999999964,w:0.5,h:0.6},"\n\n\n\n\n\nF10",{x:0.09999999999999964,w:0.5,h:0.6},"\n\n\n\n\n\nF11",{x:0.10000000000000142,w:0.5,h:0.6},"\n\n\n\n\n\nF12",{x:0.09999999999999964,w:0.5,h:0.6},"\n\n\n\n\n\nSys<br>Req",{x:0.09999999999999964,w:0.5,h:0.6},"\n\n\n\n\n\nScrl<br>Lck",{x:0.10000000000000142,w:0.5,h:0.6},"\n\n\n\n\n\nBreak",{x:0.09999999999999787,w:0.5,h:0.6},"\n\n\n\n\n\nKeypad",{x:0.10000000000000142,w:0.5,h:0.6},"\n\n\n\n\n\nProgram"], | |
[{y:-0.25,x:2.25,f:3},"{\n5"," |
#!/usr/bin/env bash | |
# MIT © Sindre Sorhus - sindresorhus.com | |
# git hook to run a command after `git pull` if a specified file was changed | |
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`. | |
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
check_run() { | |
echo "$changed_files" | grep --quiet "$1" && eval "$2" |
Eclipse .project
and .classpath
files are XML files, and you can hook into
sbteclipse's generation process by using the classpathTransformerFactories
and projectTransformerFactories
setting keys.
(The following Scala samples should be inside your project's Build.scala
file, or a plugin)
Let's say we want to add the com.example.nature
nature to our project. The