You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.
Typical pattern matching from e.g. OCaml or Rust should be fairly easy to implement.
More interesting is pattern matching for sequence types. Many sequence computations can potentially be expressed with this. For example, a simple hash function:
fun hash(s: Seq) -> Int:
s match A t => 0 + 4*hash(t)
| C t => 1 + 4*hash(t)
| G t => 2 + 4*hash(t)
| T t => 3 + 4*hash(t)
| _ => 0
The text was updated successfully, but these errors were encountered:
fun hash(s: Seq) -> Int {
match s {
case `A...`: return 0 + 4*hash(s[1:])
case `C...`: return 1 + 4*hash(s[1:])
case `G...`: return 2 + 4*hash(s[1:])
case `T...`: return 3 + 4*hash(s[1:])
case ``: return 0
}
}
source args[0] as input {
let s = input[:5]
s |> print
hash(s) |> print
}
Typical pattern matching from e.g. OCaml or Rust should be fairly easy to implement.
More interesting is pattern matching for sequence types. Many sequence computations can potentially be expressed with this. For example, a simple hash function:
The text was updated successfully, but these errors were encountered: