Profile cover photo
Profile photo
Jyri-Matti Lähteenmäki
A wanna-be Software Architect
A wanna-be Software Architect

Jyri-Matti's posts

Post has attachment
About Subtext
I watch a video, which I highly recommend to everyone: I decided to write some thoughts on three issues discussed in the video. Program logic as text versus table Fibonacci and readability/editability Melee example and maintainab...

Some real-life Haskell:

fromCsvFake :: Either String (Vector (Double,Double))
fromCsvFake = CSV.decode CSV.NoHeader $ BS.pack "1.0,2.0"

fromCsv :: IO (Either String (Vector (Double,Double)))
fromCsv = CSV.decode CSV.NoHeader <$> BS.readFile "data.csv"

The first one is a simple line to parse a CSV. Anyone could write that. Feels easy. But it's not "real", it's parsing a fake value.

But I can see from my own programming that when some context is brought in, whether it's IO or anything else, I totally freeze. For some reason I find it incredibly difficult to implement the second function straight away. I'll turn to do-notation and argh, It takes ages to turn that into a one-liner like above.

One of the beauties of Haskell is that it abstracts away contexts. After all, why should it matter if a value has some context around it, since all the same information is there? Shouldn't the same code work for both plain values and contextual ones? Ofcourse it should.

As can be seen from the example, changing the fake value to an IO ByteString, is only a matter of letting the compiler know that we need a slightly different function application, namely <$> instead of $. Alternatively one could lift the function to a contextual scope like this:

fromCsv :: IO (Either String (Vector (Double,Double)))
fromCsv = liftA (CSV.decode CSV.NoHeader) $ BS.readFile "data.csv"

Sometimes I like to think it as lifting, sometimes I like the applicative syntax. I'm not sure yet which one's preferable, maybe it depends.

But one thing really bothers me: Since there are different ways to apply values to functions - the regular way, the applicative way and a monadic way (a.k.a "bind") - and the compiler should know which one is needed, why do I have to be explicit about it? Why couldn't the compiler "automatically lift" the functions for me when needed?

Post has attachment
Sounds like a reeeeally great family to belong to. Worth reading as a whole, but here's a few clips anyway:

"We have no managers, not even a CEO. Instead we rely on self-organization and transparency. Almost everything is bottom-up, and anyone can drive any decision."

"Crisp doesn’t want to earn money from it’s consultants. It is in practice a non-profit company (although not formally so). Consultants keep most of what they earn."

"No gold on the table – we don’t try to build financial value in the company."

"We don’t have a growth target. Growth is not a goal in itself. We grow only when we find awesome people and aren’t suffering from growth pain."

"Our model is simple: anyone who has been at Crisp for 2+ years can become an owner."

"As opposed to most traditional consulting companies, her job is not to maximize profit or sell as many consulting hours as possible. Instead, she optimizes for the happiness index, which means learning and adapting to each person’s individual needs"

"We used to have a more traditional budget process and debate about things like how much Crisp should spend on what. Lots of spreadsheets, discussions, compromises, and not very effective. After a while we got fed up with the whole idea of a centralized budgeting process and abandoned it in favor of something more like beyond budgeting"

Post has attachment
"After each project, we felt we were getting better superlinearly. Our experiences carried forward elsewhere too. Our Python code became more functional, concise and easier to maintain."

Post has attachment
If you're a statistician and think that R is somehow cool, please read this!

Post has attachment

Post has attachment
Interesting. Had to buy to see what's the state of data analysis with Haskell. After all, R is an abomination.

Gosh, my reading list just grew to 58 books...

Post has attachment
Didn't like his style talking to youngsters as a grown up...

...but the point was excellent, and the references to data were interesting.

If you can't find the time to watch this, just remember to get rid of as many lines of code as possible ;)

Post has attachment

Post has attachment
Enlightening video of the remarkable capabilities of Lenses!
I'm sooooo going to spend many nights striving to comprehend all this stuff...
Wait while more posts are being loaded