<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">I was looking here: http://www.haskell.org/haskellwiki/Abstract_data_type<br><br>I haven't done much with modules so I'm guessing what you've provided is the guts of StackImpl, to hide the implementation?<br><br>Thanks,<br><br>Michael<br><br>--- On <b>Thu, 2/4/10, Sebastian Fischer <i>&lt;sebf@informatik.uni-kiel.de&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Sebastian Fischer &lt;sebf@informatik.uni-kiel.de&gt;<br>Subject: Re: [Haskell-cafe] Stack ADT?<br>To: "haskell-cafe Cafe" &lt;haskell-cafe@haskell.org&gt;<br>Date: Thursday, February 4, 2010, 12:16 PM<br><br><div class="plainMail"><br>On Feb 4, 2010, at 6:07 PM, michael rice wrote:<br><br>&gt; Can't find a Stack datatype on Hoogle? Where should I look?<br><br>Could not find one on Hackage either. Probably because its so
 easy to handcraft your own:<br><br>&nbsp; &nbsp; newtype Stack a = Stack [a]<br><br>&nbsp; &nbsp; emptyStack = Stack []<br><br>&nbsp; &nbsp; isEmptyStack (Stack xs) = null xs<br><br>&nbsp; &nbsp; push x (Stack xs) = Stack (x:xs)<br><br>&nbsp; &nbsp; pop (Stack (_:xs)) = Stack xs<br><br>&nbsp; &nbsp; top (Stack (x:_)) = x<br><br>I saw such stacks in Haskell only for educational purposes. Usually, people seem to use lists directly.<br><br>Sebastian<br><br><br>--Underestimating the novelty of the future is a time-honored tradition.<br>(D.G.)<br><br><br><br>_______________________________________________<br>Haskell-Cafe mailing list<br><a ymailto="mailto:Haskell-Cafe@haskell.org" href="/mc/compose?to=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></div></blockquote></td></tr></table><br>