6 ms·
Git rebase alters the structures that are relevant for me, like heads of named branches. In Haskell let bindings are immutable. To reference to the results one
by fpoling 9y ago
Git rebase alters the structures that are relevant for me, like heads of named branches. In Haskell let bindings are immutable. To reference to the results one has to put them into new bindings. I.e. if Git was purely functional, the rebase would create new names for branches.
- tathougies 9y agoYou can easily shadow a name in a let binding in Haskell For example, let x = 5 in let x = 6 in putStrLn (show x) would print 6. Unless you turn on compiler warnings, there is never a need to choose new names for variables if the old version is no longer needed.
- catnaroek 9y agoShadowing isn't the same thing as redefining. Try evaluating the following expression: let x = 4 ; f y = x + y in let x = 6 in f 10
- masklinn 9y ago> In Haskell let bindings are immutable. Haskell has mutable refs. That's what Git branches are.
- catnaroek 9y agoBut the contents of a mutable ref aren't let-bound.
- rootlocus 9y agoIf you want immutable branches, you can use tags https://git-scm.com/book/en/v2/Git-Basics-Tagging https://git-scm.com/book/en/v2/Git-Basics-Tagging
- fiatjaf 9y agoSo your entire point amounts to naming?