ghc-9.6.3: The GHC API
Safe HaskellSafe-Inferred
LanguageHaskell2010

GHC.JS.Transform

Synopsis

Documentation

mapIdent :: (Ident -> JExpr) -> (JExpr -> JExpr, JStat -> JStat) Source #

Map on every variable ident

Saturation

jsSaturate :: JMacro a => Maybe FastString -> a -> a Source #

Given an optional prefix, fills in all free variable names with a supply of names generated by the prefix.

Generic traversal (via compos)

class JMacro a where Source #

Compos and ops for generic traversal as defined over the JMacro ADT.

Utility class to coerce the ADT into a regular structure.

Methods

jtoGADT :: a -> JMGadt a Source #

jfromGADT :: JMGadt a -> a Source #

Instances

Instances details
JMacro Ident Source # 
Instance details

Defined in GHC.JS.Transform

JMacro JExpr Source # 
Instance details

Defined in GHC.JS.Transform

JMacro JStat Source # 
Instance details

Defined in GHC.JS.Transform

JMacro JVal Source # 
Instance details

Defined in GHC.JS.Transform

data JMGadt a where Source #

Union type to allow regular traversal by compos.

Instances

Instances details
Compos JMGadt Source # 
Instance details

Defined in GHC.JS.Transform

Methods

compos :: (forall a. a -> m a) -> (forall a b. m (a -> b) -> m a -> m b) -> (forall a. JMGadt a -> m (JMGadt a)) -> JMGadt c -> m (JMGadt c) Source #

class Compos t where Source #

Methods

compos :: (forall a. a -> m a) -> (forall a b. m (a -> b) -> m a -> m b) -> (forall a. t a -> m (t a)) -> t c -> m (t c) Source #

Instances

Instances details
Compos JMGadt Source # 
Instance details

Defined in GHC.JS.Transform

Methods

compos :: (forall a. a -> m a) -> (forall a b. m (a -> b) -> m a -> m b) -> (forall a. JMGadt a -> m (JMGadt a)) -> JMGadt c -> m (JMGadt c) Source #

composOp :: Compos t => (forall a. t a -> t a) -> t b -> t b Source #

composOpM :: (Compos t, Monad m) => (forall a. t a -> m (t a)) -> t b -> m (t b) Source #

composOpM_ :: (Compos t, Monad m) => (forall a. t a -> m ()) -> t b -> m () Source #

composOpFold :: Compos t => b -> (b -> b -> b) -> (forall a. t a -> b) -> t c -> b Source #