    -- |
    -- Module:     System.Directory.OsPath.Utils
    -- Copyright:  (c) Sergey Vinokurov 2024
    -- License:    Apache-2.0 (see LICENSE)
    -- Maintainer: serg.foo@gmail.com

    {-# LANGUAGE MagicHash     #-}
    {-# LANGUAGE UnboxedTuples #-}

    module System.Directory.OsPath.Utils
      ( touch
      ) where

    import GHC.Exts (touch#)
    import GHC.IO (IO(..))

    touch :: x -> IO ()
    touch :: forall x. x -> IO ()
    touch x
    x = (State# RealWorld -> (# State# RealWorld, () #)) -> IO ()
    forall a. (State# RealWorld -> (# State# RealWorld, a #)) -> IO a
    IO ((State# RealWorld -> (# State# RealWorld, () #)) -> IO ())
    -> (State# RealWorld -> (# State# RealWorld, () #)) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \State# RealWorld
    s0 -> case x -> State# RealWorld -> State# RealWorld
    forall a d. a -> State# d -> State# d
    touch# x
    x State# RealWorld
    s0 of State# RealWorld
    s1 -> (# State# RealWorld
    s1, () #)