- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
More functional, less object oriented
Wed, 2011-06-08, 20:42
Hi,
I will begin the development of an application. I tried to draw a
model of it, but I can't figure out how to make it more "functional".
It looks to be so "classical" (I mean, more in an OO style) that it
would be the same to develop it in Java.
Maybe I'm wrong, but is there a specific way to modelize an
application in a functional way ?
Thanks! Bye,
Matt
Wed, 2011-06-08, 22:27
#2
Re: More functional, less object oriented
On Wed, Jun 8, 2011 at 1:15 PM, Luc Duponcheel wrote:
> Architecture = top-down decomposition of system in functional sub-systems
> Design = bottom up composition of components from atomic object components
just to agree and disagree all at once, see this thread:
http://lambda-the-ultimate.org/node/3265#comment-48045
sincerely.
Wed, 2011-06-08, 22:37
#3
Re: More functional, less object oriented
Dear Matt,
Actually, diagram-chasing and string diagrams from category theory are great high level modeling tools for functional programming.
Best wishes,
--greg
On Wed, Jun 8, 2011 at 11:06 AM, Matt <matt@taggiasco.ch> wrote:
--
L.G. Meredith
Managing Partner
Biosimilarity LLC
7329 39th Ave SWSeattle, WA 98136
+1 206.650.3740
http://biosimilarity.blogspot.com
Actually, diagram-chasing and string diagrams from category theory are great high level modeling tools for functional programming.
Best wishes,
--greg
On Wed, Jun 8, 2011 at 11:06 AM, Matt <matt@taggiasco.ch> wrote:
Hi,
I will begin the development of an application. I tried to draw a
model of it, but I can't figure out how to make it more "functional".
It looks to be so "classical" (I mean, more in an OO style) that it
would be the same to develop it in Java.
Maybe I'm wrong, but is there a specific way to modelize an
application in a functional way ?
Thanks! Bye,
Matt
--
L.G. Meredith
Managing Partner
Biosimilarity LLC
7329 39th Ave SWSeattle, WA 98136
+1 206.650.3740
http://biosimilarity.blogspot.com
Thu, 2011-06-09, 06:47
#4
Re: More functional, less object oriented
+1
On Jun 8, 2011 10:15 PM, "Luc Duponcheel" <luc.duponcheel@gmail.com> wrote:> Here is my view on it (in a nutshell, and far from being formal (let alone
> correct (!))):
>
> Architecture = top-down decomposition of system in functional sub-systems
> Design = bottom up composition of components from atomic object components
>
> -- analogy: company --> (sub-)departments <-- employees
>
> [ somewhere subsystems and components meet ]
>
> The atomic object components can be pure stateless ones or stateful ones.
>
> Modelling stateless components in Java is somewhat clumsy
> (you explicitely need an object to execute functionality)
>
> -- analogy: you need a calculator to do a calculation
>
> Modelling stateless components using Scala shines because functions are
> objects.
>
> Modelling stateful components can be done in two ways:
>
> 1) changing their old state to a new state (using var)
> 2) transforming the ones with the old state into new ones with new state
> (using val)
>
>
> You should go for option 2
>
>
> Another thing is control.
>
> Instead of modelling it using statements and traditional control constructs
> like
> - sequencing
> - looping
> You should go for compositions of the functions and transformations above.
>
> If you really want to be a die-hard functional programmer,
> then you could go for the state monad for state and (delimited)
> continuations for control.
>
>
> Luc
>
>
> On Wed, Jun 8, 2011 at 8:06 PM, Matt <matt@taggiasco.ch> wrote:
>
>> Hi,
>> I will begin the development of an application. I tried to draw a
>> model of it, but I can't figure out how to make it more "functional".
>> It looks to be so "classical" (I mean, more in an OO style) that it
>> would be the same to develop it in Java.
>> Maybe I'm wrong, but is there a specific way to modelize an
>> application in a functional way ?
>> Thanks! Bye,
>> Matt
>
>
>
>
> --
> __~O
> -\ <,
> (*)/ (*)
>
> reality goes far beyond imagination
Thu, 2011-06-09, 07:47
#5
Re: More functional, less object oriented
Thanks for your reply. Tools such as ?
On 8 juin, 23:36, Meredith Gregory wrote:
> Dear Matt,
>
> Actually, diagram-chasing and string diagrams from category theory are great
> high level modeling tools for functional programming.
>
> Best wishes,
>
> --greg
>
> On Wed, Jun 8, 2011 at 11:06 AM, Matt wrote:
> > Hi,
> > I will begin the development of an application. I tried to draw a
> > model of it, but I can't figure out how to make it more "functional".
> > It looks to be so "classical" (I mean, more in an OO style) that it
> > would be the same to develop it in Java.
> > Maybe I'm wrong, but is there a specific way to modelize an
> > application in a functional way ?
> > Thanks! Bye,
> > Matt
>
> --
> L.G. Meredith
> Managing Partner
> Biosimilarity LLC
> 7329 39th Ave SW
> Seattle, WA 98136
>
> +1 206.650.3740
>
> http://biosimilarity.blogspot.com
Thu, 2011-06-09, 08:47
#6
Re: Re: More functional, less object oriented
Dear Matt,
i was talking about conceptual tools. You can do diagram-chasing with Paul Taylor's package for latex or Omnigraffle, for that matter. The point is that both ordinary category theoretic diagrams and string diagrams (see also the Catster's videos on this) provide a compact visual representation with obvious -- and well vetted -- benefits. If you know anything about the history of physics, i would venture that diagram-chasing and string diagrams are as enabling to functional modeling as Feynman diagrams are to (quantum) physics.
Best wishes,
--greg
On Wed, Jun 8, 2011 at 11:30 PM, Matt <matt@taggiasco.ch> wrote:
--
L.G. Meredith
Managing Partner
Biosimilarity LLC
7329 39th Ave SWSeattle, WA 98136
+1 206.650.3740
http://biosimilarity.blogspot.com
i was talking about conceptual tools. You can do diagram-chasing with Paul Taylor's package for latex or Omnigraffle, for that matter. The point is that both ordinary category theoretic diagrams and string diagrams (see also the Catster's videos on this) provide a compact visual representation with obvious -- and well vetted -- benefits. If you know anything about the history of physics, i would venture that diagram-chasing and string diagrams are as enabling to functional modeling as Feynman diagrams are to (quantum) physics.
Best wishes,
--greg
On Wed, Jun 8, 2011 at 11:30 PM, Matt <matt@taggiasco.ch> wrote:
Thanks for your reply. Tools such as ?
On 8 juin, 23:36, Meredith Gregory <lgreg.mered...@gmail.com> wrote:
> Dear Matt,
>
> Actually, diagram-chasing and string diagrams from category theory are great
> high level modeling tools for functional programming.
>
> Best wishes,
>
> --greg
>
> On Wed, Jun 8, 2011 at 11:06 AM, Matt <m...@taggiasco.ch> wrote:
> > Hi,
> > I will begin the development of an application. I tried to draw a
> > model of it, but I can't figure out how to make it more "functional".
> > It looks to be so "classical" (I mean, more in an OO style) that it
> > would be the same to develop it in Java.
> > Maybe I'm wrong, but is there a specific way to modelize an
> > application in a functional way ?
> > Thanks! Bye,
> > Matt
>
> --
> L.G. Meredith
> Managing Partner
> Biosimilarity LLC
> 7329 39th Ave SW
> Seattle, WA 98136
>
> +1 206.650.3740
>
> http://biosimilarity.blogspot.com
--
L.G. Meredith
Managing Partner
Biosimilarity LLC
7329 39th Ave SWSeattle, WA 98136
+1 206.650.3740
http://biosimilarity.blogspot.com
Thu, 2011-06-09, 23:57
#7
Re: More functional, less object oriented
UML Object diagrams, more or less.
as well as sql's "select ... from ... where..." is just a limit diagram, most probably a pullback.
Thanks,
-Vlad
On Wed, Jun 8, 2011 at 2:36 PM, Meredith Gregory <lgreg.meredith@gmail.com> wrote:
as well as sql's "select ... from ... where..." is just a limit diagram, most probably a pullback.
Thanks,
-Vlad
On Wed, Jun 8, 2011 at 2:36 PM, Meredith Gregory <lgreg.meredith@gmail.com> wrote:
Dear Matt,
Actually, diagram-chasing and string diagrams from category theory are great high level modeling tools for functional programming.
Best wishes,
--greg
On Wed, Jun 8, 2011 at 11:06 AM, Matt <matt@taggiasco.ch> wrote:
Hi,
I will begin the development of an application. I tried to draw a
model of it, but I can't figure out how to make it more "functional".
It looks to be so "classical" (I mean, more in an OO style) that it
would be the same to develop it in Java.
Maybe I'm wrong, but is there a specific way to modelize an
application in a functional way ?
Thanks! Bye,
Matt
--
L.G. Meredith
Managing Partner
Biosimilarity LLC
7329 39th Ave SWSeattle, WA 98136
+1 206.650.3740
http://biosimilarity.blogspot.com
Fri, 2011-06-10, 00:57
#8
Re: More functional, less object oriented
How are UML diagrams "functional"?
On Thu, Jun 9, 2011 at 6:53 PM, Vlad Patryshev wrote:
> UML Object diagrams, more or less.
>
> as well as sql's "select ... from ... where..." is just a limit diagram,
> most probably a pullback.
>
> Thanks,
> -Vlad
>
>
> On Wed, Jun 8, 2011 at 2:36 PM, Meredith Gregory
> wrote:
>>
>> Dear Matt,
>> Actually, diagram-chasing and string diagrams from category theory are
>> great high level modeling tools for functional programming.
>> Best wishes,
>> --greg
>>
>> On Wed, Jun 8, 2011 at 11:06 AM, Matt wrote:
>>>
>>> Hi,
>>> I will begin the development of an application. I tried to draw a
>>> model of it, but I can't figure out how to make it more "functional".
>>> It looks to be so "classical" (I mean, more in an OO style) that it
>>> would be the same to develop it in Java.
>>> Maybe I'm wrong, but is there a specific way to modelize an
>>> application in a functional way ?
>>> Thanks! Bye,
>>> Matt
>>
>>
>> --
>> L.G. Meredith
>> Managing Partner
>> Biosimilarity LLC
>> 7329 39th Ave SW
>> Seattle, WA 98136
>>
>> +1 206.650.3740
>>
>> http://biosimilarity.blogspot.com
>
>
Fri, 2011-06-10, 15:47
#9
Re: More functional, less object oriented
Categorical, not functorial. Good question, nevertheless.
Thanks,
-Vlad
On Thu, Jun 9, 2011 at 4:56 PM, Michael Cotterell <mepcotterell@gmail.com> wrote:
Thanks,
-Vlad
On Thu, Jun 9, 2011 at 4:56 PM, Michael Cotterell <mepcotterell@gmail.com> wrote:
How are UML diagrams "functional"?
On Thu, Jun 9, 2011 at 6:53 PM, Vlad Patryshev <vpatryshev@gmail.com>Cate wrote:
> UML Object diagrams, more or less.
>
> as well as sql's "select ... from ... where..." is just a limit diagram,
> most probably a pullback.
>
> Thanks,
> -Vlad
>
>
> On Wed, Jun 8, 2011 at 2:36 PM, Meredith Gregory <lgreg.meredith@gmail.com>
> wrote:
>>
>> Dear Matt,
>> Actually, diagram-chasing and string diagrams from category theory are
>> great high level modeling tools for functional programming.
>> Best wishes,
>> --greg
>>
>> On Wed, Jun 8, 2011 at 11:06 AM, Matt <matt@taggiasco.ch> wrote:
>>>
>>> Hi,
>>> I will begin the development of an application. I tried to draw a
>>> model of it, but I can't figure out how to make it more "functional".
>>> It looks to be so "classical" (I mean, more in an OO style) that it
>>> would be the same to develop it in Java.
>>> Maybe I'm wrong, but is there a specific way to modelize an
>>> application in a functional way ?
>>> Thanks! Bye,
>>> Matt
>>
>>
>> --
>> L.G. Meredith
>> Managing Partner
>> Biosimilarity LLC
>> 7329 39th Ave SW
>> Seattle, WA 98136
>>
>> +1 206.650.3740
>>
>> http://biosimilarity.blogspot.com
>
>
--
Sincerely,
Michael Cotterell
mepcotterell@gmail.com
mepcott@uga.edu
P.S. - Check out ScalaTion (http://code.google.com/p/scalation/), a
Domain-Specific Language for Modeling & Simulation. #blatantplug
Architecture = top-down decomposition of system in functional sub-systems
Design = bottom up composition of components from atomic object components
-- analogy: company --> (sub-)departments <-- employees
[ somewhere subsystems and components meet ]
The atomic object components can be pure stateless ones or stateful ones.
Modelling stateless components in Java is somewhat clumsy
(you explicitely need an object to execute functionality)
-- analogy: you need a calculator to do a calculation
Modelling stateless components using Scala shines because functions are objects.
Modelling stateful components can be done in two ways:
1) changing their old state to a new state (using var)
2) transforming the ones with the old state into new ones with new state (using val)
You should go for option 2
Another thing is control.
Instead of modelling it using statements and traditional control constructs like
- sequencing
- looping
You should go for compositions of the functions and transformations above.
If you really want to be a die-hard functional programmer,
then you could go for the state monad for state and (delimited)
continuations for control.
Luc
On Wed, Jun 8, 2011 at 8:06 PM, Matt <matt@taggiasco.ch> wrote:
--
__~O
-\ <,
(*)/ (*)
reality goes far beyond imagination