I wonder, are you aware that quotations are just a type of sequence? So:

    [ * ] [ number>string print ] append [ 3 9 ] dip call

Does what you would expect. :) You can even "add" stack effects and
the algebra will work out:

    ( x -- ) ( x x x  -- x x ) compose-effects

2014-12-05 11:10 GMT+01:00 Andrea Ferretti <ferrettiand...@gmail.com>:
> Hi, I am trying to implement monoids in factor. A monoid is a set with
> a binary associative operation (and, depending on the defintiion, a
> neutral element for it).
>
> Typical examples are numbers (with either addition or multiplication)
> or sequences (with concatenation). Other examples can be derived from
> these, since hastables whose values are in a monoid are also naturally
> a monoid.
>
> My implementation is here
>
> https://github.com/andreaferretti/factor-work/blob/master/monoid/monoid.factor


-- 
mvh/best regards Björn Lindqvist

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to