by miguendes · 6y ago · 0 comments
I took a haskell class back in the day but just the basics, didn't even learn monads.
My goal is not to master the language itself but learn enough to make a better programner.
One thing that has been holding me back is the lack of real world examples. I get demotivated when only solving toy problems.
This looks like a great resource. I have heard a lot about Haskell From First Principles but there's too much stuff in there.
It's a truly batteries-included way to get started with building real world haskell web apps in minutes.
Much like using Rust and Haskell for web I'd much prefer deferring as much to something like Vue and the server APIs (no sever side rendering for that yet so I mostly just IRL use nuxt.js for toy projects). Something Servant (Haskell) does a clean job of. But you can never completely do away with static heavy lifting
This one takes a more modernized Rails or Elixir's Phoenix approach which is really interesting and looks highly usable.
Community size and quality is everything for real life software (something I remember Clojure had early on and now Rust has in spades, best of breed sort of libraries to choose from) so I hope it gets some adoption to see where it goes. I'll give it a shot to toy around with when I get some time.
Wow!
We mainly added the warning in that release because usually the update process is very smooth and takes only one minute, e.g. see this tweet: https://twitter.com/mittie/status/1322574176792825861
hmm, no thanks
> Additionally Nix is very hard to install. This is a stumbling block for a lot of people. Especially when using certain macOS systems you cannot even install nix at all. Luckily most of the nix problems, like the macOS issues will be solved with time.
Great choice
After some time you start wondering why you have to type `List.map` and `Maybe.map` and `Set.map` when they all do the same thing. Then you'll be ready for some Haskell :)
Elm was a great Trojan horse. It limited feature set made it quick to learn and get familiar with the syntax.
When sufficiently proficient in Elm you then find yourself missing some of the features of Haskell i.e. higher kinder types. At that stage Purescript / Haskell is a natural transition as they feel familiar but with more functionality.
I know that Elm works great for front end but how is it for desktop and backend stuff?
It isn't. It's explicitly designed as a purely web front-end language, that's its scope.
Of course, many Elm users like to run another ML-family language in the backend as well. Haskell's Servant backend library, the one used in this article, has a project to automatically generate Elm client code [1]. Elixir is popular as well.
But in general, I'd say that any backend framework that can provide an OpenAPI spec will work well, as you'll be able to auto-generate most if not all of the Elm client code (which is normally dull work and one of the main complaints about Elm).
> in terms of learning materials there isn't much compared to haskell.
To whet your apetite, see https://elm-lang.org/
Then read through the excellent https://guide.elm-lang.org/ - not very long but absolutely enough to hit the ground running.
I looked at haskell a few months ago and had a similar problem.
While I don't mind the toy problems, all those toy problems have something in common...
They can be easily solved with recursion. There are probably patterns to deal with other problems and this would have been more interesting to me.
I just had to think to myself: "If all you have is recursion every tutorial looks like a parser" ;)
The problem with those tutorials is that they’re trying to do two things at once: 1) teach you Haskell and 2) advocate for Haskell.
I’m currently working as a full time assistant for one of the first year computer science courses at my university. This course is taught in a teaching dialect of Racket which does not allow mutation or side effects of any kind.
That doesn’t stop the profs from creating assignments with real world applicability such as graffiti stroke recognizers and decision tree learning algorithms. The key is that they’re not trying to make Racket look good, so the patterns of recursion can get pretty ugly at times.
Maybe my comment was somehow badly written, because you (and the only other reply from chriswarbo) clearly misunderstood me.
I know that recursion is equivalent to iteration^^
My point was that some problems fit the one or the other better.
Look at fft for example. The algorithm is easy with recursion but hard with iteration. For other problems its the opposite.
> They can be easily solved with recursion.
As a sibling mentions, recursion is pretty much required in pure functional programming. There is no notion of time or sequencing: everything we write is a definition. If we don't call another function, then our program will finish; if we don't use recursion (either directly, indirectly via functions like `map`, or via a chain of mutually-recursive definitions) then our program's behaviour will be fixed by the structure of our code (e.g. the number of calls we write). That's fine for simple calculations, but most useful programs depend on the structure of their data (e.g. processing lines in a file, etc.); that requires recursion, since we can't hard-code the right number of calls ahead of time.
Yes, but goto requires a whole bunch of machinery in order to make any sense. It (a) needs a notion of time/sequencing, (b) needs a notion of statement and (c) needs a notion of labelling.
(a) and (b) are often taken as given in imperative programming languages (e.g. C, assembly, etc.), but Haskell has none of them. It's hard to ascribe any meaning to "goto" in Haskell; other than some embedded language like ST or something.
> It is nicer when recursion can be wrapped up in a higher level combinator (map, fold, etc.) or other even higher level abstraction.
I agree, but I was counting those as (indirect) recursion for the purposes of explaining the parent's observation.