Live data from Hacker News

An opinionated guide to Haskell

lexi-lambda.github.io

91–96 of 96 posts

Re: An opinionated guide to Haskell

#91

For people who wanna learn Haskell: 1. Don't touch Haskell platform. Install Stack. If you did, Uninstall it. https://mail.haskell.org/pipermail/haskell-cafe/2011-March/0... Why? It is considered harmful https://mail.haskell.org/pipermail/haskell-community/2015-Se... 2. Install Stack: https://haskell-lang.org/get-started/osx If you do not wish to install these dependencies, you may use a virtual machine instead https…

I consulted with one of the co-organizers of the Haskell meetup here in NYC, and while he seems to have a nuanced view that is anti-stack for professional Haskellers, he also recommends stack for new people.

I'm thinking the consensus is that this is good advice.

Re: An opinionated guide to Haskell

#92
post #31

How good is the static analysis tooling (IDE / editor plugins) for Haskell? Given Haskell's powerful type system, I imagine that it must be possible to see warnings, hints, autocompletion and other early feedback about the code in the editor before compilation, like in Java, Kotlin etc. or even better - is that the case?

I use emacs + intern and it’s great. Type errors are underlined immediately, warnings and lint messages are marked. Half the time I let the compiler write the code by using ghc placeholders and playing type golf

> Half the time I let the compiler write the code by using ghc placeholders and playing type golf

Is this method documented anywhere? Sounds interesting.

Re: An opinionated guide to Haskell

#93
post #2

Learning Haskell is one of those two weeks things that’s been on my interests list for a long time, but will likely stay there for awhile yet. Though, if anyone has got any high-quality quick resources handy that’d be appreciated!

http://haskellbook.com/ is a great modern deep dive catered to folks like you! It is long, but guides you along the way

Here's another targeted towards those who already know some Haskell: https://intermediatehaskell.com/

Re: An opinionated guide to Haskell

#94
post #6
post #2

Learning Haskell is one of those two weeks things that’s been on my interests list for a long time, but will likely stay there for awhile yet. Though, if anyone has got any high-quality quick resources handy that’d be appreciated!

I’ve been reading “Real World Haskell” and enjoying it thus far. Big bonus is it is available for free online: http://book.realworldhaskell.org

This is a great book. I brought it on vacation once, read it end to end, and was a much better Haskeller afterwards.

However, it was written a long time ago, and is missing a lot of Haskell's recent history. The book targets GHC 6.8, whereas I'm running 8.2.2. There's a summary at [1]

Again, it's a great book and the price is right, but caveat lector.

[1] http://support.oreilly.com/oreilly/topics/when-will-it-be-an...

Re: An opinionated guide to Haskell

#95

Earlier quoted context omitted.

I use emacs + intern and it’s great. Type errors are underlined immediately, warnings and lint messages are marked. Half the time I let the compiler write the code by using ghc placeholders and playing type golf

> Half the time I let the compiler write the code by using ghc placeholders and playing type golf Is this method documented anywhere? Sounds interesting.

Just put in an underscore where you want to write code. If you compile the code, GHC outputs an error with the expected type as well as all bindings in scope. Then, just work backwards. If you use intero, then all type errors are underlined, including placeholders.

The general feature is called 'typed holes', and there's a wiki page here: https://wiki.haskell.org/GHC/Typed_holes

Re: An opinionated guide to Haskell

#96

Earlier quoted context omitted.

> Half the time I let the compiler write the code by using ghc placeholders and playing type golf Is this method documented anywhere? Sounds interesting.

Just put in an underscore where you want to write code. If you compile the code, GHC outputs an error with the expected type as well as all bindings in scope. Then, just work backwards. If you use intero, then all type errors are underlined, including placeholders. The general feature is called 'typed holes', and there's a wiki page here: https://wiki.haskell.org/GHC/Typed_holes

Thanks.
Post reply on HN