Safe Haskell | None |
---|---|
Language | Haskell2010 |
- module Curly.Core.Types
- data Symbol s
- t'Argument :: Traversal' (Symbol s) Int
- t'Builtin :: Traversal (Type s, Builtin) (Type s', Builtin) (Symbol s) (Symbol s')
- data AnnNode s a = AnnNode {}
- data Strictness s
- type ExprStrictness s = ([Strictness s], Strictness s)
- noStrictness :: Strictness s
- class Identifier s => Annotated e s | e -> s where
- annType :: Lens' (AnnNode s a) (Type s)
- type AnnExpr s = Free (AnnNode s) (Symbol s)
- anonymous :: NameExpr s -> AnnExpr s
- data NameNode s a
- type NameExpr s = NameNode s (NameTail s)
- newtype RawNameExpr s = RawNameExpr {
- _rawNameExpr :: NameExpr s
- type NameTail s = Free (NameNode s) (Symbol s)
- i'NameNode :: Iso (NameNode s a) (NameNode t b) (Free (AnnNode s) (s, a)) (Free (AnnNode t) (t, b))
- t'exprType :: Fold' (NameExpr s) (Type s)
- expr_identity :: Identifier s => RawNameExpr s
- expr_constant :: Identifier s => RawNameExpr s -> RawNameExpr s
- expr_constructor :: Identifier s => Type s -> RawNameExpr s
- expr_destructor :: Identifier s => Type s -> RawNameExpr s
- optimize :: forall s. Identifier s => (Builtin -> s) -> NameExpr s -> NameExpr s
- solveConstraints :: Identifier s => InstanceMap s (Type s, NameExpr s) -> NameExpr s -> NameExpr s
Documentation
module Curly.Core.Types
Building blocks
A symbol is either an argument referring to its nth parent, or a builtin
(Identifier s, Identifier s') => HasIdents s s' (Symbol s) (Symbol s') Source # | |
(Serializable Bytes s, Identifier s) => Serializable Bytes (Symbol s) Source # | |
(Format Bytes s, Identifier s) => Format Bytes (Symbol s) Source # | |
Eq (Symbol s) Source # | |
Ord (Symbol s) Source # | |
Show (Symbol s) Source # | |
Generic (Symbol s) Source # | |
NFData (Symbol s) Source # | |
Documented (Symbol s) Source # | |
Identifier s => Annotated (NameExpr s) s Source # | |
Identifier s => Annotated (AnnExpr s) s Source # | |
Identifier s => Semantic (AnnExpr s) s (Symbol s) Source # | |
Identifier s => Semantic (RawNameExpr s) s (s, NameTail s) Source # | |
Identifier s => Semantic (NameExpr s) s (s, NameTail s) Source # | |
type Rep (Symbol s) Source # | |
t'Argument :: Traversal' (Symbol s) Int Source #
An annotated node
This type is used as a base for all fully-resolved expressions. It helps in caching most of the intermediate steps of compiling, such as knowing which variables are free, what size it is, or its type.
(Identifier s, Identifier s') => HasIdents s s' (AnnNode s a) (AnnNode s' a) Source # | |
Functor (AnnNode s) Source # | |
Foldable (AnnNode s) Source # | |
Traversable (AnnNode s) Source # | |
Identifier s => Annotated (AnnExpr s) s Source # | |
Identifier s => Semantic (AnnExpr s) s (Symbol s) Source # | |
Eq (AnnNode s a) Source # | |
Ord (AnnNode s a) Source # | |
Generic (AnnNode s a) Source # | |
(NFData s, NFData a) => NFData (AnnNode s a) Source # | |
type Rep (AnnNode s a) Source # | |
data Strictness s Source #
HasIdents s s' (Strictness s) (Strictness s') Source # | |
Serializable Bytes s => Serializable Bytes (Strictness s) Source # | |
Format Bytes s => Format Bytes (Strictness s) Source # | |
Eq s => Eq (Strictness s) Source # | |
Ord s => Ord (Strictness s) Source # | |
Generic (Strictness s) Source # | |
NFData s => NFData (Strictness s) Source # | |
Identifier s => Documented (Strictness s) Source # | |
type Rep (Strictness s) Source # | |
type ExprStrictness s = ([Strictness s], Strictness s) Source #
noStrictness :: Strictness s Source #
Annotated expressions
class Identifier s => Annotated e s | e -> s where Source #
The class of annotated expressions, from which some information may be retrieved.
exprIdent :: e -> Int Source #
exprRefs :: e -> Map (Symbol s) Int Source #
exprType :: e -> Type s Source #
exprStrictness :: e -> ExprStrictness s Source #
Identifier s => Annotated (NameExpr s) s Source # | |
Identifier s => Annotated (AnnExpr s) s Source # | |
Named expressions
A partially-resolved expression node
(Identifier s, Identifier s') => HasIdents s s' (NameNode s a) (NameNode s' a) Source # | |
Functor (NameNode s) Source # | |
Foldable (NameNode s) Source # | |
Traversable (NameNode s) Source # | |
Identifier s => Annotated (NameExpr s) s Source # | |
Identifier s => Semantic (RawNameExpr s) s (s, NameTail s) Source # | |
Identifier s => Semantic (NameExpr s) s (s, NameTail s) Source # | |
(Eq a, Eq s) => Eq (NameNode s a) Source # | |
(Ord a, Ord s) => Ord (NameNode s a) Source # | |
type NameExpr s = NameNode s (NameTail s) Source #
A partially resolved expression. Each level corresponds to a different module.
newtype RawNameExpr s Source #
Identifier s => Semantic (RawNameExpr s) s (s, NameTail s) Source # | |
i'NameNode :: Iso (NameNode s a) (NameNode t b) (Free (AnnNode s) (s, a)) (Free (AnnNode t) (t, b)) Source #
A NameNode's representation
Useful pre-defined expressions
expr_identity :: Identifier s => RawNameExpr s Source #
expr_constant :: Identifier s => RawNameExpr s -> RawNameExpr s Source #
expr_constructor :: Identifier s => Type s -> RawNameExpr s Source #
expr_destructor :: Identifier s => Type s -> RawNameExpr s Source #
Expression post-processing
solveConstraints :: Identifier s => InstanceMap s (Type s, NameExpr s) -> NameExpr s -> NameExpr s Source #