How it feels to join an all-Haskell startup
wagonhq.com
How it feels to join an all-Haskell startup
1–10 of 59 posts
Re: How it feels to join an all-Haskell startup
#2Re: How it feels to join an all-Haskell startup
#3Re: How it feels to join an all-Haskell startup
#4On a biweekly basis I'm shown something new causing my brain to melt, leak out of my ear & pool onto the floor near my desk. It's awesome[0]!
Today's was using impredicative types + `$` has a special case for dealing with it[1].
[0]: ...some number of hours later when I've collected my thoughts and think "OHHH... duh" [1]: https://ghc.haskell.org/trac/ghc/wiki/ImpredicativePolymorph...
Re: How it feels to join an all-Haskell startup
#5Could someone explain 'applicative'? To me it seems like throwing some magic syntax at a simple usecase to make it more terse and less readable - but maybe I misunderstand and it's something every Haskell programmer knows.
Concretely, if you think about promises in JavaScript, for example, if you have a function A -> B -> C -> D, say, and you have three promises of types Promise A, Promise B and Promise C, you can construct a Promise of type Promise D by running the three in parallel, and applying your three-argument function when they are all done. So you've turned a function of type A -> B -> C -> D into one of type Promise A -> Promise B -> Promise C -> Promise D. If you can do that sensibly for any number of function arguments, you have an Applicative. ("sensibly" here means that there are type class laws which have to hold)
Every Monad is also an Applicative functor, since you could use do notation to compose your promises instead, but there are other interesting Applicatives which do not come from Monads.
Re: How it feels to join an all-Haskell startup
#6How was that snippet an improvement to your coding style? The original was extremely clear, and now someone who reads your code has to understand what (,) and do. IMO this tendency for code golf one-upmanship is a huge detractor for anyone wanting to learn the language.
Re: How it feels to join an all-Haskell startup
#7How was that snippet an improvement to your coding style? The original was extremely clear, and now someone who reads your code has to understand what (,) and do. IMO this tendency for code golf one-upmanship is a huge detractor for anyone wanting to learn the language.
Re: How it feels to join an all-Haskell startup
#8Could someone explain 'applicative'? To me it seems like throwing some magic syntax at a simple usecase to make it more terse and less readable - but maybe I misunderstand and it's something every Haskell programmer knows.
My favorite example is "I want to grab three web pages concurrently and return them in a single triple." To the haters who think this is just golf, just TRY to write this as beautifully in any other language.
(page1, page2, page3)
Concurrently (getURL "url1")
Concurrently (getURL "url2")
Concurrently (getURL "url3")
(taken from the excellent haddocks for Control.Current.Async https://hackage.haskell.org/package/async-2.0.1.4/docs/Contr...)Re: How it feels to join an all-Haskell startup
#9How was that snippet an improvement to your coding style? The original was extremely clear, and now someone who reads your code has to understand what (,) and do. IMO this tendency for code golf one-upmanship is a huge detractor for anyone wanting to learn the language.
However, I don't see what's so terrible about learning 3 new functions. Sorry it doesn't look like Javascript anymore.
Re: How it feels to join an all-Haskell startup
#10How was that snippet an improvement to your coding style? The original was extremely clear, and now someone who reads your code has to understand what (,) and do. IMO this tendency for code golf one-upmanship is a huge detractor for anyone wanting to learn the language.
liftIO (liftA2 (,) randomIO getCurrentTime)
Eh, I'm not sure I could defend it. I'd honestly probably actually do bid