module Data.Maybe.HT where

{- | Returns 'Just' if the precondition is fulfilled. -}
{-# INLINE toMaybe #-}
toMaybe :: Bool -> a -> Maybe a
toMaybe False _ = Nothing
toMaybe True  x = Just x