[define applyAtIndex using applyAtIndexM
Helmut Grohne <grohne@cs.uni-bonn.de>**20150126134004
 Ignore-this: 22e1b19c37a90a409b0c72baf13c6e7f
 
 This removes two uses of "fail" (by reusing the ones from applyAtIndexM).
] hunk ./src/Syntax/Class/Term.hs 30
+import Control.Monad.Identity (runIdentity)
hunk ./src/Syntax/Class/Term.hs 234
-applyAtIndex xs n _ | n < 0 = fail "Terms.applyAtIndex: negative index"
-applyAtIndex [] _ _        =  fail "Terms.applyAtIndex: index too large"
-applyAtIndex (x:xs) 0 f    =  (f x):xs
-applyAtIndex (x:xs) n f    =  x:(applyAtIndex xs (n-1) f)
-
+applyAtIndex xs n f = runIdentity $ applyAtIndexM xs n (return . f)