curry-frontend-2.0.0: Compile the functional logic language Curry to several intermediate formats

Copyright(c) 2016 - 2017 Finn Teegen
2018 Kai-Oliver Prott
LicenseBSD-3-clause
Maintainerfte@informatik.uni-kiel.de
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Curry.FlatCurry.Typed.Type

Description

This library contains a version of FlatCurry's abstract syntax tree modified with type information

For more information about the abstract syntax tree of FlatCurry, see the documentation of the respective module.

Synopsis

Documentation

data TRule Source #

Instances
Eq TRule Source # 
Instance details

Defined in Curry.FlatCurry.Typed.Type

Methods

(==) :: TRule -> TRule -> Bool #

(/=) :: TRule -> TRule -> Bool #

Read TRule Source # 
Instance details

Defined in Curry.FlatCurry.Typed.Type

Show TRule Source # 
Instance details

Defined in Curry.FlatCurry.Typed.Type

Methods

showsPrec :: Int -> TRule -> ShowS #

show :: TRule -> String #

showList :: [TRule] -> ShowS #

Binary TRule Source # 
Instance details

Defined in Curry.FlatCurry.Typed.Type

Methods

put :: TRule -> Put #

get :: Get TRule #

putList :: [TRule] -> Put #

Typeable TRule Source # 
Instance details

Defined in Curry.FlatCurry.Typed.Type

data TProg Source #

Constructors

TProg String [String] [TypeDecl] [TFuncDecl] [OpDecl] 
Instances
Eq TProg Source # 
Instance details

Defined in Curry.FlatCurry.Typed.Type

Methods

(==) :: TProg -> TProg -> Bool #

(/=) :: TProg -> TProg -> Bool #

Read TProg Source # 
Instance details

Defined in Curry.FlatCurry.Typed.Type

Show TProg Source # 
Instance details

Defined in Curry.FlatCurry.Typed.Type

Methods

showsPrec :: Int -> TProg -> ShowS #

show :: TProg -> String #

showList :: [TProg] -> ShowS #

Binary TProg Source # 
Instance details

Defined in Curry.FlatCurry.Typed.Type

Methods

put :: TProg -> Put #

get :: Get TProg #

putList :: [TProg] -> Put #

data CaseType Source #

Classification of case expressions, either flexible or rigid.

Constructors

Rigid 
Flex 
Instances
Eq CaseType Source # 
Instance details

Defined in Curry.FlatCurry.Type

Read CaseType Source # 
Instance details

Defined in Curry.FlatCurry.Type

Show CaseType Source # 
Instance details

Defined in Curry.FlatCurry.Type

Binary CaseType Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

put :: CaseType -> Put #

get :: Get CaseType #

putList :: [CaseType] -> Put #

Pretty CaseType Source # 
Instance details

Defined in Curry.FlatCurry.Pretty

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
Eq CombType Source # 
Instance details

Defined in Curry.FlatCurry.Type

Read CombType Source # 
Instance details

Defined in Curry.FlatCurry.Type

Show CombType Source # 
Instance details

Defined in Curry.FlatCurry.Type

Binary CombType Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

put :: CombType -> Put #

get :: Get CombType #

putList :: [CombType] -> Put #

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.

Instances
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

Show Literal Source # 
Instance details

Defined in Curry.FlatCurry.Type

Binary Literal Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

put :: Literal -> Put #

get :: Get Literal #

putList :: [Literal] -> Put #

Pretty Literal Source # 
Instance details

Defined in Curry.FlatCurry.Pretty

data Fixity Source #

Fixity of an operator.

Constructors

InfixOp

non-associative infix operator

InfixlOp

left-associative infix operator

InfixrOp

right-associative infix operator

Instances
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

Show Fixity Source # 
Instance details

Defined in Curry.FlatCurry.Type

Binary Fixity Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

put :: Fixity -> Put #

get :: Get Fixity #

putList :: [Fixity] -> Put #

Pretty Fixity Source # 
Instance details

Defined in Curry.FlatCurry.Pretty

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
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

Show OpDecl Source # 
Instance details

Defined in Curry.FlatCurry.Type

Binary OpDecl Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

put :: OpDecl -> Put #

get :: Get OpDecl #

putList :: [OpDecl] -> Put #

Pretty OpDecl Source # 
Instance details

Defined in Curry.FlatCurry.Pretty

data Kind Source #

Kinds.

A kind is either * or k_1 -> k_2 where k_1 and k_2 are kinds.

Constructors

KStar

star kind

KArrow Kind Kind

arrow kind

Instances
Eq Kind Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

(==) :: Kind -> Kind -> Bool #

(/=) :: Kind -> Kind -> Bool #

Ord Kind Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

compare :: Kind -> Kind -> Ordering #

(<) :: Kind -> Kind -> Bool #

(<=) :: Kind -> Kind -> Bool #

(>) :: Kind -> Kind -> Bool #

(>=) :: Kind -> Kind -> Bool #

max :: Kind -> Kind -> Kind #

min :: Kind -> Kind -> Kind #

Read Kind Source # 
Instance details

Defined in Curry.FlatCurry.Type

Show Kind Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

showsPrec :: Int -> Kind -> ShowS #

show :: Kind -> String #

showList :: [Kind] -> ShowS #

Binary Kind Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

put :: Kind -> Put #

get :: Get Kind #

putList :: [Kind] -> Put #

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 [TVarWithKind] TypeExpr

forall type

Instances
Eq TypeExpr Source # 
Instance details

Defined in Curry.FlatCurry.Type

Read TypeExpr Source # 
Instance details

Defined in Curry.FlatCurry.Type

Show TypeExpr Source # 
Instance details

Defined in Curry.FlatCurry.Type

Binary TypeExpr Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

put :: TypeExpr -> Put #

get :: Get TypeExpr #

putList :: [TypeExpr] -> Put #

Pretty TypeExpr Source # 
Instance details

Defined in Curry.FlatCurry.Pretty

Typeable TypeExpr Source # 
Instance details

Defined in Curry.FlatCurry.Typeable

data NewConsDecl Source #

A constructor declaration for a newtype consists of the name of the constructor and the argument type of the constructor.

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
Eq ConsDecl Source # 
Instance details

Defined in Curry.FlatCurry.Type

Read ConsDecl Source # 
Instance details

Defined in Curry.FlatCurry.Type

Show ConsDecl Source # 
Instance details

Defined in Curry.FlatCurry.Type

Binary ConsDecl Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

put :: ConsDecl -> Put #

get :: Get ConsDecl #

putList :: [ConsDecl] -> Put #

Pretty ConsDecl Source # 
Instance details

Defined in Curry.FlatCurry.Pretty

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
Eq TypeDecl Source # 
Instance details

Defined in Curry.FlatCurry.Type

Read TypeDecl Source # 
Instance details

Defined in Curry.FlatCurry.Type

Show TypeDecl Source # 
Instance details

Defined in Curry.FlatCurry.Type

Binary TypeDecl Source # 
Instance details

Defined in Curry.FlatCurry.Type

Methods

put :: TypeDecl -> Put #

get :: Get TypeDecl #

putList :: [TypeDecl] -> Put #

Pretty TypeDecl Source # 
Instance details

Defined in Curry.FlatCurry.Pretty

data Visibility Source #

Visibility of various entities.

Constructors

Public

public (exported) entity

Private

private entity

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.