While learning Elm I came across concept common in functional programming called Currying, where you partially execute some function and return a function that composes the first one.

Here is an example in Elm:

Let’s write a function that divides 2 numbers and returns difference as a string:

divideNumbers: Float -> Float -> String
divideNumbers divisor dividend = 
  dividend / divisor
    |> toString

Now lets say there we want to make a function that always divides by 2 (divisor = 2). We can create a new function using divideNumber fn:

divideBy2: Float -> String
divideBy2 =
  divideNumbers 2

Currying should not be confused with composition. To quote reply form stackoverflow:

Currying is a way of constructing functions that allows partial application of a function’s arguments.

Compose should return a function that is the composition of a list of functions of arbitrary length. Each function is called on the return value of the function that follows.

Until now I’ve been using meld for comparing files, but now VSCode (v1.19.1) has similar functionality. It is called Compare Active File with Clipboard and it’s self explanatory.

Default key combination is Ctrl+K C but it can be changed in settings: workbench.files.action.compareWithClipboard.

If there is a need to rename a git branch follow these steps:

Renaming local branch

Renaming a current branch:

 git branch -m new_name

If you are on a different branch:

 git branch -m old_name new_name

Push to remote

git push origin new_name

or if you don’t want to type name of new branch (git can obtain the branch name itself):

git push origin HEAD

Delete old remote branch (optional)

In case old branch is already on remote, you will need to delete it:

git push origin :old_name