I hope you&#39;re not building some unneeded &quot;rules&quot; in your head. There is no reason to believe there is something to be remembered about whether or not &quot;types can change along a &gt;&gt;= chain&quot;. That chain has nothing special in Haskell. &gt;&gt;= is just an operator, much like ++, ! or .<br>

<br>ghci&gt; :t (&gt;&gt;=)<br>(&gt;&gt;=) :: (Monad m) =&gt; m a -&gt; (a -&gt; m b) -&gt; m b<br><br>This says that, you provide an a and you get a b. Nothing says the a and b have to be the same upon successive uses.<br>

<br>Likewise,<br><br>ghci&gt; :t (+)<br>(+) :: (Num a) =&gt; a -&gt; a -&gt; a<br><br>fromIntegral ((1 :: Int) + 2) + (3 :: Integer)<br>6<br><br>This shows clearly that the types are not the same along the &quot;+ chain&quot;.<br>

<br><br><div class="gmail_quote">2009/10/12 michael rice <span dir="ltr">&lt;<a href="mailto:nowgate@yahoo.com">nowgate@yahoo.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit;" valign="top">

Dumb! I just figured out I was entering the input string in quotes.<br><br>So, I suppose the answer to my question is yes, type CAN be changed along a &gt;&gt;= chain. I was having trouble doing it in a different problem, created this small example to illustrate the problem, and then screwed it up putting quotes around my input string.<br>

<br>Thanks!<br><br>Michael<br><br>--- On <b>Mon, 10/12/09, Niklas Broberg <i>&lt;<a href="mailto:niklas.broberg@gmail.com" target="_blank">niklas.broberg@gmail.com</a>&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">

<br>From: Niklas Broberg &lt;<a href="mailto:niklas.broberg@gmail.com" target="_blank">niklas.broberg@gmail.com</a>&gt;<br>Subject: Re: [Haskell-cafe] Can type be changed along a &gt;&gt;= chain?<br>To: &quot;michael rice&quot; &lt;<a href="mailto:nowgate@yahoo.com" target="_blank">nowgate@yahoo.com</a>&gt;<br>

Cc: <a href="mailto:haskell-cafe@haskell.org" target="_blank">haskell-cafe@haskell.org</a><br>Date: Monday, October 12, 2009, 12:43 PM<br><br><div><div class="im">On Mon, Oct 12,
 2009 at 6:37 PM, michael rice <span dir="ltr">&lt;<a rel="nofollow" href="http://mc/compose?to=nowgate@yahoo.com" target="_blank">nowgate@yahoo.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit;" valign="top">

transform :: IO ()<br>transform = putStrLn &quot;What is your digit
 string?&quot;<br>         &gt;&gt; getLine<br>         &gt;&gt;= \str -&gt; return (&#39;9&#39;:str)<br>         &gt;&gt;= \str -&gt; return (read str :: Int)<br>         &gt;&gt;= \i -&gt; putStrLn $ &quot;The number is &quot; ++ show i<br>


</td></tr></tbody></table></blockquote><div></div></div><div>This code works perfectly for me. What problem are you seeing specifically?<br></div><div></div><div>Cheers,</div><div></div><div>/Niklas</div>
</div></blockquote></td></tr></tbody></table><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" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br>