Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- module Gibbon.Language.Constants
- module Gibbon.Language.Syntax
- mapExt :: (e1 l d -> e2 l d) -> PreExp e1 l d -> PreExp e2 l d
- mapLocs :: (e l2 d -> e l2 d) -> PreExp e l2 d -> PreExp e l2 d
- mapExprs :: (e -> e) -> Prog e -> Prog e
- mapMExprs :: Monad m => (e -> m e) -> Prog e -> m (Prog e)
- visitExp :: forall l1 l2 e1 e2 d1 d2. (l1 -> l2) -> (e1 l1 d1 -> e2 l2 d2) -> (d1 -> d2) -> PreExp e1 l1 d1 -> PreExp e2 l2 d2
- subst :: HasSubstitutable e l d => Var -> PreExp e l d -> PreExp e l d -> PreExp e l d
- substE :: HasSubstitutable e l d => PreExp e l d -> PreExp e l d -> PreExp e l d -> PreExp e l d
- hasTimeIt :: PreExp e l d -> Bool
- hasSpawns :: PreExp e l d -> Bool
- hasSpawnsProg :: Prog (PreExp e l d) -> Bool
- projNonFirst :: (Out l, Out d, Out (e l d)) => Int -> PreExp e l d -> PreExp e l d
- mkProj :: Int -> PreExp e l d -> PreExp e l d
- mkProd :: [PreExp e l d] -> PreExp e l d
- mkLets :: [(Var, [loc], dec, PreExp ext loc dec)] -> PreExp ext loc dec -> PreExp ext loc dec
- flatLets :: [(Var, [l], d, PreExp e l d)] -> PreExp e l d -> PreExp e l d
- tuplizeRefs :: Var -> [Var] -> [d] -> PreExp e l d -> PreExp e l d
- mkProdTy :: [UrTy a] -> UrTy a
- projTy :: Out a => Int -> UrTy a -> UrTy a
- voidTy :: UrTy a
- isProdTy :: UrTy a -> Bool
- isNestedProdTy :: UrTy a -> Bool
- isPackedTy :: UrTy a -> Bool
- isScalarTy :: UrTy a -> Bool
- hasPacked :: Show a => UrTy a -> Bool
- sizeOfTy :: UrTy a -> Maybe Int
- primArgsTy :: Prim (UrTy a) -> [UrTy a]
- primRetTy :: Prim (UrTy a) -> UrTy a
- tyToDataCon :: Show a => UrTy a -> DataCon
- stripTyLocs :: UrTy a -> UrTy ()
- isValidListElemTy :: UrTy a -> Bool
- getPackedTys :: Show a => UrTy a -> [UrTy a]
- assertTriv :: (HasCallStack, Expression e) => e -> a -> a
- assertTrivs :: (HasCallStack, Expression e) => [e] -> a -> a
Documentation
module Gibbon.Language.Constants
module Gibbon.Language.Syntax
Helpers operating on expressions
mapExt :: (e1 l d -> e2 l d) -> PreExp e1 l d -> PreExp e2 l d Source #
Apply a function to the extension points only.
mapLocs :: (e l2 d -> e l2 d) -> PreExp e l2 d -> PreExp e l2 d Source #
Apply a function to the locations only.
visitExp :: forall l1 l2 e1 e2 d1 d2. (l1 -> l2) -> (e1 l1 d1 -> e2 l2 d2) -> (d1 -> d2) -> PreExp e1 l1 d1 -> PreExp e2 l2 d2 Source #
Apply a function to the locations, extensions, and binder-decorations, respectively.
subst :: HasSubstitutable e l d => Var -> PreExp e l d -> PreExp e l d -> PreExp e l d Source #
Substitute an expression in place of a variable.
substE :: HasSubstitutable e l d => PreExp e l d -> PreExp e l d -> PreExp e l d -> PreExp e l d Source #
Expensive subst
that looks for a whole matching sub-EXPRESSION.
If the old expression is a variable, this still avoids going under binder.
projNonFirst :: (Out l, Out d, Out (e l d)) => Int -> PreExp e l d -> PreExp e l d Source #
Project something which had better not be the first thing in a tuple.
mkProj :: Int -> PreExp e l d -> PreExp e l d Source #
Smart constructor that immediately destroys products if it can: Does NOT avoid single-element tuples.
mkLets :: [(Var, [loc], dec, PreExp ext loc dec)] -> PreExp ext loc dec -> PreExp ext loc dec Source #
Make a nested series of lets.
flatLets :: [(Var, [l], d, PreExp e l d)] -> PreExp e l d -> PreExp e l d Source #
Alternative version of L1.mkLets that also flattens
Helpers operating on types
isNestedProdTy :: UrTy a -> Bool Source #
Do values of this type contain nested tuples ?
isPackedTy :: UrTy a -> Bool Source #
Are values of this type Packed ?
isScalarTy :: UrTy a -> Bool Source #
tyToDataCon :: Show a => UrTy a -> DataCon Source #
Get the data constructor type from a type, failing if it's not packed
stripTyLocs :: UrTy a -> UrTy () Source #
isValidListElemTy :: UrTy a -> Bool Source #
Lists of scalars or flat products of scalars are allowed.
Misc
assertTriv :: (HasCallStack, Expression e) => e -> a -> a Source #
Ensure that an expression is trivial.
assertTrivs :: (HasCallStack, Expression e) => [e] -> a -> a Source #
List version of assertTriv
.
Orphan instances
Renamable Var Source # | |
Renamable a => Renamable (UrTy a) Source # | |
(Out l, Show l, Show d, Out d, Expression (e l d)) => Expression (PreExp e l d) Source # | |
FreeVars (e l d) => FreeVars (PreExp e l d) Source # | Free data variables. Does not include function variables, which currently occupy a different namespace. Does not include location/region variables. |
HasRenamable e l d => Renamable (PreExp e l d) Source # | |
HasSubstitutable e l d => Substitutable (PreExp e l d) Source # | |
(Show (), Out (), TyOf (e () (UrTy ())) ~ TyOf (PreExp e () (UrTy ())), FunctionTy (UrTy ()), Typeable (e () (UrTy ()))) => Typeable (PreExp e () (UrTy ())) Source # | A Typeable instance for L1 and L3 (L2 defines it's own) |