Stability | experimental |
---|---|

Maintainer | conal@conal.net |

Misc useful definitions

- class FMod a where
- fmod :: a -> a -> a

- class Frac a where
- frac :: a -> a

- fmodRF :: RealFrac a => a -> a -> a
- fracRF :: RealFrac a => a -> a
- fmodViaFrac :: (Fractional a, Frac a) => a -> a -> a
- fracViaFmod :: (Num a, FMod a) => a -> a
- clamp :: Ord a => (a, a) -> a -> a
- clampB :: (IfB bool a, OrdB bool a) => (a, a) -> a -> a
- smoothStep :: (Ord a, Num a) => (a, a) -> a -> a
- type Unop a = a -> a
- type Binop a = a -> a -> a
- padTo :: Int -> String -> String
- flip1 :: (a -> b) -> a -> b
- flip2 :: (a -> b -> c) -> b -> a -> c
- flip3 :: (a -> b -> c -> d) -> c -> a -> b -> d
- flip4 :: (a -> b -> c -> d -> e) -> d -> a -> b -> c -> e
- type Sink a = a -> Action
- type Action = IO ()
- (>+>) :: Sink a -> Sink b -> Sink (a, b)
- forget :: Functor f => f a -> f ()
- type R = Float
- type EyePos = (R, R, R)

# Documentation

Real-valued modulo. You can use `fmodRF`

for `RealFrac`

types and
`fmodViaFrac`

for `Frac`

types.

Take fractional component(s). Always non-negative. You can use
`fracRF`

for `RealFrac`

types and `fracViaFmod`

for `Fmod`

types.

fmodViaFrac :: (Fractional a, Frac a) => a -> a -> aSource

smoothStep :: (Ord a, Num a) => (a, a) -> a -> aSource

Smooth, clamped transition

padTo :: Int -> String -> StringSource

Pad a string to the given length, adding spaces on the right as needed.

flip2 :: (a -> b -> c) -> b -> a -> cSource

Move second argument to first place (`flip`

synonym for style uniformity)