-- 引用元: http://izbicki.me/blog/functors-and-monads-for-analyzing-data -- いろいろな色のビー玉の定義 data Marble = Red | Pink | Green | Blue | White deriving (Read,Show,Eq,Ord) bagOfMarbles = [ Pink,Green,Red,Blue,Green,Red,Green,Pink,Blue,White ] -- カテゴリーデータ(このカテゴリーというのは離散変数・非数値データという意味で、圏論とは無関係の用語(https://en.wikipedia.org/wiki/Categorical_distribution)) marblesDist :: Categorical Double Marble marblesDist = t