curry-base-1.1.1: Functions for manipulating Curry programs
Copyright(c) 2016 - 2017 Finn Teegen
LicenseBSD-3-clause
Maintainerfte@informatik.uni-kiel.de
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Curry.FlatCurry.Annotated.Type

Description

TODO

Synopsis

Documentation

data APattern a Source #

Constructors

APattern a (QName, a) [(VarIndex, a)] 
ALPattern a Literal 

Instances

Instances details
Eq a => Eq (APattern a) Source # 
Instance details

Defined in Curry.FlatCurry.Annotated.Type

Methods

(==) :: APattern a -> APattern a -> Bool

(/=) :: APattern a -> APattern a -> Bool

Read a => Read (APattern a) Source # 
Instance details

Defined in Curry.FlatCurry.Annotated.Type

Methods

readsPrec :: Int -> ReadS (APattern a)

readList :: ReadS [APattern a]

readPrec :: ReadPrec (APattern a)

readListPrec :: ReadPrec [APattern a]

Show a => Show (APattern a) Source # 
Instance details

Defined in Curry.FlatCurry.Annotated.Type

Methods

showsPrec :: Int -> APattern a -> ShowS

show :: APattern a -> String

showList :: [APattern a] -> ShowS

Typeable a => Typeable (APattern a) Source # 
Instance details

Defined in Curry.FlatCurry.Annotated.Type

data ABranchExpr a Source #

Constructors

ABranch (APattern a) (AExpr a) 

Instances

Instances details
Eq a => Eq (ABranchExpr a) Source # 
Instance details

Defined in Curry.FlatCurry.Annotated.Type

Methods

(==) :: ABranchExpr a -> ABranchExpr a -> Bool

(/=) :: ABranchExpr a -> ABranchExpr a -> Bool

Read a => Read (ABranchExpr a) Source # 
Instance details

Defined in Curry.FlatCurry.Annotated.Type

Methods

readsPrec :: Int -> ReadS (ABranchExpr a)

readList :: ReadS [ABranchExpr a]

readPrec :: ReadPrec (ABranchExpr a)

readListPrec :: ReadPrec [ABranchExpr a]

Show a => Show (ABranchExpr a) Source # 
Instance details

Defined in Curry.FlatCurry.Annotated.Type

Methods

showsPrec :: Int -> ABranchExpr a -> ShowS

show :: ABranchExpr a -> String

showList :: [ABranchExpr a] -> ShowS

data AExpr a Source #

Constructors

AVar a VarIndex 
ALit a Literal 
AComb a CombType (QName, a) [AExpr a] 
ALet a [((VarIndex, a), AExpr a)] (AExpr a) 
AFree a [(VarIndex, a)] (AExpr a) 
AOr a (AExpr a) (AExpr a) 
ACase a CaseType (AExpr a) [ABranchExpr a] 
ATyped a (AExpr a) TypeExpr 

Instances

Instances details
Eq a => Eq (AExpr a) Source # 
Instance details

Defined in Curry.FlatCurry.Annotated.Type

Methods

(==) :: AExpr a -> AExpr a -> Bool

(/=) :: AExpr a -> AExpr a -> Bool

Read a => Read (AExpr a) Source # 
Instance details

Defined in Curry.FlatCurry.Annotated.Type

Methods

readsPrec :: Int -> ReadS (AExpr a)

readList :: ReadS [AExpr a]

readPrec :: ReadPrec (AExpr a)

readListPrec :: ReadPrec [AExpr a]

Show a => Show (AExpr a) Source # 
Instance details

Defined in Curry.FlatCurry.Annotated.Type

Methods

showsPrec :: Int -> AExpr a -> ShowS

show :: AExpr a -> String

showList :: [AExpr a] -> ShowS

Typeable a => Typeable (AExpr a) Source # 
Instance details

Defined in Curry.FlatCurry.Annotated.Type

Methods

typeOf :: AExpr a -> TypeExpr Source #

data ARule a Source #

Constructors

ARule a [(VarIndex, a)] (AExpr a) 
AExternal a String 

Instances

Instances details
Eq a => Eq (ARule a) Source # 
Instance details

Defined in Curry.FlatCurry.Annotated.Type

Methods

(==) :: ARule a -> ARule a -> Bool

(/=) :: ARule a -> ARule a -> Bool

Read a => Read (ARule a) Source # 
Instance details

Defined in Curry.FlatCurry.Annotated.Type

Methods

readsPrec :: Int -> ReadS (ARule a)

readList :: ReadS [ARule a]

readPrec :: ReadPrec (ARule a)

readListPrec :: ReadPrec [ARule a]

Show a => Show (ARule a) Source # 
Instance details

Defined in Curry.FlatCurry.Annotated.Type

Methods

showsPrec :: Int -> ARule a -> ShowS

show :: ARule a -> String

showList :: [ARule a] -> ShowS

