curry-base-1.1.1: Functions for manipulating Curry programs

Copyright(c) 1999 - 2004 Wolfgang Lux
2005 Martin Engelke
2011 - 2015 Björn Peemöller
2014 Jan Rasmus Tikovsky
2016 Finn Teegen
LicenseBSD-3-clause
Maintainerbjp@informatik.uni-kiel.de
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Curry.Syntax.Type

Contents

Description

This module provides the necessary data structures to maintain the parsed representation of a Curry program.

Synopsis

Module header

data Module a Source #

Curry module

Instances
Functor Module Source # 
Instance details

Defined in Curry.Syntax.Type

Methods

fmap :: (a -> b) -> Module a -> Module b Source #

(<$) :: a -> Module b -> Module a Source #

Eq a => Eq (Module a) Source # 
Instance details

Defined in Curry.Syntax.Type

Methods

(==) :: Module a -> Module a -> Bool Source #

(/=) :: Module a -> Module a -> Bool Source #

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

Defined in Curry.Syntax.Type

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

Defined in Curry.Syntax.Type

HasPosition (Module a) Source # 
Instance details

Defined in Curry.Syntax.Type

HasSpanInfo (Module a) Source # 
Instance details

Defined in Curry.Syntax.Type

Module pragmas

data Extension Source #

Specified language extensions, either known or unknown.

Constructors

KnownExtension Position KnownExtension

a known extension

UnknownExtension Position String

an unknown extension

data KnownExtension Source #

Known language extensions of Curry.

Constructors

AnonFreeVars

anonymous free variables

CPP

C preprocessor

FunctionalPatterns

functional patterns

NegativeLiterals

negative literals

NoImplicitPrelude

no implicit import of the prelude

data Tool Source #

Different Curry tools which may accept compiler options.

Instances
Eq Tool Source # 
Instance details

Defined in Curry.Syntax.Extension

Methods

(==) :: Tool -> Tool -> Bool Source #

(/=) :: Tool -> Tool -> Bool Source #

Read Tool Source # 
Instance details

Defined in Curry.Syntax.Extension

Show Tool Source # 
Instance details

Defined in Curry.Syntax.Extension

Export specification

Import declarations

type Qualified = Bool Source #

Flag to signal qualified import

Interface

data Interface Source #

Module interface

Interface declarations are restricted to type declarations and signatures. Note that an interface function declaration additionaly contains the function arity (= number of parameters) in order to generate correct FlatCurry function applications.

type Arity = Int Source #

Arity of a function

type IMethodImpl = (Ident, Arity) Source #

Class method implementations

Declarations

data Decl a Source #

Declaration in a module

Instances
Functor Decl Source # 
Instance details

Defined in Curry.Syntax.Type

Methods

fmap :: (a -> b) -> Decl a -> Decl b Source #

(<$) :: a -> Decl b -> Decl a Source #

Eq a => Eq (Decl a) Source # 
Instance details

Defined in Curry.Syntax.Type

Methods

(==) :: Decl a -> Decl a -> Bool Source #

(/=) :: Decl a -> Decl a -> Bool Source #

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

Defined in Curry.Syntax.Type

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

Defined in Curry.Syntax.Type

Methods

showsPrec :: Int -> Decl a -> ShowS Source #

show :: Decl a -> String Source #

showList :: [Decl a] -> ShowS Source #

HasPosition (Decl a) Source # 
Instance details

Defined in Curry.Syntax.Type

HasSpanInfo (Decl a) Source # 
Instance details

Defined in Curry.Syntax.Type

type Precedence = Integer Source #

Operator precedence

data Infix Source #

Fixity of operators

Constructors

InfixL

left-associative

InfixR

right-associative

Infix

no associativity

Instances
Eq Infix Source # 
Instance details

Defined in Curry.Syntax.Type

Methods

(==) :: Infix -> Infix -> Bool Source #

(/=) :: Infix -> Infix -> Bool Source #

Read Infix Source # 
Instance details

Defined in Curry.Syntax.Type

Show Infix Source # 
Instance details

Defined in Curry.Syntax.Type

Pretty Infix Source # 
Instance details

Defined in Curry.Syntax.Type

data Equation a Source #

Function defining equation

Constructors

Equation SpanInfo (Lhs a) (Rhs a) 
Instances
Functor Equation Source # 
Instance details

Defined in Curry.Syntax.Type

Methods

fmap :: (a -> b) -> Equation a -> Equation b Source #

(<$) :: a -> Equation b -> Equation a Source #

Eq a => Eq (Equation a) Source # 
Instance details

Defined in Curry.Syntax.Type

Methods

(==) :: Equation a -> Equation a -> Bool Source #

