<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	
	>
<channel>
	<title>
	Comments on: Calling Functions and Methods on Strong Types	</title>
	<atom:link href="https://www.fluentcpp.com/2017/11/07/calling-functions-methods-strong-types/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.fluentcpp.com/2017/11/07/calling-functions-methods-strong-types/</link>
	<description>Jonathan Boccara&#039;s blog</description>
	<lastBuildDate>Tue, 28 Nov 2017 15:51:00 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.3</generator>
	<item>
		<title>
		By: Jonathan Boccara		</title>
		<link>https://www.fluentcpp.com/2017/11/07/calling-functions-methods-strong-types/#comment-691</link>

		<dc:creator><![CDATA[Jonathan Boccara]]></dc:creator>
		<pubDate>Tue, 28 Nov 2017 15:51:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=2433#comment-691</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2017/11/07/calling-functions-methods-strong-types/#comment-636&quot;&gt;Davidbrcz&lt;/a&gt;.

Hey, thanks for sharing this it&#039;s very interesting.
I&#039;ve looked at you code in details (wish I could do it earlier sorry for the late reply), and I can really see usage for FP on NamedType.
For instance, I suppose a functor would be useful, like in the example you put up, where you triple a number. You can&#039;t pass a strong type into a function double -&#062; double without definitively losing the strong typing, even with the FunctionCallable type. So a functor would allow this new feature. We could add a .map method on NamedType to implement that.
As for monad, I understand how the bind method can be implemented like you showed. Can you think of a concrete example where it would apply? Also, strictly speaking, shouldn&#039;t a monad have a &quot;pure&quot; function that wraps an A into a Monad A? Although I guess the bind could be useful even without that.
Would be interested in your opinion on all that! :)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2017/11/07/calling-functions-methods-strong-types/#comment-636">Davidbrcz</a>.</p>
<p>Hey, thanks for sharing this it&#8217;s very interesting.<br />
I&#8217;ve looked at you code in details (wish I could do it earlier sorry for the late reply), and I can really see usage for FP on NamedType.<br />
For instance, I suppose a functor would be useful, like in the example you put up, where you triple a number. You can&#8217;t pass a strong type into a function double -&gt; double without definitively losing the strong typing, even with the FunctionCallable type. So a functor would allow this new feature. We could add a .map method on NamedType to implement that.<br />
As for monad, I understand how the bind method can be implemented like you showed. Can you think of a concrete example where it would apply? Also, strictly speaking, shouldn&#8217;t a monad have a &#8220;pure&#8221; function that wraps an A into a Monad A? Although I guess the bind could be useful even without that.<br />
Would be interested in your opinion on all that! 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jonathan Boccara		</title>
		<link>https://www.fluentcpp.com/2017/11/07/calling-functions-methods-strong-types/#comment-647</link>

		<dc:creator><![CDATA[Jonathan Boccara]]></dc:creator>
		<pubDate>Sun, 12 Nov 2017 22:42:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=2433#comment-647</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2017/11/07/calling-functions-methods-strong-types/#comment-642&quot;&gt;Daniel Houck&lt;/a&gt;.

Fair enough, I removed the standard iterators from the comparison in the post. Thanks Daniel!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2017/11/07/calling-functions-methods-strong-types/#comment-642">Daniel Houck</a>.</p>
<p>Fair enough, I removed the standard iterators from the comparison in the post. Thanks Daniel!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Daniel Houck		</title>
		<link>https://www.fluentcpp.com/2017/11/07/calling-functions-methods-strong-types/#comment-642</link>

		<dc:creator><![CDATA[Daniel Houck]]></dc:creator>
		<pubDate>Fri, 10 Nov 2017 18:33:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=2433#comment-642</guid>

					<description><![CDATA[&quot;It wouldn’t be the first time that operator-&#062; is used with the semantics of accessing behaviour or data in a component that doesn’t model a pointer. Standard iterators and optional use this approach too.&quot;

I agree that operator-&#062; is the right choice here, and with your example of std::optional as prior art, but iterators do model pointers. Unless they’re RandomAccessIterators they don’t model *all aspects* of a pointer, but they model the parts they can. In particular, an iterator usually does not *contain* the object it points to, unlike std::optional and these strong typedefs.]]></description>
			<content:encoded><![CDATA[<p>&#8220;It wouldn’t be the first time that operator-&gt; is used with the semantics of accessing behaviour or data in a component that doesn’t model a pointer. Standard iterators and optional use this approach too.&#8221;</p>
<p>I agree that operator-&gt; is the right choice here, and with your example of std::optional as prior art, but iterators do model pointers. Unless they’re RandomAccessIterators they don’t model *all aspects* of a pointer, but they model the parts they can. In particular, an iterator usually does not *contain* the object it points to, unlike std::optional and these strong typedefs.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Daniel Houck		</title>
		<link>https://www.fluentcpp.com/2017/11/07/calling-functions-methods-strong-types/#comment-641</link>

		<dc:creator><![CDATA[Daniel Houck]]></dc:creator>
		<pubDate>Fri, 10 Nov 2017 18:20:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=2433#comment-641</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2017/11/07/calling-functions-methods-strong-types/#comment-632&quot;&gt;Anders Lingfors&lt;/a&gt;.

I agree with the post: not entirely, but somewhat. I think you should think very carefully before doing this, but sometimes you want only semistrong typing. It’s still better than a plain typedef.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2017/11/07/calling-functions-methods-strong-types/#comment-632">Anders Lingfors</a>.</p>
<p>I agree with the post: not entirely, but somewhat. I think you should think very carefully before doing this, but sometimes you want only semistrong typing. It’s still better than a plain typedef.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Sonu Lohani		</title>
		<link>https://www.fluentcpp.com/2017/11/07/calling-functions-methods-strong-types/#comment-640</link>

		<dc:creator><![CDATA[Sonu Lohani]]></dc:creator>
		<pubDate>Fri, 10 Nov 2017 16:08:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=2433#comment-640</guid>

					<description><![CDATA[Thanks for sharing this. Its really helpful.]]></description>
			<content:encoded><![CDATA[<p>Thanks for sharing this. Its really helpful.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Davidbrcz		</title>
		<link>https://www.fluentcpp.com/2017/11/07/calling-functions-methods-strong-types/#comment-636</link>

		<dc:creator><![CDATA[Davidbrcz]]></dc:creator>
		<pubDate>Wed, 08 Nov 2017 12:22:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=2433#comment-636</guid>

					<description><![CDATA[I&#039;m not 100% sure, but what you are describing looks like a monad. You should definitively have a look at it]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not 100% sure, but what you are describing looks like a monad. You should definitively have a look at it</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Anders Lingfors		</title>
		<link>https://www.fluentcpp.com/2017/11/07/calling-functions-methods-strong-types/#comment-632</link>

		<dc:creator><![CDATA[Anders Lingfors]]></dc:creator>
		<pubDate>Tue, 07 Nov 2017 07:18:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=2433#comment-632</guid>

					<description><![CDATA[&quot;Wouldn’t that kill the purpose of strong typing?&quot;

Yes it would. Please don&#039;t do this.]]></description>
			<content:encoded><![CDATA[<p>&#8220;Wouldn’t that kill the purpose of strong typing?&#8221;</p>
<p>Yes it would. Please don&#8217;t do this.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