data AFuncDecl a Source #

Constructors

AFunc QName Int Visibility TypeExpr (ARule a) 

Instances

Instances details
Eq a => Eq (AFuncDecl a) Source # 
Instance details

Defined in Curry.FlatCurry.Annotated.Type

Methods

(==) :: AFuncDecl a -> AFuncDecl a -> Bool

(/=) :: AFuncDecl a -> AFuncDecl a -> Bool

Read a => Read (AFuncDecl a) Source # 
Instance details

Defined in Curry.FlatCurry.Annotated.Type

Methods

readsPrec :: Int -> ReadS (AFuncDecl a)

readList :: ReadS [AFuncDecl a]

readPrec :: ReadPrec (AFuncDecl a)

readListPrec :: ReadPrec [AFuncDecl a]

Show a => Show (AFuncDecl a) Source # 
Instance details

Defined in Curry.FlatCurry.Annotated.Type

Methods

showsPrec :: Int -> AFuncDecl a -> ShowS

show :: AFuncDecl a -> String

showList :: [AFuncDecl a] -> ShowS

data AProg a Source #

Constructors

AProg String [String] [TypeDecl] [AFuncDecl a] [OpDecl] 

Instances

Instances details
Eq a => Eq (AProg a) Source # 
Instance details

Defined in Curry.FlatCurry.Annotated.Type

Methods

(==) :: AProg a -> AProg a -> Bool

(/=) :: AProg a -> AProg a -> Bool

Read a => Read (AProg a) Source # 
Instance details

Defined in Curry.FlatCurry.Annotated.Type

Methods

readsPrec :: Int -> ReadS (AProg a)

readList :: ReadS [AProg a]

readPrec :: ReadPrec (AProg a)

readListPrec :: ReadPrec [AProg a]

Show a => Show (AProg a) Source # 
Instance details

Defined in Curry.FlatCurry.Annotated.Type

Methods

showsPrec :: Int -> AProg a -> ShowS

show :: AProg a -> String

showList :: [AProg a] -> ShowS

data CaseType Source #

Classification of case expressions, either flexible or rigid.

Constructors

Rigid 
Flex 

Instances

Instances details
Eq CaseType Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

(==) :: CaseType -> CaseType -> Bool

(/=) :: CaseType -> CaseType -> Bool

Read CaseType Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

readsPrec :: Int -> ReadS CaseType

readList :: ReadS [CaseType]

readPrec :: ReadPrec CaseType

readListPrec :: ReadPrec [CaseType]

Show CaseType Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

showsPrec :: Int -> CaseType -> ShowS

show :: CaseType -> String

showList :: [CaseType] -> ShowS

data CombType Source #

Data type for classifying combinations (i.e., a function/constructor applied to some arguments).

Constructors

FuncCall

a call to a function where all arguments are provided

ConsCall

a call with a constructor at the top, all arguments are provided

FuncPartCall Int

a partial call to a function (i.e., not all arguments are provided) where the parameter is the number of missing arguments

ConsPartCall Int

a partial call to a constructor along with number of missing arguments

Instances

Instances details
Eq CombType Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

(==) :: CombType -> CombType -> Bool

(/=) :: CombType -> CombType -> Bool

Read CombType Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

readsPrec :: Int -> ReadS CombType

readList :: ReadS [CombType]

readPrec :: ReadPrec CombType

readListPrec :: ReadPrec [CombType]

Show CombType Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

showsPrec :: Int -> CombType -> ShowS

show :: CombType -> String

showList :: [CombType] -> ShowS

data Literal Source #

Data type for representing literals.

A literal is either an integer, a float, or a character constant.

Note: The constructor definition of Intc differs from the original PAKCS definition. It uses Haskell type Integer instead of Int to provide an unlimited range of integer numbers. Furthermore, float values are represented with Haskell type Double instead of Float.

Constructors

Intc Integer 
Floatc Double 
Charc Char 

Instances

Instances details
Eq Literal Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

(==) :: Literal -> Literal -> Bool

(/=) :: Literal -> Literal -> Bool

Read Literal Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

readsPrec :: Int -> ReadS Literal

readList :: ReadS [Literal]

readPrec :: ReadPrec Literal

readListPrec :: ReadPrec [Literal]

Show Literal Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

showsPrec :: Int -> Literal -> ShowS

show :: Literal -> String

showList :: [Literal] -> ShowS

data Fixity Source #

Fixity of an operator.

Constructors

InfixOp

non-associative infix operator

InfixlOp

left-associative infix operator

InfixrOp

right-associative infix operator

Instances

Instances details
Eq Fixity Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

(==) :: Fixity -> Fixity -> Bool

(/=) :: Fixity -> Fixity -> Bool

Read Fixity Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

readsPrec :: Int -> ReadS Fixity

readList :: ReadS [Fixity]

readPrec :: ReadPrec Fixity

readListPrec :: ReadPrec [Fixity]

