logoalt Hacker News

itishappytoday at 2:27 PM0 repliesview on HN

Here they are in Futhark:

    val concat [n] [m] 't : (xs: [n]t) -> (ys: [m]t) -> *[n + m]t
    val matmul [n] [m] [l] 't : (xs: [n][m]t) -> (ys: [m][l]t) -> *[n][l]t
    val head [n] 't : (x: [n]t) -> t
And here's the pathological case (length cannot be determined at compile time):

    val filter [n] 'a : (p: a -> bool) -> (as: [n]a) -> *[]a
Other pathological cases include conditionals and loops.