I have built a library for using the Hexwax expandIO-USB chip and I have now got some code to drive a stepper motor:<br><br>doOption :: HWHandle -&gt; Flag -&gt; IO ()<br>doOption dev (Backward n) = do<br>  putStrLn $ &quot;&gt; STEP BACKWARD &quot; ++ (show n)<br>

  let x = [ stepBit b | b &lt;- [3..0]]<br>  return ()<br>    where<br>      stepBit p b = setBit p b 0 &gt;&gt; setBit p b 1<br>        where setBit p b s = HW.setPortBit dev p b s &gt;&gt; stepDelay<br><br><br>It feels a little smelly... if I don&#39;t assign the result of the list comprehension to &quot;x&quot; the return type blows at me hence the return(), to get past the door steward type checker... so what would be the &quot;ideal&quot; way to just execute my LC to step the bits and then return.<br>

<br>I thought of using &quot;liftIO&quot; but I think that would be &quot;backwards&quot; here if you catch my drift. I am already in the IO monad as it is, so that has confused me because liftIO lifts something &quot;into&quot; the IO monad and I am already there... this project is making me work harder at my Haskell and I think that once I&#39;ve completed it I will be much further advanced with it...<br>

<br>So, if anybody cares to suggest more elegant and Haskell like ways to re-factor the above code I am more than happy to know about it!<br><br>All the best,<br>Sean.<br><br><br>