Managing Cabal sandbox environment

Cabal is the defacto build tool for building packages in the haskell universe. Unfortunately, it was not designed to be a package manager for haskell and has some limitations. The most recent improvement to cabal was the introduction of cabal sandboxes, which goes a long way to help haskell developers avoid the infamous cabal hell.

Still, the utilities for cabal sandbox are generally rough on the edges, so here’s a few shell functions and wrapper functions I have written to make it easier to automate the management of cabal sandbox environment –

It works much like python’s virtualenv/virtualenvwrapper, you can easily switch to a particular cabal environment with a single command and set your cabal sandbox’s bin directory into your `$PATH`.

A few convenient wrapper functions like `ghcis`, `ghc` and `runhaskells` (notice the “s”) also help us avoid specifying the `-package-db` flag everytime we want `ghci` or `ghc` or `runhaskell` to use the cabal sandbox package database. `cabal exec — runhaskell` does the same thing of course, but I am just too lazy to type such lengthy command.

So there you go, a simple shell script (`zsh` at the moment) to simplify the management of my cabal sandbox environment for my haskell projects and experiments.

Execution Discipline

I have often been asked to help start-up founders look for technical talent because of my deep involvement in various open source software community work and because of various pro-bono community service I have done over the years.

As a software consultant building apps for customers and ex-freezer product lead for a local scientific instruments company over a career spanning 8+, 9 years, I have also acquired a deep understanding of product development cycles and the human dynamics between business and technology teams.  In a front row seat (as an employee and as a software consultant), I have observed first hand how successful product and business owners build their company and how unsuccessful ones behave.  Skills and luck (“market timing” for example) are factors that contribute to the success stories; and conversely, are also factors that can lead to a company’s downfall.

But above all else, the successful business/product owners I know are always those that have execution discipline.

What do I mean by Execution Discipline?

Execution discipline is about following clear methodologies when making product hypothesis, business or technology decisions and allocating resources. It is also about systematically evolving the methodology in a clear and deliberate manner as new facts and information becomes available.  In other words, one can start out with a completely wrong methodology, or a product hypothesis that has no demand for a given situation, but has the self-awareness and the temperament to evolve towards a more appropriate methodology or hypothesis.

Or to put it in Jack Sparrow’s words…

The problem is not the problem.  The problem is your attitude about the problem.


One of my most successful clients started out his online business ventures by working with a range of software developers.  When he first got into the online software business, he was completely unaware of all the intricacies involving online marketing, software development and the differences between all the freelance developers out in the market.  For more than a year, he hired various developers to build out various online apps he has in mind.  Every single one failed – because of a bad hire or simply because the idea he had has no legs – no one needed what he built.

With each failure, he learnt something new and evolved his approach.  Through this process of systematic trial and error, a product he built became immensely popular and profitable.

In the scientific instruments company I worked for before I started my own gig, my bosses exhibited the same kind of discipline.  They are relentless and systematic in their pursuit for perfection – whether it’s sales and marketing implementation or manufacturing (existing products) or new product development.  That is a discipline that sees a – at that time in 2006 – year-by-year company revenue of USD$11 million.  Yes, it’s not a Google-scale success.  But it certainly is a successful, profitable and self-sustaining business that is continuing to evolve and grow.

On the other hand, some of the worst kind of customers I had when I was consulting and writing software as a service, are business owners that change their mind in completely random whims.  Make no mistake, many of these customers are very brilliant people and are extremely well connected too.  They possess individual skills (marketing, sales or otherwise) that would easily match any of the successful examples I mentioned above.  It is almost as-if their brilliance is their curse – always distracted, always quick to change their minds before a hypothesis is tested and always having “the next new idea”.

So if you are to ask me what’s the one single attribute that I respect in a business owner or a product owner, I will say “Execution Discipline” – with no hesitation.

So why is this important?

Besides the obvious fact that execution discipline gives a start-up a better chance of finding product-market fit and thus achieve the elusive “start-up success”, technical talent likes working with business owners and leaders that behave in a predictable fashion.  Even when dealing with the inevitable uncertainties of a start-up company, a disciplined leader that is able to steer the ship and change directions in a calm, deliberate manner commands the respect of his/her team.

First time entrepreneurs often revel in the fact that they are completely free to move fast and change directions rapidly – and yes, indeed, the ability to change direction rapidly is one of the reasons why a start-up can do what a large, monolithic, established company cannot.  However, the mistake these first time entrepreneurs often make is to change directions randomly.  Don’t make the mistake of thinking that making changes rapidly is progress.  Change because data and facts emerge to signal a need for a change; and not because the entrepreneur has a “eureka” moment.

So start-up founders looking to hire technical talent: my advice is simple – be clear and systematic about the problem you want to solve and the customers you want to serve.  Everything else follows and evolves from there.

Does a start-up founder need to code? That is a story and a controversial debate for another time and not the focus of this post.

