[Haskell-cafe] collection monads
fis at wiwi.hu-berlin.de
Sun Oct 8 11:58:36 EDT 2006
On Sun, Oct 08, 2006 at 10:57:46PM +1300, tpledger at ihug.co.nz wrote:
> To: haskell-cafe at haskell.org
> From: tpledger at ihug.co.nz
> Date: Sun, 08 Oct 2006 22:57:46 +1300
> Subject: [Haskell-cafe] collection monads
> 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
yes, me neither. i thought of something like sequencial execution of
permutations, and was hoping it was similar enough to strings and
concat / join. but it seems it's something else...
ok, permutations are not that monadic, really. i'll try to live with
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20061008/caa3f123/attachment.bin
More information about the Haskell-Cafe