Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- square :: Num a => a -> a
- isqrt :: Int -> Int
- (.:) :: (b -> c) -> (a1 -> a2 -> b) -> a1 -> a2 -> c
- swapDupeU :: Vector (Int, Int) -> Vector (Int, Int)
- swapDupeW :: Unbox w => Vector (Int, Int, w) -> Vector (Int, Int, w)
- ortho4 :: Vector (Int, Int)
- ortho4' :: ((Int, Int), (Int, Int)) -> (Int, Int) -> Vector (Int, Int)
- orthoWith :: ((Int, Int), (Int, Int)) -> ((Int, Int) -> Bool) -> Int -> Vector Int
- diag4 :: Vector (Int, Int)
- slice :: Vector v a => Int -> Int -> v a -> v a
- zero2 :: Int -> Int -> ((Int, Int), (Int, Int))
- zero3 :: Int -> Int -> Int -> ((Int, Int, Int), (Int, Int, Int))
- rangeG :: Vector v Int => Int -> Int -> v Int
- rangeV :: Int -> Int -> Vector Int
- rangeU :: Int -> Int -> Vector Int
- rangeGR :: Vector v Int => Int -> Int -> v Int
- rangeVR :: Int -> Int -> Vector Int
- rangeUR :: Int -> Int -> Vector Int
- times :: Int -> (a -> a) -> a -> a
- interleave :: [a] -> [a] -> [a]
- combs :: Int -> [a] -> [[a]]
- swapDupe :: (a, a) -> [(a, a)]
- add2 :: (Int, Int) -> (Int, Int) -> (Int, Int)
- sub2 :: (Int, Int) -> (Int, Int) -> (Int, Int)
- mul2 :: Int -> (Int, Int) -> (Int, Int)
- add3 :: (Int, Int, Int) -> (Int, Int, Int) -> (Int, Int, Int)
- sub3 :: (Int, Int, Int) -> (Int, Int, Int) -> (Int, Int, Int)
- mul3 :: (Int, Int, Int) -> (Int, Int, Int) -> (Int, Int, Int)
- toRadian :: Double -> Double
- toDegree :: Double -> Double
- fst4 :: (a, b, c, d) -> a
- snd4 :: (a, b, c, d) -> b
- thd4 :: (a, b, c, d) -> c
- fth4 :: (a, b, c, d) -> d
- first4 :: (a -> x) -> (a, b, c, d) -> (x, b, c, d)
- second4 :: (b -> x) -> (a, b, c, d) -> (a, x, c, d)
- third4 :: (c -> x) -> (a, b, c, d) -> (a, b, x, d)
- fourth4 :: (d -> x) -> (a, b, c, d) -> (a, b, c, x)
- fix1 :: a -> ((a -> b) -> a -> b) -> b
- fix2 :: a -> b -> ((a -> b -> c) -> a -> b -> c) -> c
- fix3 :: a -> b -> c -> ((a -> b -> c -> d) -> a -> b -> c -> d) -> d
Documentation
\(O(1)\) Inaccurate, but fast Int
square root.
TODO: Fast and accurate implementation
swapDupeW :: Unbox w => Vector (Int, Int, w) -> Vector (Int, Int, w) #
\(O(E)\) Converts undirected edges into directed edges.
orthoWith :: ((Int, Int), (Int, Int)) -> ((Int, Int) -> Bool) -> Int -> Vector Int #
Specifically for grids with generic search functions.
rangeG :: Vector v Int => Int -> Int -> v Int #
\(O(N)\) List-like range syntax for vector
.
>>>
rangeG @U.Vector 3 5
[3,4,5]
rangeGR :: Vector v Int => Int -> Int -> v Int #
\(O(N)\) Easier reverse range syntax for vector
.
>>>
rangeGR @U.Vector 3 5
[5,4,3]
times :: Int -> (a -> a) -> a -> a #
\(O(N)\) Applies the given function n
times.
>>> -- 2 ^ 3
>>> times 3 (* 2) (1 :: Int)
8
interleave :: [a] -> [a] -> [a] #
\(O(N+M)\)
combs :: Int -> [a] -> [[a]] #
\(O(_{n}C_{r})\) Combinations. - https://stackoverflow.com/a/58511843 - https://zenn.dev/osushi0x/scraps/51ff0594a1e863#comment-e6b0af9b61c54c