<div>No, that doesn't work; it's close, but not quite. liftM doesn't have the right type signature.</div>
<div> </div>
<div>liftM :: Monad m => (a -> r) -> (m a1 -> m r)</div>
<div> </div>
<div>What would work is if you could define a function</div>
<div>liftLast :: Monad m => (a0 -> a1 -> ... -> aN -> r) -> (a0 -> a1 -> ... -> aN -> m r)</div>
<div> </div>
<div>then</div>
<div> </div>
<div>nary' f = runIdentity . nary (liftLast f)</div>
<div> </div>
<div> -- ryan<br><br> </div>
<div><span class="gmail_quote">On 12/5/07, <b class="gmail_sendername">Dan Weston</b> <<a href="mailto:westondan@imageworks.com">westondan@imageworks.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Wouldn't any isomorphism do (like the Identity monad)? How about<br><br>nary' f = runIdentity . nary (liftM f) . return
<br><br><br>Brandon S. Allbery KF8NH wrote:<br>><br>> On Dec 5, 2007, at 16:00 , Philipp N. wrote:<br>><br>>> the odd thing is. you can get this to work, if you have a terminating<br>>> type<br>>> as result type (for example (IO x)). then you can work with all types (IO
<br>>> x), (a -> IO x), (a -> b -> IO x), ...<br>>><br>>> but i don't want this delimiter IO! any ideas?<br>><br>> Use ST instead? (just tossing ideas in the wind...)<br>><br><br><br>
_______________________________________________<br>Haskell-Cafe mailing list<br><a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br><a href="http://www.haskell.org/mailman/listinfo/haskell-cafe">http://www.haskell.org/mailman/listinfo/haskell-cafe
</a><br></blockquote></div><br>