
5 Jan
2007
5 Jan
'07
9:13 p.m.
On Fri, Jan 05, 2007 at 08:17:33PM -0500, Brian Hurt wrote:
My apologies for wasting bandwidth on what I'm sure is a stupid newbie question.
Given:
-- Reimplementing the wheel here, I know
data Option a = Some a | Empty deriving (Eq,Ord,Show,Read)
My apologies if you knew this already, (I don't know whether your "Reimplementing the wheel" comment refers to this type or the "nth" function) but this is the Maybe data type in Prelude: data Maybe a = Nothing | Just a ...which is the same as yours, except it's spelled differently, is an instance of several handy classes (eg, Monad), and has a handful of helper functions predefined: http://haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html Jason Creighton