> The same is not true of Haskell. If you have never looked at Haskell code, you may have difficulty following even simple functions. Why is it that people talk about this almost as if it's done virtue of the language? As if the fact that's it's so inscrutable proves that it's valuable, different, and on a higher plane of computing.
I tried Haskell for 5 years
21–30 of 273 posts
Re: I tried Haskell for 5 years
#22If anyone's curious to try out functional programming, I would highly recommend Elm. I haven't been so excited about a language since I went from C to Ruby ten years ago, and Pragmatic Studios has a great course on it (I have no affiliation): https://pragmaticstudio.com/courses/elm
Re: I tried Haskell for 5 years
#23> The same is not true of Haskell. If you have never looked at Haskell code, you may have difficulty following even simple functions. Why is it that people talk about this almost as if it's done virtue of the language? As if the fact that's it's so inscrutable proves that it's valuable, different, and on a higher plane of computing.
Re: I tried Haskell for 5 years
#24Question to the Haskell experts here. Is Haskell more academic in nature or used heavily in Production environments? Is there an application sweet spot/domain (say Artificial Intelligence/Machine Learning, etc) where it shines over using other languages (I am not talking about software/language architectural issues like type systems or such)? I have no experience with Haskell but do use functional languages such as E…
Weirdly, what Haskell is good at is generality. Which is much the same as for LISP.
I'd say the Haskell community remains academic/hobbyist, but that's not to say there aren't plenty of people doing Real Work in it.
Re: I tried Haskell for 5 years
#25> The same is not true of Haskell. If you have never looked at Haskell code, you may have difficulty following even simple functions. Why is it that people talk about this almost as if it's done virtue of the language? As if the fact that's it's so inscrutable proves that it's valuable, different, and on a higher plane of computing.
Re: I tried Haskell for 5 years
#26> 1. There is a learning curve. Time and experience can cover up anything. So this does not say much about Haskell other than it is all negative without time and experience. > 2. Haskell has some very nice libraries So does NodeJS and (on an abstract level) Microsoft Word. Libraries are infrastructures and investments that (like time and experience) can cover up any shortcomings. > 3. Haskell libraries are sometimes…
The way that functions can compose in the hands of a gifted developer is truly elegant. That said, I'm not sure it's a skill that translates well to the general development community (and maybe that's fine?).
Re: I tried Haskell for 5 years
#27> The same is not true of Haskell. If you have never looked at Haskell code, you may have difficulty following even simple functions. Why is it that people talk about this almost as if it's done virtue of the language? As if the fact that's it's so inscrutable proves that it's valuable, different, and on a higher plane of computing.
Re: I tried Haskell for 5 years
#28Question to the Haskell experts here. Is Haskell more academic in nature or used heavily in Production environments? Is there an application sweet spot/domain (say Artificial Intelligence/Machine Learning, etc) where it shines over using other languages (I am not talking about software/language architectural issues like type systems or such)? I have no experience with Haskell but do use functional languages such as E…
As for particular places where it shines, I don't know of any in particular. I remember when taking my Declarative Programming course in university my lecturer loved to talk about an experiment the military did where they challenged a few teams to implement some kind of radar system in their chosen language and evaluated them based on time taken, correctness and code complexity (LOC) at the end. The Haskell team performed very very well. I can't find any details on this experiment though...
Re: I tried Haskell for 5 years
#29> very hard to understand why a function could be useful in the first place So true. https://hackage.haskell.org/package/base-4.9.1.0/docs/Contro... > mfix :: (a -> m a) -> m a > The fixed point of a monadic computation. mfix f executes the action f only once, with the eventual output fed back as the input. Hence f should not be strict, for then mfix f would diverge. But why tho?
fix f --> f (fix f)
That is, to compute the fixed point of some function f, we give f access to the fixed point (i.e. fix f) in order to compute the fixed point.
Consider f is strict, and that we try to run this:
fix f --> f (fix f)
--> f (f (fix f))
--> f (f (f (...)))
Why? Because if f is strict it has to evaluate its argument before evaluating the body.On the other hand, if f is non-strict, we can evaluate its body without evaluating its argument first.
mfix generalizes fix to monadic functions. When we have monadic functions, we're usually dealing with side-effectful computation, so we want to make sure that we only force the monadic action f once, so that the side effects only run once.
---
Another question to ask is "what is fix even useful for"? fix is how we introduce general recursion into a language. For example, the lambda calculus has fix, except it's called the Y combinator. Compare:
Y f --> f (Y f)
fix f --> f (fix f)
The lambda calculus is Turing complete because it has this general recursion.fix is often used in smaller toy languages to also make them Turing complete, because this form of recursion is straightforward.
While Haskell has recursive function definitions, fix (and mfix more generally) are sometimes useful in their own right.
Re: I tried Haskell for 5 years
#30Question to the Haskell experts here. Is Haskell more academic in nature or used heavily in Production environments? Is there an application sweet spot/domain (say Artificial Intelligence/Machine Learning, etc) where it shines over using other languages (I am not talking about software/language architectural issues like type systems or such)? I have no experience with Haskell but do use functional languages such as E…