DPutils-0.1.1.0: utilities for DP
Safe HaskellNone
LanguageHaskell2010

Data.Ord.Fast

Description

This module provides a small set of function for extremely fast max and min operations that are branchless.

This should be temporary, since GHC is supposed to get the branchless variants.

NOTE these do not seem to be faster anyway.

Documentation

class FastMinMax x where Source #

Methods

fastmin :: x -> x -> x Source #

fastmax :: x -> x -> x Source #

clamp :: x -> x Source #

Clamp values to >=0.

Instances

Instances details
FastMinMax Int Source # 
Instance details

Defined in Data.Ord.Fast

Methods

fastmin :: Int -> Int -> Int Source #

fastmax :: Int -> Int -> Int Source #

clamp :: Int -> Int Source #