
Matthias Fischmann wrote:
Do you expect the contained type x to change during a sequence of monadic actions? e.g. would you ever use (>>=) at the type 'Permutation Int -> (Int -> Permutation Bool) -> Permutation Bool'?
no, i don't need that. but aside from the fact that
data Permutation k v = Permutation [(k, v)] instance (Ix k) => Monad (Permutation k)
is redundant (i think of the permutation as a function applicable to arbitrary lists): how would that change anything? my definition of return still doesn't work. or how would you redefine 'return'?
Ah. Yes, my approach falls over because it lacks two things. #1: a distinguished value of the Ix-constrained type k, to pair off with return's argument. #2: a purpose. I don't have a clear idea of what a do-block in a permutation monad ought to mean. Whoops! <font color=red>:-]</font> Regards, Tom (crawling back under his rock)