| ||||||||||||||||

| ||||||||||||||||

| ||||||||||||||||

Description | ||||||||||||||||

Handy functions for creating much Core syntax | ||||||||||||||||

Synopsis | ||||||||||||||||

Constructing normal syntax | ||||||||||||||||

mkCoreLet :: CoreBind -> CoreExpr -> CoreExpr | ||||||||||||||||

Bind a binding group over an expression, using a let or case as
appropriate (see CoreSyn#let_app_invariant)
| ||||||||||||||||

mkCoreLets :: [CoreBind] -> CoreExpr -> CoreExpr | ||||||||||||||||

Bind a list of binding groups over an expression. The leftmost binding group becomes the outermost group in the resulting expression | ||||||||||||||||

mkCoreApp :: CoreExpr -> CoreExpr -> CoreExpr | ||||||||||||||||

Construct an expression which represents the application of one expression to the other | ||||||||||||||||

mkCoreApps :: CoreExpr -> [CoreExpr] -> CoreExpr | ||||||||||||||||

Construct an expression which represents the application of a number of expressions to another. The leftmost expression in the list is applied first | ||||||||||||||||

mkCoreConApps :: DataCon -> [CoreExpr] -> CoreExpr | ||||||||||||||||

Construct an expression which represents the application of a number of expressions to that of a data constructor expression. The leftmost expression in the list is applied first | ||||||||||||||||

mkCoreLams :: [CoreBndr] -> CoreExpr -> CoreExpr | ||||||||||||||||

Create a lambda where the given expression has a number of variables bound over it. The leftmost binder is that bound by the outermost lambda in the result | ||||||||||||||||

Constructing boxed literals | ||||||||||||||||

mkWordExpr :: Integer -> CoreExpr | ||||||||||||||||

Create a CoreExpr which will evaluate to the a Word with the given value
| ||||||||||||||||

mkWordExprWord :: Word -> CoreExpr | ||||||||||||||||

Create a CoreExpr which will evaluate to the given Word
| ||||||||||||||||

mkIntExpr :: Integer -> CoreExpr | ||||||||||||||||

Create a CoreExpr which will evaluate to the given Int
| ||||||||||||||||

mkIntExprInt :: Int -> CoreExpr | ||||||||||||||||

Create a CoreExpr which will evaluate to the given Int
| ||||||||||||||||

mkIntegerExpr :: MonadThings m => Integer -> m CoreExpr | ||||||||||||||||

Create a CoreExpr which will evaluate to the given Integer
| ||||||||||||||||

mkFloatExpr :: Float -> CoreExpr | ||||||||||||||||

Create a CoreExpr which will evaluate to the given Float
| ||||||||||||||||

mkDoubleExpr :: Double -> CoreExpr | ||||||||||||||||

Create a CoreExpr which will evaluate to the given Double
| ||||||||||||||||

mkCharExpr :: Char -> CoreExpr | ||||||||||||||||

Create a CoreExpr which will evaluate to the given Char
| ||||||||||||||||

mkStringExpr :: MonadThings m => String -> m CoreExpr | ||||||||||||||||

Create a CoreExpr which will evaluate to the given String
| ||||||||||||||||

mkStringExprFS :: MonadThings m => FastString -> m CoreExpr | ||||||||||||||||

Create a CoreExpr which will evaluate to a string morally equivalent to the given FastString
| ||||||||||||||||

Constructing general big tuples | ||||||||||||||||

GHCs built in tuples can only go up to We call tuples above this size "big tuples", and emulate them by creating and pattern matching on >nested< tuples that are expressible by GHC. Nesting policy: it's better to have a 2-tuple of 10-tuples (3 objects) than a 10-tuple of 2-tuples (11 objects), so we want the leaves of any construction to be big. If you just use the | ||||||||||||||||

mkChunkified | ||||||||||||||||

| ||||||||||||||||

Constructing small tuples | ||||||||||||||||

mkCoreVarTup :: [Id] -> CoreExpr | ||||||||||||||||

Build a small tuple holding the specified variables | ||||||||||||||||

mkCoreVarTupTy :: [Id] -> Type | ||||||||||||||||

Bulid the type of a small tuple that holds the specified variables | ||||||||||||||||

mkCoreTup :: [CoreExpr] -> CoreExpr | ||||||||||||||||

Build a small tuple holding the specified expressions | ||||||||||||||||

mkCoreTupTy :: [Type] -> Type | ||||||||||||||||

Build the type of a small tuple that holds the specified type of thing | ||||||||||||||||

Constructing big tuples | ||||||||||||||||

mkBigCoreVarTup :: [Id] -> CoreExpr | ||||||||||||||||

Build a big tuple holding the specified variables | ||||||||||||||||

mkBigCoreVarTupTy :: [Id] -> Type | ||||||||||||||||

Build the type of a big tuple that holds the specified variables | ||||||||||||||||

mkBigCoreTup :: [CoreExpr] -> CoreExpr | ||||||||||||||||

Build a big tuple holding the specified expressions | ||||||||||||||||

mkBigCoreTupTy :: [Type] -> Type | ||||||||||||||||

Build the type of a big tuple that holds the specified type of thing | ||||||||||||||||

Deconstructing small tuples | ||||||||||||||||

mkSmallTupleSelector :: [Id] -> Id -> Id -> CoreExpr -> CoreExpr | ||||||||||||||||

Like mkSmallTupleSelector [x] x v e = [| e |] mkSmallTupleSelector [x,y,z] x v e = [| case e of v { (x,y,z) -> x } |] | ||||||||||||||||

mkSmallTupleCase | ||||||||||||||||

| ||||||||||||||||

Deconstructing big tuples | ||||||||||||||||

mkTupleSelector | ||||||||||||||||

| ||||||||||||||||

mkTupleCase | ||||||||||||||||

| ||||||||||||||||

Constructing list expressions | ||||||||||||||||

mkNilExpr :: Type -> CoreExpr | ||||||||||||||||

Makes a list [] for lists of the specified type
| ||||||||||||||||

mkConsExpr :: Type -> CoreExpr -> CoreExpr -> CoreExpr | ||||||||||||||||

Makes a list (:) for lists of the specified type
| ||||||||||||||||

mkListExpr :: Type -> [CoreExpr] -> CoreExpr | ||||||||||||||||

Make a list containing the given expressions, where the list has the given type | ||||||||||||||||

mkFoldrExpr | ||||||||||||||||

| ||||||||||||||||

mkBuildExpr | ||||||||||||||||

| ||||||||||||||||

Produced by Haddock version 2.3.0 |