Hello, I would like to execute the monad of my choice against the following
data items:

   atom =: 67              NB. atom
   vector =: 1 $ 67        NB. trivial vector
   vector2 =: 67 56        NB. vector
   table =: 1 1 $ 67       NB. trivial table
   table2 =: i. 2 3        NB. table
   report =: 1 1 1 $ 67    NB. trivial report
   report2 =: i. 2 3 4     NB. report

In other words, I want to develop a functional profile of a particular monad
by tossing data a varying dimensions at it.

So logically, it is a function of two arguments: monad and a list of the
data above.
And here is how it would perform. Of course, the printed representation of
the data would be J style and not Scheme style:

 #;30> (monad-test Head)

<atom>
  <input>67</input>
  <output>
    <data>67</data>
    <rank>()</rank>
  </output>
</atom>

<trivial vector>
  <input>#(67)</input>
  <output>
    <data>67</data>
    <rank>()</rank>
  </output>
</trivial vector>

<vector>
  <input>#(1 3 5 7 9)</input>
  <output>
    <data>1</data>
    <rank>()</rank>
  </output>
</vector>

<trivial table>
  <input>#,(array vector ((0 . 0) (0 . 0)) ((67)))</input>
  <output>
    <data>#(67)</data>
    <rank>1</rank>
  </output>
</trivial table>

<table>
  <input>#,(array vector ((0 . 1) (0 . 2)) ((0 1 2) (3 4 5)))</input>
  <output>
    <data>#(0 1 2)</data>
    <rank>1</rank>
  </output>
</table>

<trivial report>
  <input>#,(array vector ((0 . 0) (0 . 0) (0 . 0)) (((67))))</input>
  <output>
    <data>#,(array vector ((0 . 0) (0 . 0)) ((67)))</data>
    <rank>2</rank>
  </output>
</trivial report>

<report>
  <input>#,(array vector ((0 . 1) (0 . 2) (0 . 3)) (((0 1 2 3) (4 5 6 7) (8
9 10 11)) ((12 13 14 15) (16 17 18 19) (20 21 22 23))))</input>
  <output>
    <data>#,(array vector ((0 . 2) (0 . 3)) ((0 1 2 3) (4 5 6 7) (8 9 10
11)))</data>
    <rank>2</rank>
  </output>
</report>
#;31> 
-- 
View this message in context: 
http://www.nabble.com/verbosely-execute-a-monad-against-several-data-items-tf4601444s24193.html#a13137767
Sent from the J General mailing list archive at Nabble.com.

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to