The observation I am sharing with you here in this post is simple: luck, market timing and skills aside, the most important attribute that technical people value in their leader is the leader’s ability to steer the ship in a calm, systematic manner – storm, kraken, or whirlpool.

Just like Jack Sparrow.

Working in a distributed team? Reduce email, use async tools

At Hackers & Painters last Friday, Jon Yongfook Cockle shared with a full-house crowd how he managed to build his online business while traveling around Asia.

As an independent technopreneur who manages his own Lean customer discovery cycle, designs his own interface, writes his own code and supports his customers online, Yongfook is able to live a balanced digital nomad lifestyle beautifully. Over a period of one year (since July 2013), he has built a web application with a strong value proposition that serves his target customers; and has created a sustainable online business with a recurring revenue that allows him to travel indefinitely.

What about teams?

His presentation led me to ask myself a few more questions in the context of a bigger team.

  1. If you are working in the context of a team to run a slightly larger business, can the team also function effectively as digital nomads?
  2. What are the skills and tools we need so we can collaborate effectively in the context of a team?
  3. What if you have a hardware component to your product and you are not building a 100% software product?

Before I began my journey to build an Optometry solution/product in AlgoAccess, I was working in a semi-distributed team as a tech consultant – with some colleagues working in Europe and some working locally in Singapore.  In that context, I set up and manage tools such as Redmine, Gitlab, Emails (obviously), Skype and use online invoicing tools like Freshbooks to keep the whole team in-sync.

My current team in AlgoAccess is a co-located team until recently. Over a period of 7 months of co-located work since Jan 2014, we have designed and built an Optometry solution from the ground-up.  We have raised a seed round of angel funding from veterans in the Optometry industry and we have designed and built a fully working product over 4 sprint cycles and a couple of months of on-site customer discovery and product trials.  Our product development pace is balanced and fast as a co-located team and even though our team also included 3 software interns, the co-located environment allowed us to share knowledge quickly, level up as a team and handle uncertainties with regards to product decisions (a typical challenge new products always face).

From co-located to distributed

This brings us to the next phase of our company/team – can we still function effectively in a distributed manner?  Now that the interns are heading back to school but continuing with us as junior developers and one of our core engineers will be working from the States AND we have a new mum who will be working in a flexible manner from her home and I will only be working on-site with customers or with hardware as needed – can we still share knowledge and skills effectively and continue evolving our product to serve our customers?

In technical jargon, we are transiting from an Agile/Scrum team into an Async Development team (special props to Adrian Quek for teaching me this term “Async Development”).

In my mind (and based on my previous experiences working in a distributed team), it is a challenging task to operate as a distributed team but it is completely possible. Many successful tech companies like Github, Treehouse, 37Signals (37Signals do have a core co-located team though) and Buffer have continued to grow and succeed as a distributed team.

In my opinion, these are some criteria, skills and tools that are pre-requisites for a distributed team to succeed:

  1. The hiring process must be rock solid and the company must be prepared to pay each individual well.  Distributed teams depend on the fact that each individual in the team has good mastery over specific tech knowledge and skills and each person must have good time management skills and be able to use a variety of tools (mock-up tools, communication tools, coding tools) to function effectively.
  2. Effective tools and shared understanding of systems must be made available to support the team’s day-to-day operations.  For instance, the ability to communicate fluently at code level and review code in Gitlab is critical.  The ability to illustrate software workflow in Illustrator or Photoshop and share ideas on Trello as a product development tool is critical. Members of the team should also avoid creating busywork by communicating using emails; instead, use communication tools like Slack which integrates with Trello, Gitlab and Google Docs effectively
  3. Jon Yongfook Cockle specifically mentioned that the best kind of businesses that are suitable for digital nomads are businesses which do not have any “hardware” or “physical product” components.  In our situation, this is unavoidable as our Wifi/BLE peripheral (hardware) is an integral part of our Optometry solution for our customers.  Fortunately, this peripheral is not too complex and in my opinion, it is still possible to provide the necessary hardware components to specific members of our team so that they can work from home; or simply head down to our co-working space at Blk 71 to work on the hardware integration work whenever required.
  4. Don’t always work with each other remotely — it is important for members in a distributed team to meet once in a while for casual get-togethers OR for serious work.  Nothing builds trust like face-to-face communication and in order for a distributed to work effectively, there needs to be a continual “maintenance” of trust between team members.

As our team transits to a more flexible working style, it is important for each individual to keep learning and keep improving their skill set in order to function effectively and continually contribute to our growth as a company and provide good support to our expanding customer base.

Aren’t Emails asynchronous in nature?


The problem with emails is that they create information silos.  This hinders autonomous involvement in actionables and creates long chains of discussions which end up being busywork when nobody takes ownership on decisions and actionables.  Favor the use of tools like Slack which allows individuals to choose for themselves which channel (of discussion) they would like to participate in, public and/or internal wikis and blogs so the barrier to participation for distributed team members is limited simply to a “search” action.

Individuals should acquire the ability to communicate effectively using various tools – public blogs (like this one), slack for internal communication and reduce busywork created by emails.