packages feed

tilia-0.1.0.0: corpora/vendored/other/cpp/macro-inside-a-declaration.hs

{-# LANGUAGE CPP #-}

module Session.Log where

#define LOG(s) trace (s) (pure ())
#define STRICT(x) {-# UNPACK #-} !(x)

data Pair = Pair Int
  STRICT(Int)
  deriving (Eq)

open :: IO ()
open = do
  connect
  LOG("opened")
  where
    connect = pure ()

instance Session IO where
  close = do
    disconnect
    LOG("closed")
    where
      disconnect = pure ()