futhark-0.25.32: An optimising compiler for a functional, array-oriented language.

Safe Haskell | None
Language | GHC2021

Futhark.Util.Log

Description

Opaque type for an operations log that provides fast O(1) appends.

Synopsis

- data Log
- toText :: Log -> Text
- class ToLog a where
  - toLog :: a -> Log
- class (Applicative m, Monad m) => MonadLogger (m :: Type -> Type) where
  - logMsg :: ToLog a => a -> m ()
  - addLog :: Log -> m ()

# Documentation

data Log Source #

An efficiently catenable sequence of log entries.

#### Instances

Instances details

Monoid Log Source # |
Instance details Defined in Futhark.Util.Log Methods mempty :: Log Source # mappend :: Log -> Log -> Log Source # mconcat :: [Log] -> Log Source #
Semigroup Log Source # |
Instance details Defined in Futhark.Util.Log Methods (<>) :: Log -> Log -> Log Source # sconcat :: NonEmpty Log -> Log Source # stimes :: Integral b => b -> Log -> Log Source #
Monad m => MonadLogger (WriterT Log m) Source # |
Instance details Defined in Futhark.Util.Log Methods logMsg :: ToLog a => a -> WriterT Log m () Source # addLog :: Log -> WriterT Log m () Source #
Monad m => MonadLogger (RWST r Log s m) Source # |
Instance details Defined in Futhark.Util.Log Methods logMsg :: ToLog a => a -> RWST r Log s m () Source # addLog :: Log -> RWST r Log s m () Source #
Monad m => MonadLogger (RWST r Log s m) Source # |
Instance details Defined in Futhark.Util.Log Methods logMsg :: ToLog a => a -> RWST r Log s m () Source # addLog :: Log -> RWST r Log s m () Source #

toText :: Log -> Text Source #

Transform a log into pretty. Every log entry becomes its own line (or possibly more, in case of multi-line entries).

class ToLog a where Source #

Typeclass for things that can be turned into a single-entry log.

Methods

toLog :: a -> Log Source #

#### Instances

Instances details

ToLog Text Source # |
Instance details Defined in Futhark.Util.Log Methods toLog :: Text -> Log Source #
ToLog String Source # |
Instance details Defined in Futhark.Util.Log Methods toLog :: String -> Log Source #

class (Applicative m, Monad m) => MonadLogger (m :: Type -> Type) where Source #

Typeclass for monads that support logging.

Minimal complete definition

addLog

Methods

logMsg :: ToLog a => a -> m () Source #

Add one log entry.

addLog :: Log -> m () Source #

Append an entire log.

#### Instances

Instances details

MonadLogger PassM Source # |
Instance details Defined in Futhark.Pass Methods logMsg :: ToLog a => a -> PassM () Source # addLog :: Log -> PassM () Source #
MonadLogger FutharkM Source # |
Instance details Defined in Futhark.Pipeline Methods logMsg :: ToLog a => a -> FutharkM () Source # addLog :: Log -> FutharkM () Source #
MonadLogger IO Source # |
Instance details Defined in Futhark.Util.Log Methods logMsg :: ToLog a => a -> IO () Source # addLog :: Log -> IO () Source #
Monad m => MonadLogger (DistNestT rep m) Source # |
Instance details Defined in Futhark.Pass.ExtractKernels.DistributeNests Methods logMsg :: ToLog a => a -> DistNestT rep m () Source # addLog :: Log -> DistNestT rep m () Source #
Monad m => MonadLogger (WriterT Log m) Source # |
Instance details Defined in Futhark.Util.Log Methods logMsg :: ToLog a => a -> WriterT Log m () Source # addLog :: Log -> WriterT Log m () Source #
Monad m => MonadLogger (RWST r Log s m) Source # |
Instance details Defined in Futhark.Util.Log Methods logMsg :: ToLog a => a -> RWST r Log s m () Source # addLog :: Log -> RWST r Log s m () Source #
Monad m => MonadLogger (RWST r Log s m) Source # |
Instance details Defined in Futhark.Util.Log Methods logMsg :: ToLog a => a -> RWST r Log s m () Source # addLog :: Log -> RWST r Log s m () Source #