funkia / list

🐆 An immutable list with unmatched performance and a comprehensive functional API.
MIT License
1.65k stars 51 forks source link

little error in readme.md #2

Closed lesar closed 6 years ago

lesar commented 6 years ago

in the splitAt part you have named the example takeLast

paldepind commented 6 years ago

Good catch! Do you want to do a PR or should I fix it?

lesar commented 6 years ago

I do not know what is a PR. :-)

paldepind commented 6 years ago

Oh 😄 PR means pull request. It's how you propose changes to a project. It allows you to make some changes to a project's documentation or code and then request that they pull your changes into their code.

If you want to try it, here is how you create a pull request that fixes the error you spotted:

1/ Go to this page with the README 2/ Press the pencil icon:

billede

3/ Then find the place in the README where the examples are wrong/swapped and correct it. 4/ Go to the bottom of the page, type in a title for the change and then submit it.

Afterwards I can accept the changes so that they are merged into the project.

If you don't want to try it, then no worries 😄 I'll just change it.

lesar commented 6 years ago

Tank you. Tomorrow Morning i will try

Il 25 gen 2018 20:00, "Simon Friis Vindum" notifications@github.com ha scritto:

Oh 😄 PR means pull request. It's how you propose changes to a project. It allows you to make some changes to a project's documentation or code and then request that they pull your changes into their code.

If you want to try it, here is how you create a pull request that fixes the error you spotted:

1/ Go to this page with the README https://github.com/funkia/list/blob/master/README.md 2/ Press the pencil icon: [image: billede] https://user-images.githubusercontent.com/521604/35406564-87232a7c-0209-11e8-9c28-b9b68c156e4d.png 3/ Then find the place in the README where the examples are wrong/swapped and correct it. 4/ Go to the bottom of the page, type in a title for the change and then submit it.

Afterwards I can accept the changes so that they are merged into the project.

If you don't want to try it, then no worries 😄 I'll just change it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/funkia/list/issues/2#issuecomment-360565395, or mute the thread https://github.com/notifications/unsubscribe-auth/AGDai3Ar-bMs8QmAdxBbfPda4hMZRBVaks5tOM9JgaJpZM4Rs9Xm .

lesar commented 6 years ago

Thanks for the wonderful instructions.

I have create the pull request. I have change the example too. The words are right but the data is not.

in my local repository I have test this code:

        const li: L.List<string> = L.list('0', '1', '2', '3', '4', '5', '6', '7', '8');
        function splitAt<A>(index: number, l: L.List<A>): [L.List<A>, L.List<A>] {
          return [L.slice(0, index, l), L.slice(index, l.length, l)];
        }
        function join(separator: string, l: L.List<string>): string {
          return L.foldl((a, b) => (a.length === 0 ? b : a + separator + b), "", l);
        }
        let li1,li2: L.List<string>;
        [li1, li2]=splitAt(4, li); //=> [list(0, 1, 2, 3, 4), list(5, 6, 7, 8)]

        return html.div([
            html.div(join(",", li1)),
            html.div(join(",", li2)),
            h(AddTodo),
            h(VisibleTodoList),
            h(Footer)
        ]);

the returned values are been 0,1,2,3 4,5,6,7,8 ...

So I have changed the example. Best regards, Leonardo

paldepind commented 6 years ago

Thanks for the wonderful instructions.

You're welcome. Thanks for the PR and for spotting the mistake 🎉

I have change the example too. The words are right but the data is not.

Oh, yes. Indeed. The data is wrong too 😓