-- Hello this is a comment

module Demo where

data Bool : Set where
  True : Bool
  False : Bool

not : Bool -> Bool
not True = False
not False = True

if_then_else_ : Bool -> Bool -> Bool -> Bool
if True then t else e = t
if False then t else e = e

data  : Set where
  Zero : 
  Succ :   

_+_ :     
Zero + y = y
Succ x + y = Succ (x + y)

{-# BUILTIN NATURAL  #-}

cond :  {a : Set} -> Bool -> a -> a -> a
cond True t e = t
cond False t e = e

test : 
test = cond True 3 45

id :  {a : Set} -> a -> a 
id x = x

data List (a : Set) : Set where
  Nil : List a 
  Cons : a -> List a -> List a

_++_ : {a : Set} -> List a -> List a -> List a
Nil ++ ys = ys
Cons x xs ++ ys = Cons x (xs ++ ys)

xs : List 
xs = Cons 3 (Cons 4 (Cons 5 Nil))

data Maybe (a : Set) : Set where
  Nothing : Maybe a
  Just : a -> Maybe a

_!!_ : {a : Set} -> List a ->  -> Maybe a
Nil !! Zero = Nothing
Cons x xs !! Zero = Just x
Nil !! Succ i = Nothing
Cons x xs !! Succ i = xs !! i