Name: Anonymous 2008-11-29 0:45
I'm trying to learn Haskell and I want to create a monad that, when you pass it two matrices, multiplies them, and then takes the inverse. But I cant figure out how, can anyone HELP ME?
class Functor f where
fmap :: (a -> b) -> f a -> f bMaybe a:instance Functor Maybe where
fmap f x = case x of
Nothing -> Nothing
Just x -> Just (f x)Maybe a as a list of at most one element.)-- Maybe
return :: a -> Maybe a
return x = Just x
join :: Maybe (Maybe a) -> Maybe a
join (Just (Just x)) = Just x
join _ = Nothing
-- Lists
return :: a -> [a]
return x = [x]
join :: [[a]] -> [a]
join = concat