eternaloptimist
Well-Known Member
- Joined
- Jul 10, 2013
- Messages
- 175
- Reaction score
- 1
This is amazing. Most of the stuff is beyond me though 
Why don't you blog this?
Why don't you blog this?
South Africa’s biggest forum. Discuss, discover, and connect with thousands of members.
Sounds strange... or impossible, ... but that's exactly what can be done once a language is sufficient enabled for FP.Functions?
It was also beyond me in the beginning. I started hearing about FP just over 10 years ago, but many of the languages I used didn't adequately support it until recently. It's really powerful, but also really difficult to grasp at first, probably because these concepts were invented by mathematicians; and they picked some really scary names to explain things: monads, monoids, functors, applicatives, endofunctors, ...This is amazing. Most of the stuff is beyond me though
Why don't you blog this?
Thanks.you should actually be posting these to CodeProject...
[)roi(];18330288 said:Thanks.
I'm still a little undecided atm about where this belongs; many years back I posted a bit on codeproject, and a few others, and more recently on medium; but neither of those really work for me; for different reasons; guess I'm probably at an point where I should really reconsider a blog; Mybb forums really isn't ideal when it comes to posting programming articles.
Thanks for the visit.Sweet. May I also suggest a platform like Medium? I read the blog posts on this thing almost daily when it comes to programming concepts and related matters.
No worries, I went ahead and cloned your repository last night, and added JavaScript + Python to the mix, well for the page that was there any way. Sent you a pull request.Thanks for the visit.
I tried medium for a while; for general writing it's nice; but it really sucked when it came to code; the only real workable solution was to create all the code snippets as github gists, which meant to had to navigate & cut/paste between two sites (a pain). That's basically the reason I stopped blogging there, and many other guys in the industry.
A separate blog allows me to overcome all those issues, and to implement many enhanced features like programming language selection (for multi language articles). Granted running my own blog has a few challenges; attracting visitors being the biggest, site maintenance + bugs, instead of just writing articles -- but if I think of the frustration of trying to work with medium and even worse MYBB, I think I'm up for challenge. It should come down to the articles; and hopefully I can provide something enticing enough + I still plan on tying threads on MyBB to the articles I post.
Was also thinking at some of inviting other bloggers... Prose.io allows in browser article creation and editing similar to CMS websites (using markdown), so that could be an easy way in for other bloggers i.e. no need for a complicated Jekyll setup on your computer + no need to deal with git commits.
If you're interested, let me know. The general idea is publish articles on any programming subject; whilst I'll blog on FP, I certainly won't restrict myself to that.
Wow.. thanks a lot, but going to unfortunately have to reject the pull requests; you inadvertently removed the php code. I'll add both your Python and Javascript additions; thanks again.No worries, I went ahead and cloned your repository last night, and added JavaScript + Python to the mix, well for the page that was there any way. Sent you a pull request.
[)roi(];18346344 said:Wow.. thanks a lot, but going to unfortunately have to reject the pull requests; you inadvertently removed the php code. I'll add both your Python and Javascript additions; thanks again.
Was busy this AM with some cosmetic changes, but now eager to finalise the current loaded articles, and converting the rest.
No worries, I've added your adjustments... have a look it's live. PR if you have any others.Did I? I could have sworn I put the php below the python.
Edit: Seems I did. I'll fix it and recommit.


Finally found some free time to read this.Thanks for this, thought I would give it a bump so that it is easier for me to find while I go through the links.
I was reading an interesting article the other day describing how functional programming could be used to solve some problems within the current trends of front end frameworks so thought that I would share it too.
$cacheItem = $app['cacheService']->getItem('THE_ITEM_KEY');
$result = null;
if (!$cacheItem->is_Hit()) {
$result = $app['defaultModelBuilder']->buildModel($app, $request); //function to be called if there is no cache hit
$cacheItem->set($result );
$app['cacheService']->save($cacheItem);
} else {
$result = $cacheItem->get();
}
return $result;
function getItemFromCache($key, $item) {
$cacheItem = $app['cacheService']->getItem($key);
$result = null;
if (!$cacheItem->is_Hit()) {
$result = $item;
$cacheItem->set($result );
$app['cacheService']->save($cacheItem);
} else {
$result = $cacheItem->get();
}
return $result;
}
$item = getItemFromCache('THE_ITEM_KEY', $app['defaultModelBuilder']->buildModel($app, $request));
//ContainerConfig.php
$app['getItemFromCache'] = $app->protect(function ($key, $cacheMissFunction) use ($app) {
$cacheItem = $app['cacheService']->getItem($key);
$result = null;
if (!$cacheItem->is_Hit()) {
$result = $cacheMissFunction();
$cacheItem->set($result);
$app['cacheService']->save($cacheItem);
} else {
$result = $cacheItem->get();
}
return $result;
});
//Some code block that has access to the Pimple DI $app
$item = $app['getItemFromCache']('THE_ITEM_KEY', function () use ($app, $request) {
return $app['defaultModelBuilder']->buildModel($app, $request);
});
//another code block that also wants to get an item from the cache, and add it if it doesnt exist
$item2 = $app['getItemFromCache']('THE_ITEM_KEY_2', function () {
return 'cats > dogs';
});