checkAssignments :: Program a b c NodeMeta -> ErrorOr ()
checkAssignments = mapMExpressions_ checkAssignment
  where checkAssignment BinaryOperation{ left = left, binOp = Assign } = checkAssignable left
        checkAssignment _                                              = return ()
        checkAssignable Variable{} = return ()
        checkAssignable a          = notAssignable $ expressionPos a
checkAssignments :: Program a b c NodeMeta -> ErrorOr ()
checkAssignments = mapMExpressions_ checkAssignment
  where checkAssignment BinaryOperation{ left = left, binOp = Assign } = checkAssignable left
        checkAssignment _                                              = return ()
        checkAssignable Variable{} = return ()
        checkAssignable a          = notAssignable $ expressionPos a
checkAssignments = mapMExpressions_ checkAssignment
  where checkAssignment BinaryOperation{ left = left, binOp = Assign } = checkAssignable left
        checkAssignment _                                              = return ()
        checkAssignable Variable{} = return ()
        checkAssignable a          = notAssignable $ expressionPos a