POV-Ray : Newsgroups : povray.off-topic : Try Haskell : Re: Try Haskell Server Time
4 Sep 2024 15:20:11 EDT (-0400)
  Re: Try Haskell  
From: scott
Date: 3 Mar 2010 11:13:24
Message: <4b8e8aa4$1@news.povray.org>
> Hmm, maybe I should write my own?

It's very useful for an absolute beginner, these are the things you need to 
know that a lot of tutorials assume you somehow magically know already.

> > :t fst
> Take a look at this type signature. Can you figure out what it means?
>
> > fst (5, 'x')
> Did that do what you expected?

Well it seems to return the first item from a tuple.

Is it just a shorthand for "take 1"?

Ah no, it seems those list operators don't work with tuples :-(

> > let x = 5 in x + 1
> This is how you define local variables. (The interpretter unfortunately 
> doesn't let you define things and then use them later. Everything has to 
> go into a single giant let-expression.)

So this means "let x = 5 in (the following expression)..."

Now Step 7 in the original tutorial makes sense :-)

> OK, I'm going to stop now...

OK I need to download the compiler if I am to actually learn any of this...


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.