Cuneiform (programming language): Difference between revisions

Content deleted Content added
m Type System: syntaxhighlight
m Examples: syntaxhighlight
Line 259:
 
A hello-world script:
<syntaxhighlight lang="ruby">
<pre>
def greet( person : Str ) -> <out : Str>
in Bash *{
Line 266:
 
( greet( person = "world" )|out );
</syntaxhighlight>
</pre>
This script defines a task <code>greet</code> in [[Bash (Unix shell)|Bash]] which prepends <code>"Hello "</code> to its string argument <code>person</code>.
The function produces a record with a single string field <code>out</code>.
Line 272:
 
Command line tools can be integrated by defining a task in [[Bash (Unix shell)|Bash]]:
<syntaxhighlight lang="ruby">
<pre>
def samtoolsSort( bam : File ) -> <sorted : File>
in Bash *{
Line 278:
samtools sort -m 2G $bam -o $sorted
}*
</syntaxhighlight>
</pre>
In this example a task <code>samtoolsSort</code> is defined.
It calls the tool [[SAMtools]], consuming an input file, in BAM format, and producing a sorted output file, also in BAM format.