Bas van Dijk wrote: > 1) What's the difference between your: > "tail ~(Cons _ xs) = xs" > and the more simple: > "tailStrict (Cons _ xs) = xs" ? > > I know they're desugared to: > "tail ys = let Cons _ xs = ys in xs" > and: > "tailStrict ys = case ys of Cons _ xs -> xs" respectively. > > But aren't they operationally the same: > > "tail undefined = undefined" > and: > "tailStrict undefined = undefined"
I concur, a strict tail is enough. Writing foo xs = bar (tail xs) has the same effect as foo xs = bar (tailStrict xs) since the evaluation of xs is deferred in both cases. Regards, apfelmus -- http://apfelmus.nfshost.com _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe