-rotl :: (PositiveT s, s ~ Succ (Pred s)) => TFVec s a -> TFVec s a
-rotl xs = last xs +> init xs
-
-class Rotr a where rotr :: a -> a
-instance Rotr (TFVec D0 a) where rotr xs = xs
-instance (PositiveT s, s ~ Succ (Pred s)) => Rotr (TFVec s a) where rotr xs = tail xs <+ head xs
+rotl :: forall s a . NaturalT s => TFVec s a -> TFVec s a
+rotl = liftV rotl'
+ where vlen = fromIntegerT (undefined :: s)
+ rotl' [] = []
+ rotl' xs = let (i,[l]) = splitAt (vlen - 1) xs
+ in l : i
+
+rotr :: NaturalT s => TFVec s a -> TFVec s a
+rotr = liftV rotr'
+ where
+ rotr' [] = []
+ rotr' (x:xs) = xs P.++ [x]