Jon Sterling
jozefg.bitbucket.org · Personal blog · on HN since 2014
Danny Gratzer writes about type theory, functional programming, Haskell, ML modules, and compilers.
What HN saysHN commenters cite it for explanations of ML modules and dependent types, and for its post advising Haskell learners not to start with category theory.
19HN people shared it
9linked it in comments
25stories submitted
593story points
10 years agolast shared
2014people per year2026
Most-shared posts
- 1A Crash Course on ML Modules5 people · 24 points · first shared 2015 · discussion on HN
- 2Please Don't Learn Category Theory (2013)3 people · 56 points · first shared 2014 · 79 comments on HN
- 3Introduction to Dependent Types: Haskell on Steroids2 people · 4 points · first shared 2014 · discussion on HN
- 4Leaving Go1 people · 214 points · first shared 2014 · 214 comments on HN
- 5An Explanation of Type Inference for ML/Haskell1 people · 101 points · first shared 2015 · 12 comments on HN
- 6A Tiny Compiler for a Typed Higher-Order Language1 people · 71 points · first shared 2015 · 15 comments on HN
- 7Compiling a Lazy Language in 1,000 words1 people · 37 points · first shared 2015 · 6 comments on HN
- 8The Guts of a Spineless Machine1 people · 23 points · first shared 2014 · 1 comments on HN
- 9A Twelf Introduction1 people · 23 points · first shared 2015 · 1 comments on HN
- 10A Proof of Church Rosser in Twelf1 people · 14 points · first shared 2015 · discussion on HN
- 11Bargain-Priced Coroutines1 people · 6 points · first shared 2014 · discussion on HN
- 12Getting Proper Tail Calls Out of C1 people · 4 points · first shared 2014 · discussion on HN
- 13Teaching Python with a Raspberry Pi1 people · 3 points · first shared 2014 · discussion on HN
- 14Teens and Functional Programming (2013)1 people · 2 points · first shared 2014 · discussion on HN
- 15Observations about -XStaticPointers1 people · 2 points · first shared 2015 · discussion on HN
What HN people wrote when they linked it
z1mm32m4n · 2016-08-02
Coming from an SML background, one of the things that's always tripped me up about Haskell is that it doesn't have structures, signatures, and functors for grouping code. Instead it has modules, which are not much more than groups of exported functions.
For Haskellers coming to SML, there's "A Crash Course on ML Modules"[1] which does a nice job of explaining things in the opposite direction.
Are there any resources like this out there that discuss how best to break down and write modular Haskell programs?
[1]: http://jozefg.bitbucket.org/posts/2015-01-08-modules.html
(update: I realized the original article I linked to wasn't the one I thought it was!)
codygman · 2014-11-16
> Go model a square and a rectangle in your favorite statically typed language.
Okay.
data Shape = Square Int | Rectangle Int Int deriving (Show)
> You will find that square extends rectangle and setting the length on a square also sets the width.
Why? I don't really see a need for square to extend a rectangle.
> So if I have a collection of rectangles which contains an unknown number of squares of which I set the width on each of them.
Like this?
> let unknowns = [(5,4),(3,2),(4,4)]
> let toShape (x,y) = if x == y then Square x else Rectangle x y
> map toShape unknowns
[Rectangle 5 4,Rectangle 3 2,Square 4]
Tomorrow I'll see if I can make this type-safe by using dependent typing as shown in: [0][1][2]
This was easily solvable in my staticly typed language as you can see. In something like Idris I could have
very easily encoded the toShape function the the type signature.
0: http://www.alfredodinapoli.com/posts/2014-10-13-fun-with-dependent-typ…
1: https://www.fpcomplete.com/user/konn/prove-your-haskell-for-great-safe…
2: http://jozefg.bitbucket.org/posts/2014-08-25-dep-types-part-1.html
maxiepoo · 2016-11-09
The use of the term "witness" here comes from constructive logic, where proofs of propositions have actual computational content. There "witness" means the same thing as "proof" but is more evocative that the proof is data that can actually be manipulated.
You might like this article if you're interested to learn more: http://jozefg.bitbucket.org/posts/2015-01-09-constructivism.html
tome · 2016-08-07
> If you want to learn Haskell, forget Category theory
Yes please. Please Don't Learn Category Theory to Learn Haskell: http://jozefg.bitbucket.org/posts/2013-10-14-please-dont-learn-cat-the…
> learning category theory will likely help you learn Haskell about as much as learning lambda calculus will help you learn Lisp. Maybe a bit less
Much, much less, I would have said
jez · 2016-07-16
Danny Gratzer wrote about this a while back:
http://jozefg.bitbucket.org/posts/2015-01-08-modules.html
bjz_ · 2016-07-16
> Everybody who does PL theory more seriously probably knows that, but I didn't realize how close type inference and prolog-like systems look.
Yup! This is more to do with a very specific part of type theory - ie. 'type reconstruction' (more commonly referred to as 'type inference'). One of the most notable examples of this is the so-called 'Hindley-Milner type system' which can be proven to decidable. Here is a good explanation of the constraint-solving algorithm: http://jozefg.bitbucket.org/posts/2015-02-28-type-inference.html
agumonkey · 2015-05-20
So weird, I just opened http://jozefg.bitbucket.org/posts/2014-10-17-quotients.html 1 minute ago.
taylorlapeyre · 2014-04-28
I just wanted to point out that the author of this article is a high school student.
http://jozefg.bitbucket.org/about.html
tjr · 2014-01-15
I like how he wrote a post a few days later, Learn You Some Category Theory:
http://jozefg.bitbucket.org/posts/2013-10-22-category-theory-in-haskel…