(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.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to