Show Fixity Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

showsPrec :: Int -> Fixity -> ShowS

show :: Fixity -> String

showList :: [Fixity] -> ShowS

data OpDecl Source #

Operator declarations.

An operator declaration fix p n in Curry corresponds to the FlatCurry term (Op n fix p).

Note: the constructor definition of Op differs from the original PAKCS definition using Haskell type Integer instead of Int for representing the precedence.

Constructors

Op QName Fixity Integer 

Instances

Instances details
Eq OpDecl Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

(==) :: OpDecl -> OpDecl -> Bool

(/=) :: OpDecl -> OpDecl -> Bool

Read OpDecl Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

readsPrec :: Int -> ReadS OpDecl

readList :: ReadS [OpDecl]

readPrec :: ReadPrec OpDecl

readListPrec :: ReadPrec [OpDecl]

Show OpDecl Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

showsPrec :: Int -> OpDecl -> ShowS

show :: OpDecl -> String

showList :: [OpDecl] -> ShowS

data TypeExpr Source #

Type expressions.

A type expression is either a type variable, a function type, or a type constructor application.

Note: the names of the predefined type constructors are Int, Float, Bool, Char, IO, Success, () (unit type), (,...,) (tuple types), [] (list type)

Constructors

TVar TVarIndex

type variable

FuncType TypeExpr TypeExpr

function type t1 -> t2

TCons QName [TypeExpr]

type constructor application

ForallType [TVarIndex] TypeExpr

forall type

Instances

Instances details
Eq TypeExpr Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

(==) :: TypeExpr -> TypeExpr -> Bool

(/=) :: TypeExpr -> TypeExpr -> Bool

Read TypeExpr Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

readsPrec :: Int -> ReadS TypeExpr

readList :: ReadS [TypeExpr]

readPrec :: ReadPrec TypeExpr

readListPrec :: ReadPrec [TypeExpr]

Show TypeExpr Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

showsPrec :: Int -> TypeExpr -> ShowS

show :: TypeExpr -> String

showList :: [TypeExpr] -> ShowS

Typeable TypeExpr Source # 
Instance details

Defined in Curry.FlatCurry.Typeable

data ConsDecl Source #

A constructor declaration consists of the name and arity of the constructor and a list of the argument types of the constructor.

Constructors

Cons QName Int Visibility [TypeExpr] 

Instances

Instances details
Eq ConsDecl Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

(==) :: ConsDecl -> ConsDecl -> Bool

(/=) :: ConsDecl -> ConsDecl -> Bool

Read ConsDecl Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

readsPrec :: Int -> ReadS ConsDecl

readList :: ReadS [ConsDecl]

readPrec :: ReadPrec ConsDecl

readListPrec :: ReadPrec [ConsDecl]

Show ConsDecl Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

showsPrec :: Int -> ConsDecl -> ShowS

show :: ConsDecl -> String

showList :: [ConsDecl] -> ShowS

type TVarIndex = Int Source #

Type variables are represented by (TVar i) where i is a type variable index.

data TypeDecl Source #

Declaration of algebraic data type or type synonym.

A data type declaration of the form

data t x1...xn = ...| c t1....tkc |...

is represented by the FlatCurry term

Type t [i1,...,in] [...(Cons c kc [t1,...,tkc])...]

where each ij is the index of the type variable xj

Note: The type variable indices are unique inside each type declaration and are usually numbered from 0.

Thus, a data type declaration consists of the name of the data type, a list of type parameters and a list of constructor declarations.

Instances

Instances details
Eq TypeDecl Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

(==) :: TypeDecl -> TypeDecl -> Bool

(/=) :: TypeDecl -> TypeDecl -> Bool

Read TypeDecl Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

readsPrec :: Int -> ReadS TypeDecl

readList :: ReadS [TypeDecl]

readPrec :: ReadPrec TypeDecl

readListPrec :: ReadPrec [TypeDecl]

Show TypeDecl Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

showsPrec :: Int -> TypeDecl -> ShowS

show :: TypeDecl -> String

showList :: [TypeDecl] -> ShowS

data Visibility Source #

Visibility of various entities.

Constructors

Public

public (exported) entity

Private

private entity

Instances

Instances details
Eq Visibility Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

(==) :: Visibility -> Visibility -> Bool

(/=) :: Visibility -> Visibility -> Bool

Read Visibility Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

readsPrec :: Int -> ReadS Visibility

readList :: ReadS [Visibility]

readPrec :: ReadPrec Visibility

readListPrec :: ReadPrec [Visibility]

Show Visibility Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

showsPrec :: Int -> Visibility -> ShowS

show :: Visibility -> String

showList :: [Visibility] -> ShowS

type VarIndex = Int Source #

Representation of variables.

type QName = (String, String) Source #

Qualified names.

In FlatCurry all names are qualified to avoid name clashes. The first component is the module name and the second component the unqualified name as it occurs in the source program.