Skip to content

WIP: Upgrade to 7.4 - #67

Merged
loganhenson merged 19 commits into
masterfrom
lh-php-7.4
Dec 6, 2019
Merged

loganhenson merged 19 commits into
masterfrom
lh-php-7.4

Conversation

@loganhenson

Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread readme.md Outdated
Class MyFunctions extends Module {
protected $memoize = ['myFunction'];

protected static myFunction() {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the Module memoize prepend the magic double-underscore? I think it does, so this would be __myFunction(). Double check prob.

Comment thread readme.md Outdated
- `Arrays::map(fn($a) => $a + 1)([1, 2, 3])` (_Vector_)

- You can add currying to any function, it isn't only limited to Vector built ins.
- `Module::curry('implode')(',')('a,b,c')` `// ['a', 'b', 'c']`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It never occurred to me you could do this lol

Comment thread readme.md Outdated
};
},
fn(Just $value) => fn(string $unwrapped) => $unwrapped,
fn(Nothing $value) => fn() => 'nothing',

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to change the syntax without the extra layer of lambda / fat arrow? Like:

fn(Just $value) => $value,
fn(Nothing $_) => 'nothing',

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so like auto extract?

@loganhenson
loganhenson merged commit 072f851 into master Dec 6, 2019
@loganhenson
loganhenson deleted the lh-php-7.4 branch December 6, 2019 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants