replicate :: forall a n. KnownNat n => a -> SizedList n a
replicate val = unsafeRep (fromInteger $ natVal (Proxy :: Proxy n)) N
  where
    unsafeRep :: Int -> SizedList m a -> SizedList p a
    unsafeRep 0 sl = unsafeCoerce sl
    unsafeRep i sl = unsafeRep (i-1) (val:-sl)
replicate :: forall a n. KnownNat n => a -> SizedList n a
replicate val = unsafeRep (fromInteger $ natVal (Proxy :: Proxy n)) N
  where
    unsafeRep :: Int -> SizedList m a -> SizedList p a
    unsafeRep 0 sl = unsafeCoerce sl
    unsafeRep i sl = unsafeRep (i-1) (val:-sl)
replicate val = unsafeRep (fromInteger $ natVal (Proxy :: Proxy n)) N
  where
    unsafeRep :: Int -> SizedList m a -> SizedList p a
    unsafeRep 0 sl = unsafeCoerce sl
    unsafeRep i sl = unsafeRep (i-1) (val:-sl)