This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use RangeChunk; | |
// serial | |
iter count(start: int, step: int, end: int) { | |
for i in start..end by step do | |
yield i; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private use Map only; | |
private use List only; | |
private use Crypto only; | |
record ordered_map { | |
/* Type of map keys.*/ | |
type keyType; | |
/* Type of map values*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use RangeChunk only; | |
// serial | |
iter starmap(array, function) { | |
var iterable = array; | |
for i in iterable { | |
yield function((...i)); // tuple expansion ... THANK YOU CHAPEL | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private use Map only; | |
private use List only; | |
private use Crypto only; | |
record ordered_map { | |
/* Type of map keys.*/ | |
type keyType; | |
/* Type of map values*/ | |
type valType; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Sort; | |
var sentialPermutation = [42]; | |
// return true if the two arrays are equal | |
proc isEqual(a, b) : bool { | |
for (i, j) in zip(a,b) { | |
if i != j { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Sort; | |
var sentialPermutation = [42]; | |
// return true if the two arrays are equal | |
proc isEqual(a, b) : bool { | |
for (i, j) in zip(a,b) { | |
if i != j { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Support for functional programming capabilities in Chapel | |
Provides a different number of generators and iterators inspired | |
by Python, and other functional programming languages: APL, Haskell, Scala. | |
*/ | |
module functional { |
NewerOlder