however, if you zapped someone it woudl still be an assault in common law.
The parallel is if you set up a device to electric shock a burglar. It is been shown by case law that to try and deter burglars by this means constitutes unreasonable force, and you can be prosecuted - the extreme case was Tony Martin, the farmer who defended himself against two burglars with a gun. Simply because the burglar was feeling and he shot, made his actions 'beyond reasonable'.
Setting up such a fence, unmarked is a hazard, and since there are other methods to deter cats, puts the operator into a vulnerable position legally.
In the case of a farmer, the electric fence is a reasonable form of boundary, because it has a clear, reasonable use in a farming context, and provided it was clearly signed then anyone straying onto the field and getting a shock wouldn't have grounds for action. In the scenario where a friends child touched it and was shocked there would clearly be grounds for action. A garden may be accessible to innocent members of the public, and it would be classed as 'unreasonable and excessive force' and she wouldn't have a leg to stand on if something went wrong
(PS - personal observation: I think the only mistake Tony Martin made was to let one get away free. I would have pursued the other one and killed him, and then buried them, after all he was a farmer, and had land and a JCB. Who was going to come looking for them - "Excuse me, have you seen my boyfriend, he came to burgle you about two weeks ago?".
I dont think so.)