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

Safe Haskell | Safe-Inferred
Language | GHC2021

Futhark.FreshNames

Description

This module provides facilities for generating unique names.

Synopsis

- data VNameSource
- blankNameSource :: VNameSource
- newNameSource :: Int -> VNameSource
- newName :: VNameSource -> VName -> (VName, VNameSource)

# Documentation

data VNameSource Source #

A name source is conceptually an infinite sequence of names with no repeating entries. In practice, when asked for a name, the name source will return the name along with a new name source, which should then be used in place of the original.

The `Ord` instance is based on how many names have been extracted from the name source.

#### Instances

Instances details

Monoid VNameSource Source # |
Instance details Defined in Futhark.FreshNames Methods mempty :: VNameSource Source # mappend :: VNameSource -> VNameSource -> VNameSource Source # mconcat :: [VNameSource] -> VNameSource Source #
Semigroup VNameSource Source # |
Instance details Defined in Futhark.FreshNames Methods (<>) :: VNameSource -> VNameSource -> VNameSource Source # sconcat :: NonEmpty VNameSource -> VNameSource Source # stimes :: Integral b => b -> VNameSource -> VNameSource Source #
Eq VNameSource Source # |
Instance details Defined in Futhark.FreshNames Methods (==) :: VNameSource -> VNameSource -> Bool Source # (/=) :: VNameSource -> VNameSource -> Bool Source #
Ord VNameSource Source # |

Instance details

Defined in Futhark.FreshNames

Methods

compare :: VNameSource -> VNameSource -> Ordering Source #

(<) :: VNameSource -> VNameSource -> Bool Source #

(<=) :: VNameSource -> VNameSource -> Bool Source #

(>) :: VNameSource -> VNameSource -> Bool Source #

(>=) :: VNameSource -> VNameSource -> Bool Source #

max :: VNameSource -> VNameSource -> VNameSource Source #

min :: VNameSource -> VNameSource -> VNameSource Source #

Lift VNameSource Source # |
Instance details Defined in Futhark.FreshNames Methods lift :: Quote m => VNameSource -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => VNameSource -> Code m VNameSource Source #
Monad im => MonadFreshNames (StateT VNameSource im) Source # |
Instance details Defined in Futhark.MonadFreshNames Methods getNameSource :: StateT VNameSource im VNameSource Source # putNameSource :: VNameSource -> StateT VNameSource im () Source #
Monad im => MonadFreshNames (StateT VNameSource im) Source # |
Instance details Defined in Futhark.MonadFreshNames Methods getNameSource :: StateT VNameSource im VNameSource Source # putNameSource :: VNameSource -> StateT VNameSource im () Source #
MonadState (VNameSource, Bool, Certs) (SimpleM rep) Source # |
Instance details Defined in Futhark.Optimise.Simplify.Engine Methods get :: SimpleM rep (VNameSource, Bool, Certs) Source # put :: (VNameSource, Bool, Certs) -> SimpleM rep () Source # state :: ((VNameSource, Bool, Certs) -> (a, (VNameSource, Bool, Certs))) -> SimpleM rep a Source #
(Monad im, Monoid w) => MonadFreshNames (RWST r w VNameSource im) Source # |
Instance details Defined in Futhark.MonadFreshNames Methods getNameSource :: RWST r w VNameSource im VNameSource Source # putNameSource :: VNameSource -> RWST r w VNameSource im () Source #
(Monad im, Monoid w) => MonadFreshNames (RWST r w VNameSource im) Source # |
Instance details Defined in Futhark.MonadFreshNames Methods getNameSource :: RWST r w VNameSource im VNameSource Source # putNameSource :: VNameSource -> RWST r w VNameSource im () Source #

blankNameSource :: VNameSource Source #

A blank name source.

newNameSource :: Int -> VNameSource Source #

A new name source that starts counting from the given number.

newName :: VNameSource -> VName -> (VName, VNameSource) Source #

Produce a fresh name, using the given name as a template.