splitAt
    :: KnownNat n
    => Proxy (n::Nat)
    -> SizedList (m+n) a
    -> (SizedList n a, SizedList m a)
splitAt nP list = unsafeSplitAt (fromIntegral $ natVal nP) list
  where
    unsafeSplitAt :: Int -> SizedList p a -> (SizedList q a, SizedList r a)
    unsafeSplitAt 0 list = unsafeCoerce (N, list)
    unsafeSplitAt i list =
        let (first, second) = unsafeSplitAt (i-1) (tail $ unsafeCoerce list)
        in
        unsafeCoerce (head (unsafeCoerce list) :- first, second)

-- | Dot product.
splitAt
    :: KnownNat n
    => Proxy (n::Nat)
    -> SizedList (m+n) a
    -> (SizedList n a, SizedList m a)
splitAt nP list = unsafeSplitAt (fromIntegral $ natVal nP) list
  where
    unsafeSplitAt :: Int -> SizedList p a -> (SizedList q a, SizedList r a)
    unsafeSplitAt 0 list = unsafeCoerce (N, list)
    unsafeSplitAt i list =
        let (first, second) = unsafeSplitAt (i-1) (tail $ unsafeCoerce list)
        in
        unsafeCoerce (head (unsafeCoerce list) :- first, second)

-- | Dot product.
splitAt nP list = unsafeSplitAt (fromIntegral $ natVal nP) list
  where
    unsafeSplitAt :: Int -> SizedList p a -> (SizedList q a, SizedList r a)
    unsafeSplitAt 0 list = unsafeCoerce (N, list)
    unsafeSplitAt i list =
        let (first, second) = unsafeSplitAt (i-1) (tail $ unsafeCoerce list)
        in
        unsafeCoerce (head (unsafeCoerce list) :- first, second)

-- | Dot product.