mathiasverraes / lambdalicious

Lambdalicious - Experiments in Elegant Functional Programming in PHP
http://verraes.net/2014/11/higher-order-programming/
MIT License
124 stars 8 forks source link

Data is just functions #15

Closed mathiasverraes closed 9 years ago

mathiasverraes commented 9 years ago

Reimplemented pair() and friends using nothing but functions. Dropped tuples for now.

turanct commented 9 years ago

Very nice :clap:

These are the main differences between tuples and lists as far as I know:

Can you elaborate on "lists are just linked pairs"?

turanct commented 9 years ago

just a test, for lists: https://gist.github.com/turanct/e381b0bff7f29a67355c

turanct commented 9 years ago

Can you elaborate on "lists are just linked pairs"?

I see now... list(a, b, c) == tuple(a, tuple(b, tuple(c)))

there's one more problem. list() is a php language construct, so we can't use list(a, b, c) notation. what do you suggest?

btw: i'll be adding to this pull request :-) it's in the making

mathiasverraes commented 9 years ago

what do you suggest?

  • [ ] lst()
  • [ ] l()
  • [ ] lyst()
  • [ ] ιiςͳ()
turanct commented 9 years ago

I like l()

turanct commented 9 years ago

turns out that changing a datastructure is not as simple as it looks :-)

fail

turanct commented 9 years ago

i'm almost there. status:

if you want to check my progress, here: https://github.com/turanct/lambdalicious/compare/mathiasverraes:data-is-just-functions...lists-are-just-functions?expand=1

turanct commented 9 years ago

note to self:

turanct commented 9 years ago

Everything is functions now! i just need to clean up some docblocks, i'll do that tonight, then i'll add to this pull request. yay! :rocket:

turanct commented 9 years ago

lambdalistjes are pull requsted! https://github.com/mathiasverraes/lambdalicious/pull/18

mathiasverraes commented 9 years ago

@turanct Please add yourself as author to composer.json