Category Archives: Haskell

Hungarian Algorithm (Part I): Minimal covering of zeros

View source file on Github > module Main where > import Control.Lens hiding (assign) > import Control.Monad > import Data.List > import Data.Ord (comparing) > import Test.QuickCheck hiding (sample) > import qualified Data.IntSet as I I will resist posts on … Continue reading

Posted in Algorithm, Combinatorics, Haskell | Tagged | Leave a comment

Choices: Command Line Parsers

View literate file on Github Like everything in Haskell, parsing command line arguments comes with its own marketplace. > {-# LANGUAGE DeriveDataTypeable #-} > > module Main where > import Prelude hiding (lines) > import Options.Applicative > import System.Environment (getArgs) … Continue reading

Posted in Choices, Haskell | Tagged | 3 Comments

Quickie: Generating the powerset

View literate file on Github > import Control.Monad The traditional way to generate the powerset of a list of elements is the following > powerset :: [a] -> [[a]] > powerset (x:xs) = map (x:) (powerset xs) ++ powerset xs … Continue reading

Posted in Haskell | Tagged , , | Leave a comment

Young Tableau: Introduction (Part I)

View literate file on Github I have a book sitting on my shelf: Young Tableaux by William Fulton (ISBN 0 521 56724 6). I bought it after having the fantastic chance to see these beautiful and deep combinatorial structures in … Continue reading

Posted in Combinatorics, Haskell, Series | Tagged | Leave a comment

(DRAFT) Performance: If you wondered when a difference list helps…

View literate file on Github In Haskell mythology, laziness is one of the Sirens: you can’t but be lured in by its raciness in the heat of learning Haskell; you are then inevitably wrecked by it as your imperative sensibilites … Continue reading

Posted in Haskell | Tagged , | Leave a comment

Example: Parsing Hackage with Tagsoup

View literate file on Github This post should provide a good example for anyone wondering about parsing with the tagsoup library and why one would choose it over a more traditional approach to parsing like parsec or attoparsec. Tagsoup is … Continue reading

Posted in Haskell | Tagged , , | Leave a comment

Prototype: Parallel execution of Sinks in Conduit

Introduction View literate file on Github The Conduit package is a good choice for applications of Bayesian modeling. In particular, I’ve used it in the implementation of the inference of generative models like LDA, HDP, CTM and so forth starting … Continue reading

Posted in Haskell | Tagged , , | 1 Comment