Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Grid parsers.
Synopsis
- getMat' :: MonadState ByteString m => Int -> Int -> m (IxVector (Int, Int) (Vector Int))
- getGrid' :: MonadState ByteString m => Int -> Int -> m (IxUVector (Int, Int) Char)
- getDiagMat' :: (PrimMonad m, MonadState ByteString m) => Int -> m (IxUVector (Int, Int) Int)
Documentation
getMat' :: MonadState ByteString m => Int -> Int -> m (IxVector (Int, Int) (Vector Int)) #
\(O(HW)\) Reads next h * w
elements as matrix of type a
.
Example
Input:
1 2 3 4 5 6
Parsed result:
1 2 3 4 5 6
getGrid' :: MonadState ByteString m => Int -> Int -> m (IxUVector (Int, Int) Char) #
\(O(HW)\) Reads next h * w
elements as a char-based grid.
Example
Input:
abc def
Parsed result:
a b c d e f
getDiagMat' :: (PrimMonad m, MonadState ByteString m) => Int -> m (IxUVector (Int, Int) Int) #
\(O(HW)\) Gets diagnoal matrix input.
Example
Input:
4 8 5 6 8 3
Parsed result:
0 4 8 5 4 0 6 8 8 6 0 3 5 8 3 0