@@ -503,12 +503,15 @@ evalAtomExpr tupIn context (FunctionAtomExpr funcName arguments) = do
503503 let functions = atomFunctions context
504504 func <- atomFunctionForName funcName functions
505505 argTypes <- mapM (typeFromAtomExpr (tupleAttributes tupIn) context) arguments
506− _ <- mapM (uncurry atomTypeVerify) $ init (zip (atomFuncType func) argTypes)
507506 let expectedArgCount = length (atomFuncType func) - 1
508507 actualArgCount = length argTypes
508+ safeInit [_] = []
509+ safeInit [] = [] -- different behavior from normal init
510+ safeInit (_:xs) = safeInit xs
509511 if expectedArgCount /= actualArgCount then
510512 Left (AtomFunctionArgumentCountMismatch expectedArgCount actualArgCount)
511513 else do
514+ _ <- mapM (uncurry atomTypeVerify) $ safeInit (zip (atomFuncType func) argTypes)
512515 evaldArgs <- mapM (evalAtomExpr tupIn context) arguments
513516 pure $ (evalAtomFunction func) evaldArgs
514517evalAtomExpr _ context (RelationAtomExpr relExpr) = do