packages feed

utility-ht-0.0.1: src/Data/Maybe/HT.hs

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