in reply to Roles and functional programming
Like others, I'm a little confused by the purpose of your post, but one word of warning that may upset your assertion: Perl 6 roles aren't stateless
From Synopsis 12:
Roles may have attributes:role Pet { has $.collar = Collar.new(Tag.new); method id () { return $.collar.tag } method lose_collar () { undefine $.collar } }
Of course, whatever state they have becomes a part of the instance into which they are composed (Can roles have Class attributes?), which in a way is a little similar to the way Functors acquire transient access to the values they are applied to, but still that state persists.
Given my previously declared (and sometimes comprehensively proven!) lack of Haskell-fu, I'm loath to draw conclusions, but I think that somewhat queers the pitch as far as comparisons between Functors and Roles are concerned.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Roles and functional programming
by dragonchild (Archbishop) on Dec 01, 2008 at 20:43 UTC | |
by BrowserUk (Patriarch) on Dec 01, 2008 at 22:54 UTC | |
by dragonchild (Archbishop) on Dec 02, 2008 at 04:29 UTC |
In Section
Seekers of Perl Wisdom