experiment with FlexibleInstances, FunctionalDependencies, MultiParamTypeClasses in matrix.hs