6 ms·
What kind of applications your team are working it? How's the overall development process felt? I'd like to know the reason to choose Haskell over other languag
by anta40 3y ago
What kind of applications your team are working it?
How's the overall development process felt?
I'd like to know the reason to choose Haskell over other languages.
- ilikebits 3y agoRe: applications and language comparison, see my answer over at https://news.ycombinator.com/item?id=36744384 https://news.ycombinator.com/item?id=36744384 Re: development process - it's very similar to development in other languages. Write, compile, yell at compiler, push, complain about how slow CI is, deploy. You know, the usual. I think the most interesting difference is the _onboarding_ curve. Haskell's curve is pretty brutal, although I think most of this is because of bad pedagogy (many monad tutorials are bad, and beginners can't tell) rather than because of intrinsically difficult concepts. Some observations: 1. Empirically, zero to code review is roughly six weeks for a professional industry software engineer. It's not that much longer than other languages we've had to teach. But it _feels_ very brutal because zero to side project is roughly three or four weeks. Contrast this against Go, where zero to side project is about five minutes. 2. Having an experienced Haskell engineer on your team to start with makes a WORLD of a difference. You've gotten a type error - why? Is it because GHC is doing weird backwards type inference stuff again? Or is it because you've misunderstood this fundamental concept? Or is it because you've done a typo, and GHC has inferred a downstream site to be a type error? This sort of thing is very difficult to explain in words and in general, and much easier to pick up through experience and mentorship. If you do not have an experienced Haskeller at your disposal, I would strongly recommend starting with side projects first, and using the Functional Programming Slack (fpslack.com), who are some of the friendliest and most patient folks I've had the pleasure of talking to.
- Tade0 3y ago> (many monad tutorials are bad, and beginners can't tell) It appears monads truly are something you can either understand or explain, but not both. I find it suspicious. I mean, plenty of Haskell devs out there, surely it's not that hard?
- icrbow 3y agoIt's like explaining a hand with four fingers and a thumb. The whole story is... ugh. But you can grasp enough of it to start using almost right away.
- PartiallyTyped 3y agoYou can just say that a monad is a way to chain operations together by wrapping a value. The consumer usually doesn't need to know the gore-y details of how a monad is implemented, only the purpose of it and how to use it. A Maybe monad just says the value may be Something(x) or Nothing. You won't know until you run the computation. If you use flatmap and give a function that takes an x and gives a Maybe[x], the monad will first map into Maybe[Maybe[x]] and then flatten into Maybe[x]. The computation has not happened until you execute it and internally all the functions have been composed together. A List[A] just says, give me a function A->List[B], and I will flatmap (flatten `compose` map) it. So it maps each element into a possibly empty list of Bs, and then flattens it by concatenating them. You can define your own monads, and as long as they obey the laws of monads, you get a bunch of stuff for free.
- icrbow 3y agoYou say "by wrapping a value" and then confuse it with the wrapper right away. No, monads are not wrappers. Some wrappers are monads, but not all. inb4, monads are not pipes either.
- PartiallyTyped 3y agoSure, a monad is a type constructor. The constructed type allows you to compose transformations. Each monad constructs a type that behaves differently and expects different things, but in general; the monad is defined by a unit/point/return function which brings a value into the monadic context, and a flatMap function aka bind, which further breaks down to “flatten after map”. So List[_] is a type constructor, given a type T, it produces a List[T], which defines some transformations. Return creates a single element list, and flatmap takes the A->[B] applies it everywhere and then concatenates. The nice thing about the wrapper analogy is that even though it is technically wrong, it is easier for people to get it because it follows naturally from OOP and it is a sufficiently useful mental model imho.
- shae 3y agoWe built an Android app in Haskell because Python was too hard for loading shared objects. We started from nothing in January, shipped the app last month. We have 2.5 developers.
- penguin_booze 3y ago> We built an Android app in Haskell because Python was too hard for loading shared objects. Can you elaborate the process? The only reference I could only find this: https://wiki.haskell.org/Android https://wiki.haskell.org/Android. How did you end up developing/deploying your UI?
- shae 3y agoWe used reflex-frp, so our app was a webview that worked on localhost and Android. The docs say it also works on iOS but we don't have an iPhone. The process was learning Functional Reactive Programming, then learning reflex-frp, then getting a contract with obsidian (creators of reflex) for one hour a week where we could ask questions. ( https://github.com/reflex-frp/reflex-platform https://github.com/reflex-frp/reflex-platform ) We had a grant requirement to create a phone client for Tahoe-LAFS, a Python application with a bunch of dependencies, including ZFEC, a forward error correction library. ( https://tahoe-lafs.readthedocs.io/ https://tahoe-lafs.readthedocs.io/ ) ( https://github.com/tahoe-lafs/zfec/ https://github.com/tahoe-lafs/zfec/ ) We needed bug for bug compatibility with the Python codebase, so I ran Tahoe on localhost and tested the Haskell client against the Python server. We used servant to build the API, since it builds both client and server side from the same description. ( https://hackage.haskell.org/package/servant https://hackage.haskell.org/package/servant )
- penguin_booze 3y agoThanks for your notes. Any chance your app is on the Play store so that I can check it out?
- shae 3y ago