    module Bindings.HDF5.Raw.Util where

    import Bindings.HDF5.Raw

    hboolToBool :: HBool_t -> Bool
    hboolToBool :: HBool_t -> Bool
    hboolToBool (HBool_t Word8
    n) = Word8
    n Word8 -> Word8 -> Bool
    forall a. Eq a => a -> a -> Bool
    /= Word8
    0

    boolToHBool :: Bool -> HBool_t
    boolToHBool :: Bool -> HBool_t
    boolToHBool Bool
    True  = Word8 -> HBool_t
    HBool_t Word8
    1
    boolToHBool Bool
    False = Word8 -> HBool_t
    HBool_t Word8
    0

    test_htri_t :: HTri_t -> Maybe Bool
    test_htri_t :: HTri_t -> Maybe Bool
    test_htri_t (HTri_t Int32
    n) = case Int32 -> Int32 -> Ordering
    forall a. Ord a => a -> a -> Ordering
    compare Int32
    n Int32
    0 of
        Ordering
    LT -> Maybe Bool
    forall a. Maybe a
    Nothing
        Ordering
    EQ -> Bool -> Maybe Bool
    forall a. a -> Maybe a
    Just Bool
    False
        Ordering
    GT -> Bool -> Maybe Bool
    forall a. a -> Maybe a
    Just Bool
    True