My first Haskell package: time-locale-vietnamese

Posted in Category • November 19, 2017

I’ve been learning Haskell for a while, today I release my very first Haskell package: time-locale-vietnamese. Just a simple TimeLocale to support formatting time in Vietnamese.

Following is a quick example:

import Data.Time
import Data.Time.Locale.Vietnamese

main = do
  now <- getCurrentTime
  print $ formatTime vietnameseTimeLocale "%A, %d %B %Y" now

I’ve packages published to various repository before, with Hex for Elixir, and NPM for JavaScript. Overall the process for Haskell is pretty simple. In the beginning all I found is talking about Cabal sdist; I could not find any document about how to do it with Stack. At last it is just stack upload but the document could be clearer.

The package only have vietnameseTimeLocale for now, but I plan to add common time format phrases late. Hope this is useful.