-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support gleam language --------- Co-authored-by: Radon Rosborough <[email protected]>
- Loading branch information
Showing
5 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ver="$(latest_release gleam-lang/gleam)" | ||
|
||
wget "https://github.com/gleam-lang/gleam/releases/download/${ver}/gleam-${ver}-x86_64-unknown-linux-musl.tar.gz" -O /tmp/gleam.tar.gz | ||
tar -xzf /tmp/gleam.tar.gz -C /usr/local/bin | ||
chmod +x /usr/local/bin/gleam |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
fn encode_( | ||
dna: List(Nucleotide), | ||
acc: BitArray | ||
) { | ||
case dna { | ||
[] -> acc | ||
[first, ..rest] -> | ||
{ | ||
let nbit = encode_nucleotide(first) | ||
encode_(rest, | ||
<<acc:bits, nbit:size(2)>>) | ||
} | ||
} | ||
} | ||
|
||
pub fn encode(dna: List(Nucleotide) ) | ||
-> BitArray | ||
{ | ||
encode_(dna, <<>>) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
fn encode_(dna: List(Nucleotide), acc: BitArray) { | ||
case dna { | ||
[] -> acc | ||
[first, ..rest] -> { | ||
let nbit = encode_nucleotide(first) | ||
encode_(rest, <<acc:bits, nbit:size(2)>>) | ||
} | ||
} | ||
} | ||
|
||
pub fn encode(dna: List(Nucleotide)) -> BitArray { | ||
encode_(dna, <<>>) | ||
} |