(/=) :: Equation a -> Equation a -> Bool Source #

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

Defined in Curry.Syntax.Type

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

Defined in Curry.Syntax.Type

HasPosition (Equation a) Source # 
Instance details

Defined in Curry.Syntax.Type

HasSpanInfo (Equation a) Source # 
Instance details

Defined in Curry.Syntax.Type

data Lhs a Source #

Left-hand-side of an Equation (function identifier and patterns)

Instances
Functor Lhs Source # 
Instance details

Defined in Curry.Syntax.Type

Methods

fmap :: (a -> b) -> Lhs a -> Lhs b Source #

(<$) :: a -> Lhs b -> Lhs a Source #

Eq a => Eq (Lhs a) Source # 
Instance details

Defined in Curry.Syntax.Type

Methods

(==) :: Lhs a -> Lhs a -> Bool Source #

(/=) :: Lhs a -> Lhs a -> Bool Source #

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

Defined in Curry.Syntax.Type

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

Defined in Curry.Syntax.Type

Methods

showsPrec :: Int -> Lhs a -> ShowS Source #

show :: Lhs a -> String Source #

showList :: [Lhs a] -> ShowS Source #

HasPosition (Lhs a) Source # 
Instance details

Defined in Curry.Syntax.Type

HasSpanInfo (Lhs a) Source # 
Instance details

Defined in Curry.Syntax.Type

data Rhs a Source #

Right-hand-side of an Equation

Instances
Functor Rhs Source # 
Instance details

Defined in Curry.Syntax.Type

Methods

fmap :: (a -> b) -> Rhs a -> Rhs b Source #

(<$) :: a -> Rhs b -> Rhs a Source #

Eq a => Eq (Rhs a) Source # 
Instance details

Defined in Curry.Syntax.Type

Methods

(==) :: Rhs a -> Rhs a -> Bool Source #

(/=) :: Rhs a -> Rhs a -> Bool Source #

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

Defined in Curry.Syntax.Type

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

Defined in Curry.Syntax.Type

Methods

showsPrec :: Int -> Rhs a -> ShowS Source #

show :: Rhs a -> String Source #

showList :: [Rhs a] -> ShowS Source #

HasPosition (Rhs a) Source # 
Instance details

Defined in Curry.Syntax.Type

HasSpanInfo (Rhs a) Source # 
Instance details

Defined in Curry.Syntax.Type

data CondExpr a Source #

Conditional expression (expression conditioned by a guard)

Constructors

CondExpr SpanInfo (Expression a) (Expression a) 
Instances
Functor CondExpr Source # 
Instance details

Defined in Curry.Syntax.Type

Methods

fmap :: (a -> b) -> CondExpr a -> CondExpr b Source #

(<$) :: a -> CondExpr b -> CondExpr a Source #

Eq a => Eq (CondExpr a) Source # 
Instance details

Defined in Curry.Syntax.Type

Methods

(==) :: CondExpr a -> CondExpr a -> Bool Source #

(/=) :: CondExpr a -> CondExpr a -> Bool Source #

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

Defined in Curry.Syntax.Type

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

Defined in Curry.Syntax.Type

HasPosition (CondExpr a) Source # 
Instance details

Defined in Curry.Syntax.Type

HasSpanInfo (CondExpr a) Source # 
Instance details

Defined in Curry.Syntax.Type

data Pattern a Source #

Constructor term (used for patterns)

Instances
Functor Pattern Source # 
Instance details

Defined in Curry.Syntax.Type

Methods

fmap :: (a -> b) -> Pattern a -> Pattern b Source #

(<$) :: a -> Pattern b -> Pattern a Source #

Eq a => Eq (Pattern a) Source # 
Instance details

Defined in Curry.Syntax.Type

Methods

(==) :: Pattern a -> Pattern a -> Bool Source #

(/=) :: Pattern a -> Pattern a -> Bool Source #

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

Defined in Curry.Syntax.Type

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

Defined in Curry.Syntax.Type

HasPosition (Pattern a) Source # 
Instance details

Defined in Curry.Syntax.Type

HasSpanInfo (Pattern a) Source # 
Instance details

Defined in Curry.Syntax.Type

data Expression a Source #

Expression

data InfixOp a Source #

Infix operation

Instances
Functor InfixOp Source # 
Instance details

Defined in Curry.Syntax.Type

Methods

fmap :: (a -> b) -> InfixOp a -> InfixOp b Source #

(<$) :: a -> InfixOp b -> InfixOp a Source #

Eq a => Eq (InfixOp a) Source # 
Instance details

Defined in Curry.Syntax.Type

Methods

(==) :: InfixOp a -> InfixOp a -> Bool Source #

