Skip to content

Problems with recursion and numeric constraints #1537

@ramsdell

Description

@ramsdell

I am playing with the new numeric constraints. I'm trying to write a very silly version of copy that uses recursive descent. However, the obvious way of using numeric constraints fails to type check. I tried other permutations of type annotations, but they all failed. Here is the function:

/* Silly recursive copy */

cpy : {n, a} (fin n) => [2 ^^ n]a -> [2 ^^ n]a
cpy a | n == 0 => a
      | n > 1 => cpy`{n - 1} # cpy`{n - 1}

Metadata

Metadata

Assignees

No one assigned

    Labels

    typecheckerIssues related to type-checking Cryptol code.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions