
STGi: Visual STG implementation to help understand Haskell's execution model - adamnemecek
https://github.com/quchen/stgi
======
greg7mdp
That's what I like about Haskell. Brilliant people writing really cool stuff.
I'm constantly amazed by Haskell libraries!

~~~
demilicious
Agreed. I've never felt an "in-over-my-head" feeling as strongly as when I
first stumbled upon the Lens package docs on Hackage.

~~~
cm3
The idea behind lenses is simple, but I haven't used it yet. What's the
complexity?

~~~
DanWaterworth
The lens library is more like a dialect of Haskell than a library.

~~~
cm3
Not trying to sound snarky, serious question: Is it due to Edward's (over)use
of the type system, making it fit (however complex) into the Haskell system?
Could a more expressive system like Idris have avoided the complexity?

If so, I'm certain there is a simple implementation of the lens idea that's
much easier to understand and apply.

~~~
tikhonj
No. It's more the sheer breadth and scope of the vocabulary lens develops. It
has a ton of operations and abstractions, all written in a distinctly "lensy"
style with their own idioms. They fit together beautifully, but are distinct
enough from normal Haskell style that learning them takes additional effort.

If you just had a small subset of the library that only exposed, say, Lens,
Traversal and Prism, it would be much more approachable—but would also miss
out on much of what makes lens so universally useful. It wouldn't hit all the
edge cases lens does and it wouldn't be "batteries included". You'd find
yourself ultimately reinventing part of the other abstractions that lens has
but, since you're doing it independently and _ad-hoc_ , the result would be
uglier.

~~~
gh02t
> learning them takes additional effort.

Do you have any recommendations on what might be a good read or project for
learning Lens? I played around with it a couple times, but I could never find
an introduction or anything that really let me get a grasp on their core
concepts and use. I'm not looking so much for the mechanics of how to use
them, but more of an overview of _when_ and _why_ I might want to use them.

