from bedrock import *

@annot('void -> int')
def main():
    a = hint(Cons(0, Cons(1, Nil())), a='int')
    a = Cons(1, Cons(2, Cons(3, Nil)))
    b = match(a, ("Cons(_, Cons(two, Cons(_, Nil())))", identity),
                 ("_", lambda: 4))
    assert b == 2, "List pattern match"
    return 0

from bedrock import *

@annot('void -> int')
def main():
    a = hint(Cons(0, Cons(1, Nil())), a='int')
    a = hint(Cons(1, Cons(2, Cons(3, Nil))), a='int')
    #b = hint(match(a, ("Cons(_, Cons(two, Cons(_, Nil())))", identity),
    #             ("_", lambda: 4)), a='int')
    #assert b == 2, "List pattern match"
    return 0

Disable match() test for now
Disable match() test for now

  from bedrock import *
  
  @annot('void -> int')
  def main():
      a = hint(Cons(0, Cons(1, Nil())), a='int')
-     a = Cons(1, Cons(2, Cons(3, Nil)))
+     a = hint(Cons(1, Cons(2, Cons(3, Nil))), a='int')
-     b = match(a, ("Cons(_, Cons(two, Cons(_, Nil())))", identity),
+     #b = hint(match(a, ("Cons(_, Cons(two, Cons(_, Nil())))", identity),
-                  ("_", lambda: 4))
+     #             ("_", lambda: 4)), a='int')
-     assert b == 2, "List pattern match"
+     #assert b == 2, "List pattern match"
      return 0
  
Disable match() test for now
## Code Before:
from bedrock import *

@annot('void -> int')
def main():
    a = hint(Cons(0, Cons(1, Nil())), a='int')
    a = Cons(1, Cons(2, Cons(3, Nil)))
    b = match(a, ("Cons(_, Cons(two, Cons(_, Nil())))", identity),
                 ("_", lambda: 4))
    assert b == 2, "List pattern match"
    return 0

## Instruction:
Disable match() test for now
## Code After:
from bedrock import *

@annot('void -> int')
def main():
    a = hint(Cons(0, Cons(1, Nil())), a='int')
    a = hint(Cons(1, Cons(2, Cons(3, Nil))), a='int')
    #b = hint(match(a, ("Cons(_, Cons(two, Cons(_, Nil())))", identity),
    #             ("_", lambda: 4)), a='int')
    #assert b == 2, "List pattern match"
    return 0