(/=) :: InfixOp a -> InfixOp a -> Bool Source #

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

Defined in Curry.Syntax.Type

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

Defined in Curry.Syntax.Type

HasPosition (InfixOp a) Source # 
Instance details

Defined in Curry.Syntax.Type

data Statement a Source #

Statement (used for do-sequence and list comprehensions)

Instances
Functor Statement Source # 
Instance details

Defined in Curry.Syntax.Type

Methods

fmap :: (a -> b) -> Statement a -> Statement b Source #

(<$) :: a -> Statement b -> Statement a Source #

Eq a => Eq (Statement a) Source # 
Instance details

Defined in Curry.Syntax.Type

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

Defined in Curry.Syntax.Type

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

Defined in Curry.Syntax.Type

HasPosition (Statement a) Source # 
Instance details

Defined in Curry.Syntax.Type

HasSpanInfo (Statement a) Source # 
Instance details

Defined in Curry.Syntax.Type

data CaseType Source #

Type of case expressions

Constructors

Rigid 
Flex 

data Alt a Source #

Single case alternative

Constructors

Alt SpanInfo (Pattern a) (Rhs a) 
Instances
Functor Alt Source # 
Instance details

Defined in Curry.Syntax.Type

Methods

fmap :: (a -> b) -> Alt a -> Alt b Source #

(<$) :: a -> Alt b -> Alt a Source #

Eq a => Eq (Alt a) Source # 
Instance details

Defined in Curry.Syntax.Type

Methods

(==) :: Alt a -> Alt a -> Bool Source #

(/=) :: Alt a -> Alt a -> Bool Source #

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

Defined in Curry.Syntax.Type

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

Defined in Curry.Syntax.Type

Methods

showsPrec :: Int -> Alt a -> ShowS Source #

show :: Alt a -> String Source #

showList :: [Alt a] -> ShowS Source #

HasPosition (Alt a) Source # 
Instance details

Defined in Curry.Syntax.Type

HasSpanInfo (Alt a) Source # 
Instance details

Defined in Curry.Syntax.Type

data Field a Source #

Record field

Constructors

Field SpanInfo QualIdent a 
Instances
Functor Field Source # 
Instance details

Defined in Curry.Syntax.Type

Methods

fmap :: (a -> b) -> Field a -> Field b Source #

(<$) :: a -> Field b -> Field a Source #

Eq a => Eq (Field a) Source # 
Instance details

Defined in Curry.Syntax.Type

Methods

(==) :: Field a -> Field a -> Bool Source #

(/=) :: Field a -> Field a -> Bool Source #

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

Defined in Curry.Syntax.Type

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

Defined in Curry.Syntax.Type

HasPosition (Field a) Source # 
Instance details

Defined in Curry.Syntax.Type

HasSpanInfo (Field a) Source # 
Instance details

Defined in Curry.Syntax.Type

data Var a Source #

Annotated identifier

Constructors

Var a Ident 
Instances
Functor Var Source # 
Instance details

Defined in Curry.Syntax.Type

Methods

fmap :: (a -> b) -> Var a -> Var b Source #

(<$) :: a -> Var b -> Var a Source #

Eq a => Eq (Var a) Source # 
Instance details

Defined in Curry.Syntax.Type

Methods

(==) :: Var a -> Var a -> Bool Source #

(/=) :: Var a -> Var a -> Bool Source #

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

Defined in Curry.Syntax.Type

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

Defined in Curry.Syntax.Type

Methods

showsPrec :: Int -> Var a -> ShowS Source #

show :: Var a -> String Source #

showList :: [Var a] -> ShowS Source #

Type classes

Goals

data Goal a Source #

Goal in REPL (expression to evaluate)

Constructors

Goal SpanInfo (Expression a) [Decl a] 
Instances
Functor Goal Source # 
Instance details

Defined in Curry.Syntax.Type

Methods

fmap :: (a -> b) -> Goal a -> Goal b Source #

(<$) :: a -> Goal b -> Goal a Source #

Eq a => Eq (Goal a) Source # 
Instance details

Defined in Curry.Syntax.Type

Methods

(==) :: Goal a -> Goal a -> Bool Source #

(/=) :: Goal a -> Goal a -> Bool Source #

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

Defined in Curry.Syntax.Type

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

Defined in Curry.Syntax.Type

Methods

showsPrec :: Int -> Goal a -> ShowS Source #

show :: Goal a -> String Source #

showList :: [Goal a] -> ShowS Source #

HasPosition (Goal a) Source # 
Instance details

Defined in Curry.Syntax.Type

HasSpanInfo (Goal a) Source # 
Instance details

Defined in Curry.Syntax.Type