[Haskell-beginners] safetail problem

Roelof Wobben rwobben at hotmail.com
Tue Jul 12 22:45:08 CEST 2011



Hello, 

 

I use Programming in Haskell from Graham Hutton.

 

But I can't find anything in the first 4 chapters from that book why I must use (0,x) en what that means.

 

Roelof

 

 


----------------------------------------
> Date: Tue, 12 Jul 2011 15:21:46 -0400
> Subject: Re: [Haskell-beginners] safetail problem
> From: amindfv at gmail.com
> To: rwobben at hotmail.com
> CC: beginners at haskell.org
>
> _ isn't a value: it's a wildcard character for pattern matching.
>
> Also, if x = [1,2,3], [0,x] is the wrong way to make a list. The right
> way is (0:x) (":" is "cons")
>
> What resource are you learning from?
>
> On 7/12/11, Roelof Wobben <rwobben at hotmail.com> wrote:
> >
> >
> > Hello,
> >
> >
> >
> > As a exercise I need to rewrite the tail function into a safetail function
> > by using conditions.
> >
> >
> >
> > So I made this : http://codepad.org/bKcCUdqy
> >
> >
> >
> > But as you can see there is a error message.
> >
> >
> >
> > Can anyone explain me how to solve this ?
> >
> >
> >
> > Roelof
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > Beginners mailing list
> > Beginners at haskell.org
> > http://www.haskell.org/mailman/listinfo/beginners
> > 		 	   		  


More information about the Beginners mailing list