
8 Mar
2012
8 Mar
'12
1:12 p.m.
(Though I seem to recall the monadic return value being frowned upon but I don't recall why.)
The type signature that you wrote is very generic and doesn't help in introducing effects while retrieving the indexed value, which I imagine is what you wanted to do. I guess you could define a type family for the monad type as well, e.g.: type family Index f type family IndexMonad f :: * -> * class Functor f => Indexed f where index :: Index f -> f a -> (IndexMonad f) (Maybe a) Francesco.