|
![](/i/fill.gif) |
> 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
|
![](/i/fill.gif) |