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