delambdaTopLevel :: [TlExpr] -> [TlExpr]
delambdaTopLevel = map delambda
  where
    delambda tl = case tl of
      TlDef x (Unquantified (CTArrow _ t)) (EAbs bs e) ->
        TlFuncDef x (deExprName bs) t e
      _ -> tl
    deExprName = map (\(ExprName x, t) -> (x,t))

-- | Transform main into a function.
delambdaTopLevel :: [TlExpr] -> [TlExpr]
delambdaTopLevel = map delambda
  where
    delambda tl = case tl of
      TlDef x (Unquantified (CTArrow _ t)) (EAbs bs e) ->
        TlFuncDef x (deExprName bs) t e
      _ -> tl
    deExprName = map (\(ExprName x, t) -> (x,t))

-- | Transform main into a function.
delambdaTopLevel = map delambda
  where
    delambda tl = case tl of
      TlDef x (Unquantified (CTArrow _ t)) (EAbs bs e) ->
        TlFuncDef x (deExprName bs) t e
      _ -> tl
    deExprName = map (\(ExprName x, t) -> (x,t))

-- | Transform main into a function.