ermine-0.6: Ermine

Copyright(c) Edward Kmett 2011
LicenseBSD3
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityexperimental
Portabilitynon-portable (DeriveDataTypeable)
Safe HaskellNone
LanguageHaskell2010

Ermine.Syntax.Global

Contents

Description

 

Synopsis

Globals

data Global Source

A Global is a full qualified top level name.

NB: You should construct these with global and only use the constructor for pattern matching.

Constructors

Global !ByteString !Fixity !ModuleName !Text 

class AsGlobal t where Source

Minimal complete definition

Nothing

Methods

_Global :: Prism' t Global Source

Instances

AsGlobal Global 
AsGlobal Id 
AsGlobal HardCore 
AsGlobal (Core t a) 
(~) (* -> *) f (Core t) => AsGlobal (Scope b f a) 

class HasGlobal t where Source

Minimal complete definition

global

Methods

global :: Lens' t Global Source

fixity :: Lens' t Fixity Source

A lens that will read or update the fixity (and compute a new digest)

Fixity

data Assoc Source

The associativity of an infix identifier

Constructors

L 
R 
N 

data Fixity Source

The fixity of an identifier

Constructors

Infix !Assoc !Int 
Prefix !Int 
Postfix !Int 
Idfix 

packFixity :: Fixity -> Word8 Source

Pack Fixity into a Word8.

Format:

 01234567
 ccaapppp

cc is constructor tag, 0-3 pppp is precedence level, 0-9 aa is associativity tag, 0-2

Combinators

glob :: AsGlobal t => Fixity -> ModuleName -> Text -> t Source

Construct a Global with a correct digest.