Defining functions in Disco [009X]

We have previously seen how to define functions in Disco. Here are a few more examples.

g : Bool -> N
g(T) = 5
g(F) = 17

h : N -> N
h(n) = 2n

l : N -> Bool
l(3n) = False
l(3n + 1) = True
l(3n + 2) = True

j : N -> N
j(3n) = 2n+5
j(3n+1) = n^2
j(3n+2) = 17

And we can still use the :table command to get Disco to show a table of example input-output values for a function.