Smart constructor

1
2
3
4
toP :: forall d a. SingI d => Vector a -> Maybe (Point d a)
toP v | V.length v == k = Just (Point v)
      | otherwise       = Nothing 
  where k = fromInteger $ fromSing (sing :: Sing d)