
Reimplementing “git clone” in Haskell from the bottom up (2013) - poppingtonic
http://stefan.saasen.me/articles/git-clone-in-haskell-from-the-bottom-up/
======
wldlyinaccurate
As somebody who has only recently started looking into functional programming,
this was absolutely fascinating.

Even though I'm not very familiar with Haskell, I find this code much more
concise and easy to follow compared to the original git-clone implementation
in C. Though perhaps that's more down to the author's coding style?

~~~
wyager
In my experience, pure functional programming, combined with Haskell's
relatively permissive syntax, allows for very natural-language-like and well-
structured programs.

Languages like Agda can do this even more impressively. You can do stuff like
write

    
    
        if_then_else_ : Bool -> a -> a -> a
    

And you can split up the "if", "then", and "else" and put the arguments where
the underscores are.

~~~
Retra
The mixfix notation in Agda seems really amazing. I am always wishing I could
write code like "add _ to _" or "sort _ by _", etc...

~~~
beagle3
It's almost exactly smalltalk (circa 1980 or so) notation.

~~~
Peaker
Agda mixfix supports things like:

    
    
        [ foo ]
        bar !
        ! baz
    

etc.

It also supports precedence parsing.

I don't Smalltalk can do all of these.

Smalltalk, unlike Agda, can probably omit the spacing around operators,
though, while Agda can't :)

~~~
beagle3
I probably should look more closely at Agda.

But the if_then_else_ example is basically smalltalk equivalant - although I
suspect Agda will be able to do without the angle brackets that Smalltalk
often needs in these cases.

------
amelius
Interesting.

It would also be a nice exercise to implement all of the internet RFCs, such
as an email server, etcetera in Haskell. That's still a bit lacking. And it
would be very useful if it existed, IMHO.

~~~
nicolast
I wrote an NFS server in Haskell, using Literal Haskell to implement all
related RFC's 'inside' the RFC documents, interleaving code (lots of serdes
stuff...) with the specification.

~~~
mzs
link please

~~~
nicolast
Closed source (for now) I'm afraid...

------
sleepychu
Don't suppose anyone knows where those nice diagrams are from? (Hoping they're
generated from a tool)

~~~
ky3
You're correct that they're generated from a tool, and it's diagrammix [1].

[1]
[http://www.reddit.com/r/programming/comments/1cgi2x/reimplem...](http://www.reddit.com/r/programming/comments/1cgi2x/reimplementing_git_clone_in_haskell_from_the/)

~~~
sleepychu
OSX :-(

