Skip to content

Instantly share code, notes, and snippets.

@sordina
Created March 15, 2010 07:54
Show Gist options
  • Save sordina/332615 to your computer and use it in GitHub Desktop.
Save sordina/332615 to your computer and use it in GitHub Desktop.
class Matrix m a | -- * Voodoo goes here?
where
-- required
fromRows :: [[a]] -> m a
rows :: m a -> Integer
columns :: m a -> Integer
at :: m a -> Integer -> Integer -> a
-- defaults
toList :: m a -> [a]
toListWithPos :: m a -> [(Integer, Integer, a)]
toRows :: m a -> [[a]]
row :: m a -> Integer -> [a]
column :: m a -> Integer -> [a]
vicinityRows :: m a -> Integer -> Integer -> [[Maybe a]]
vicinityMatrix :: m a -> Integer -> Integer -> m (Maybe a)
neighbours :: m a -> Integer -> Integer -> [a]
neighbourMap :: (a -> [a] -> a) -> m a -> m a
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment