Add utility function for the IDE Logger (#1132)

This commit is contained in:
Neil Mitchell 2019-05-14 16:51:20 +01:00 committed by GitHub
parent 160554ac95
commit 3d66a7aed6

View File

@ -7,6 +7,7 @@
-- framework they want to.
module Development.IDE.Logger
( Handle(..)
, makeOneHandle
, makeNopHandle
) where
@ -19,5 +20,7 @@ data Handle = Handle {
}
makeNopHandle :: Handle
makeNopHandle = Handle e e where
e _ = pure ()
makeNopHandle = makeOneHandle $ const $ pure ()
makeOneHandle :: (HasCallStack => T.Text -> IO ()) -> Handle
makeOneHandle x = Handle x x