fay-0.12.0.0: A compiler for Fay, a Haskell subset that compiles to JavaScript.

Safe HaskellNone

Language.Fay.Prelude

Synopsis

Documentation

data Fay a Source

The JavaScript FFI interfacing monad.

Instances

Monad Fay 
Foreign a => Foreign (Fay a)

JS values are foreignable.

data Char

The character type Char is an enumeration whose values represent Unicode (or equivalently ISO/IEC 10646) characters (see http://www.unicode.org/ for details). This set extends the ISO 8859-1 (Latin-1) character set (the first 256 characters), which is itself an extension of the ASCII character set (the first 128 characters). A character literal in Haskell has type Char.

To convert a Char to or from the corresponding Int value defined by Unicode, use toEnum and fromEnum from the Enum class respectively (or equivalently ord and chr).

type String = [Char]

A String is a list of characters. String constants in Haskell are values of type String.

data Double

Double-precision floating point numbers. It is desirable that this type be at least equal in range and precision to the IEEE double-precision type.

data Int

A fixed-precision integer type with at least the range [-2^29 .. 2^29-1]. The exact range for a given implementation can be determined by using minBound and maxBound from the Bounded class.

class Show a

Conversion of values to readable Strings.

Minimal complete definition: showsPrec or show.

Derived instances of Show have the following properties, which are compatible with derived instances of Read:

  • The result of show is a syntactically correct Haskell expression containing only constants, given the fixity declarations in force at the point where the type is declared. It contains only the constructor names defined in the data type, parentheses, and spaces. When labelled constructor fields are used, braces, commas, field names, and equal signs are also used.
  • If the constructor is defined to be an infix operator, then showsPrec will produce infix applications of the constructor.
  • the representation will be enclosed in parentheses if the precedence of the top-level constructor in x is less than d (associativity is ignored). Thus, if d is 0 then the result is never surrounded in parentheses; if d is 11 it is always surrounded in parentheses, unless it is an atomic expression.
  • If the constructor is defined using record syntax, then show will produce the record-syntax form, with the fields given in the same order as the original declaration.

For example, given the declarations

 infixr 5 :^:
 data Tree a =  Leaf a  |  Tree a :^: Tree a

the derived instance of Show is equivalent to

 instance (Show a) => Show (Tree a) where

        showsPrec d (Leaf m) = showParen (d > app_prec) $
             showString "Leaf " . showsPrec (app_prec+1) m
          where app_prec = 10

        showsPrec d (u :^: v) = showParen (d > up_prec) $
             showsPrec (up_prec+1) u .
             showString " :^: "      .
             showsPrec (up_prec+1) v
          where up_prec = 5

Note that right-associativity of :^: is ignored. For example,

  • show (Leaf 1 :^: Leaf 2 :^: Leaf 3) produces the string "Leaf 1 :^: (Leaf 2 :^: Leaf 3)".

Instances

Show Bool 
Show Char 
Show Double 
Show Float 
Show Int 
Show Int8 
Show Int16 
Show Int32 
Show Int64 
Show Integer 
Show Ordering 
Show Word 
Show Word8 
Show Word16 
Show Word32 
Show Word64 
Show () 
Show ByteString 
Show Number 
Show Text 
Show UTCTime 
Show DotNetTime 
Show Value 
Show Handle 
Show ByteString 
Show More 
Show HandleType 
Show Number 
Show Version 
Show DataType 
Show Constr 
Show DataRep 
Show ConstrRep 
Show Fixity 
Show PatternMatchFail 
Show RecSelError 
Show RecConError 
Show RecUpdError 
Show NoMethodError 
Show NonTermination 
Show NestedAtomically 
Show BlockedIndefinitelyOnMVar 
Show BlockedIndefinitelyOnSTM 
Show Deadlock 
Show AssertionFailed 
Show AsyncException 
Show ArrayException 
Show ExitCode 
Show IOErrorType 
Show BufferMode 
Show Newline 
Show NewlineMode 
Show All 
Show Any 
Show GeneralCategory 
Show Lexeme 
Show MaskingState 
Show IOException 
Show SomeException 
Show ErrorCall 
Show ArithException 
Show TypeRep 
Show TyCon 
Show Text 
Show Permissions 
Show LexContext 
Show ExtContext 
Show Fixity 
Show ModuleName 
Show SpecialCon 
Show QName 
Show Name 
Show IPName 
Show QOp 
Show Op 
Show CName 
Show Module 
Show ExportSpec 
Show ImportDecl 
Show ImportSpec 
Show Assoc 
Show Decl 
Show Annotation 
Show DataOrNew 
Show Binds 
Show IPBind 
Show Match 
Show QualConDecl 
Show ConDecl 
Show GadtDecl 
Show ClassDecl 
Show InstDecl 
Show BangType 
Show Rhs 
Show GuardedRhs 
Show Type 
Show TyVarBind 
Show Kind 
Show FunDep 
Show Asst 
Show Literal 
Show Exp 
Show XName 
Show XAttr 
Show Bracket 
Show Splice 
Show Safety 
Show CallConv 
Show ModulePragma 
Show Activation 
Show Rule 
Show RuleVar 
Show WarningText 
Show Pat 
Show PXAttr 
Show RPatOp 
Show RPat 
Show PatField 
Show Stmt 
Show QualStmt 
Show FieldUpdate 
Show Alt 
Show GuardedAlts 
Show GuardedAlt 
Show Extension 
Show SrcLoc 
Show SrcSpan 
Show SrcSpanInfo 
Show Boxed 
Show Tool 
Show InfixOp 
Show AssignOp 
Show UnaryAssignOp 
Show PrefixOp 
Show SourcePos 
Show ParseError 
Show Value 
Show Padding 
Show DateFormatSpec 
Show LocalTime 
Show ZonedTime 
Show NominalDiffTime 
Show Day 
Show ModuleScope 
Show SerializeContext 
Show FundamentalType 
Show JsLit 
Show JsName 
Show JsExp 
Show JsStmt 
Show CompileError 
Show Mapping 
Show CompileReader 
Show CompileState 
Show CompileConfig 
Show a => Show [a] 
(Integral a, Show a) => Show (Ratio a) 
Show (Ptr a) 
Show (FunPtr a) 
Show a => Show (Maybe a) 
Show a => Show (Result a) 
Show (ForeignPtr a) 
Show a => Show (Dual a) 
Show a => Show (Sum a) 
Show a => Show (Product a) 
Show a => Show (First a) 
Show a => Show (Last a) 
Show a => Show (Set a) 
Show a => Show (ParseStatus a) 
Show l => Show (PExp l) 
Show l => Show (PFieldUpdate l) 
Show l => Show (ParseXAttr l) 
Show l => Show (PContext l) 
Show l => Show (PType l) 
Show l => Show (PAsst l) 
Show a => Show (ParseResult a) 
Show a => Show (Loc a) 
Show l => Show (ModuleName l) 
Show l => Show (SpecialCon l) 
Show l => Show (QName l) 
Show l => Show (Name l) 
Show l => Show (IPName l) 
Show l => Show (QOp l) 
Show l => Show (Op l) 
Show l => Show (CName l) 
Show l => Show (Module l) 
Show l => Show (ModuleHead l) 
Show l => Show (ExportSpecList l) 
Show l => Show (ExportSpec l) 
Show l => Show (ImportDecl l) 
Show l => Show (ImportSpecList l) 
Show l => Show (ImportSpec l) 
Show l => Show (Assoc l) 
Show l => Show (Decl l) 
Show l => Show (Annotation l) 
Show l => Show (DataOrNew l) 
Show l => Show (DeclHead l) 
Show l => Show (InstHead l) 
Show l => Show (Deriving l) 
Show l => Show (Binds l) 
Show l => Show (IPBind l) 
Show l => Show (Match l) 
Show l => Show (QualConDecl l) 
Show l => Show (ConDecl l) 
Show l => Show (FieldDecl l) 
Show l => Show (GadtDecl l) 
Show l => Show (ClassDecl l) 
Show l => Show (InstDecl l) 
Show l => Show (BangType l) 
Show l => Show (Rhs l) 
Show l => Show (GuardedRhs l) 
Show l => Show (Type l) 
Show l => Show (TyVarBind l) 
Show l => Show (Kind l) 
Show l => Show (FunDep l) 
Show l => Show (Context l) 
Show l => Show (Asst l) 
Show l => Show (Literal l) 
Show l => Show (Exp l) 
Show l => Show (XName l) 
Show l => Show (XAttr l) 
Show l => Show (Bracket l) 
Show l => Show (Splice l) 
Show l => Show (Safety l) 
Show l => Show (CallConv l) 
Show l => Show (ModulePragma l) 
Show l => Show (Activation l) 
Show l => Show (Rule l) 
Show l => Show (RuleVar l) 
Show l => Show (WarningText l) 
Show l => Show (Pat l) 
Show l => Show (PXAttr l) 
Show l => Show (RPatOp l) 
Show l => Show (RPat l) 
Show l => Show (PatField l) 
Show l => Show (Stmt l) 
Show l => Show (QualStmt l) 
Show l => Show (FieldUpdate l) 
Show l => Show (Alt l) 
Show l => Show (GuardedAlts l) 
Show l => Show (GuardedAlt l) 
Show a => Show (JavaScript a) 
Show a => Show (Id a) 
Show a => Show (Prop a) 
Show a => Show (LValue a) 
Show a => Show (Expression a) 
Show a => Show (CaseClause a) 
Show a => Show (CatchClause a) 
Show a => Show (VarDecl a) 
Show a => Show (ForInit a) 
Show a => Show (ForInInit a) 
Show a => Show (Statement a) 
Show a => Show (Vector a) 
(Show a, Unbox a) => Show (Vector a) 
(Show a, Show b) => Show (Either a b) 
(Show a, Show b) => Show (a, b) 
(Show k, Show v) => Show (HashMap k v) 
(Show k, Show a) => Show (Map k a) 
(Ix a, Show a, Show b) => Show (Array a b) 
(Show t, Show r) => Show (IResult t r) 
(Show a, Show b, Show c) => Show (a, b, c) 
(Show a, Show b, Show c, Show d) => Show (a, b, c, d) 
(Show a, Show b, Show c, Show d, Show e) => Show (a, b, c, d, e) 
(Show a, Show b, Show c, Show d, Show e, Show f) => Show (a, b, c, d, e, f) 
(Show a, Show b, Show c, Show d, Show e, Show f, Show g) => Show (a, b, c, d, e, f, g) 
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h) => Show (a, b, c, d, e, f, g, h) 
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i) => Show (a, b, c, d, e, f, g, h, i) 
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j) => Show (a, b, c, d, e, f, g, h, i, j) 
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k) => Show (a, b, c, d, e, f, g, h, i, j, k) 
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l) => Show (a, b, c, d, e, f, g, h, i, j, k, l) 
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m) 
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n) 
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) 

class Read a

Parsing of Strings, producing values.

Minimal complete definition: readsPrec (or, for GHC only, readPrec)

Derived instances of Read make the following assumptions, which derived instances of Show obey:

  • If the constructor is defined to be an infix operator, then the derived Read instance will parse only infix applications of the constructor (not the prefix form).
  • Associativity is not used to reduce the occurrence of parentheses, although precedence may be.
  • If the constructor is defined using record syntax, the derived Read will parse only the record-syntax form, and furthermore, the fields must be given in the same order as the original declaration.
  • The derived Read instance allows arbitrary Haskell whitespace between tokens of the input string. Extra parentheses are also allowed.

For example, given the declarations

 infixr 5 :^:
 data Tree a =  Leaf a  |  Tree a :^: Tree a

the derived instance of Read in Haskell 98 is equivalent to

 instance (Read a) => Read (Tree a) where

         readsPrec d r =  readParen (d > app_prec)
                          (\r -> [(Leaf m,t) |
                                  ("Leaf",s) <- lex r,
                                  (m,t) <- readsPrec (app_prec+1) s]) r

                       ++ readParen (d > up_prec)
                          (\r -> [(u:^:v,w) |
                                  (u,s) <- readsPrec (up_prec+1) r,
                                  (":^:",t) <- lex s,
                                  (v,w) <- readsPrec (up_prec+1) t]) r

           where app_prec = 10
                 up_prec = 5

Note that right-associativity of :^: is unused.

The derived instance in GHC is equivalent to

 instance (Read a) => Read (Tree a) where

         readPrec = parens $ (prec app_prec $ do
                                  Ident "Leaf" <- lexP
                                  m <- step readPrec
                                  return (Leaf m))

                      +++ (prec up_prec $ do
                                  u <- step readPrec
                                  Symbol ":^:" <- lexP
                                  v <- step readPrec
                                  return (u :^: v))

           where app_prec = 10
                 up_prec = 5

         readListPrec = readListPrecDefault

Instances

Read Bool 
Read Char 
Read Double 
Read Float 
Read Int 
Read Int8 
Read Int16 
Read Int32 
Read Int64 
Read Integer 
Read Ordering 
Read Word 
Read Word8 
Read Word16 
Read Word32 
Read Word64 
Read () 
Read ByteString 
Read Text 
Read UTCTime 
Read DotNetTime 
Read ByteString 
Read Version 
Read ExitCode 
Read BufferMode 
Read Newline 
Read NewlineMode 
Read All 
Read Any 
Read GeneralCategory 
Read Lexeme 
Read Text 
Read Permissions 
Read Extension 
Read LocalTime 
Read ZonedTime 
Read TimeOfDay 
Read TimeZone 
Read Day 
Read SerializeContext 
Read a => Read [a] 
(Integral a, Read a) => Read (Ratio a) 
Read a => Read (Maybe a) 
Read a => Read (Dual a) 
Read a => Read (Sum a) 
Read a => Read (Product a) 
Read a => Read (First a) 
Read a => Read (Last a) 
(Read a, Ord a) => Read (Set a) 
Read a => Read (Vector a) 
(Read a, Unbox a) => Read (Vector a) 
(Read a, Read b) => Read (Either a b) 
(Read a, Read b) => Read (a, b) 
(Ord k, Read k, Read e) => Read (Map k e) 
(Ix a, Read a, Read b) => Read (Array a b) 
(Read a, Read b, Read c) => Read (a, b, c) 
(Read a, Read b, Read c, Read d) => Read (a, b, c, d) 
(Read a, Read b, Read c, Read d, Read e) => Read (a, b, c, d, e) 
(Read a, Read b, Read c, Read d, Read e, Read f) => Read (a, b, c, d, e, f) 
(Read a, Read b, Read c, Read d, Read e, Read f, Read g) => Read (a, b, c, d, e, f, g) 
(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h) => Read (a, b, c, d, e, f, g, h) 
(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i) => Read (a, b, c, d, e, f, g, h, i) 
(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j) => Read (a, b, c, d, e, f, g, h, i, j) 
(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k) => Read (a, b, c, d, e, f, g, h, i, j, k) 
(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l) => Read (a, b, c, d, e, f, g, h, i, j, k, l) 
(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l, Read m) => Read (a, b, c, d, e, f, g, h, i, j, k, l, m) 
(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l, Read m, Read n) => Read (a, b, c, d, e, f, g, h, i, j, k, l, m, n) 
(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l, Read m, Read n, Read o) => Read (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) 

data Maybe a

The Maybe type encapsulates an optional value. A value of type Maybe a either contains a value of type a (represented as Just a), or it is empty (represented as Nothing). Using Maybe is a good way to deal with errors or exceptional cases without resorting to drastic measures such as error.

The Maybe type is also a monad. It is a simple kind of error monad, where all errors are represented by Nothing. A richer error monad can be built using the Either type.

Constructors

Nothing 
Just a 

Instances

Monad Maybe 
Functor Maybe 
Typeable1 Maybe 
MonadPlus Maybe 
Applicative Maybe 
Alternative Maybe 
Eq a => Eq (Maybe a) 
(Typeable (Maybe a), Data a) => Data (Maybe a) 
(Eq (Maybe a), Ord a) => Ord (Maybe a) 
Read a => Read (Maybe a) 
Show a => Show (Maybe a) 
ToJSON a => ToJSON (Maybe a) 
FromJSON a => FromJSON (Maybe a) 
Monoid a => Monoid (Maybe a)

Lift a semigroup into Maybe forming a Monoid according to http://en.wikipedia.org/wiki/Monoid: "Any semigroup S may be turned into a monoid simply by adjoining an element e not in S and defining e*e = e and e*s = s = s*e for all s ∈ S." Since there is no "Semigroup" typeclass providing just mappend, we use Monoid instead.

Default (Maybe a) 
Hashable a => Hashable (Maybe a) 
Foreign a => Foreign (Maybe a)

Maybes are pretty common.

class Typeable a where

The class Typeable allows a concrete representation of a type to be calculated.

Methods

typeOf :: a -> TypeRep

Takes a value of type a and returns a concrete representation of that type. The value of the argument should be ignored by any instance of Typeable, so that it is safe to pass undefined as the argument.

Instances

Typeable Bool 
Typeable Char 
Typeable Double 
Typeable Float 
Typeable Int 
Typeable Int8 
Typeable Int16 
Typeable Int32 
Typeable Int64 
Typeable Integer 
Typeable Ordering 
Typeable RealWorld 
Typeable Word 
Typeable Word8 
Typeable Word16 
Typeable Word32 
Typeable Word64 
Typeable () 
Typeable ByteString 
Typeable Number 
Typeable Text 
Typeable UTCTime 
Typeable DotNetTime 
Typeable Value 
Typeable Handle 
Typeable ByteString 
Typeable Handle__ 
Typeable Version 
Typeable DataType 
Typeable PatternMatchFail 
Typeable RecSelError 
Typeable RecConError 
Typeable RecUpdError 
Typeable NoMethodError 
Typeable NonTermination 
Typeable NestedAtomically 
Typeable BlockedIndefinitelyOnMVar 
Typeable BlockedIndefinitelyOnSTM 
Typeable Deadlock 
Typeable AssertionFailed 
Typeable AsyncException 
Typeable ArrayException 
Typeable ExitCode 
Typeable IOException 
Typeable SomeException 
Typeable ErrorCall 
Typeable ArithException 
Typeable TypeRep 
Typeable TyCon 
Typeable Text 
Typeable Fixity 
Typeable ModuleName 
Typeable SpecialCon 
Typeable QName 
Typeable Name 
Typeable IPName 
Typeable QOp 
Typeable Op 
Typeable CName 
Typeable Module 
Typeable ExportSpec 
Typeable ImportDecl 
Typeable ImportSpec 
Typeable Assoc 
Typeable Decl 
Typeable Annotation 
Typeable DataOrNew 
Typeable Binds 
Typeable IPBind 
Typeable Match 
Typeable QualConDecl 
Typeable ConDecl 
Typeable GadtDecl 
Typeable ClassDecl 
Typeable InstDecl 
Typeable BangType 
Typeable Rhs 
Typeable GuardedRhs 
Typeable Type 
Typeable TyVarBind 
Typeable Kind 
Typeable FunDep 
Typeable Asst 
Typeable Literal 
Typeable Exp 
Typeable XName 
Typeable XAttr 
Typeable Bracket 
Typeable Splice 
Typeable Safety 
Typeable CallConv 
Typeable ModulePragma 
Typeable Activation 
Typeable Rule 
Typeable RuleVar 
Typeable WarningText 
Typeable Pat 
Typeable PXAttr 
Typeable RPatOp 
Typeable RPat 
Typeable PatField 
Typeable Stmt 
Typeable QualStmt 
Typeable FieldUpdate 
Typeable Alt 
Typeable GuardedAlts 
Typeable GuardedAlt 
Typeable SrcLoc 
Typeable SrcSpan 
Typeable SrcSpanInfo 
Typeable Boxed 
Typeable Tool 
Typeable InfixOp 
Typeable AssignOp 
Typeable UnaryAssignOp 
Typeable PrefixOp 
Typeable SourcePos 
Typeable LocalTime 
Typeable ZonedTime 
Typeable NominalDiffTime 
Typeable Day 
(Typeable1 s, Typeable a) => Typeable (s a)

One Typeable instance for all Typeable1 instances

class Typeable a => Data a where

The Data class comprehends a fundamental primitive gfoldl for folding over constructor applications, say terms. This primitive can be instantiated in several ways to map over the immediate subterms of a term; see the gmap combinators later in this class. Indeed, a generic programmer does not necessarily need to use the ingenious gfoldl primitive but rather the intuitive gmap combinators. The gfoldl primitive is completed by means to query top-level constructors, to turn constructor representations into proper terms, and to list all possible datatype constructors. This completion allows us to serve generic programming scenarios like read, show, equality, term generation.

The combinators gmapT, gmapQ, gmapM, etc are all provided with default definitions in terms of gfoldl, leaving open the opportunity to provide datatype-specific definitions. (The inclusion of the gmap combinators as members of class Data allows the programmer or the compiler to derive specialised, and maybe more efficient code per datatype. Note: gfoldl is more higher-order than the gmap combinators. This is subject to ongoing benchmarking experiments. It might turn out that the gmap combinators will be moved out of the class Data.)

Conceptually, the definition of the gmap combinators in terms of the primitive gfoldl requires the identification of the gfoldl function arguments. Technically, we also need to identify the type constructor c for the construction of the result type from the folded term type.

In the definition of gmapQx combinators, we use phantom type constructors for the c in the type of gfoldl because the result type of a query does not involve the (polymorphic) type of the term argument. In the definition of gmapQl we simply use the plain constant type constructor because gfoldl is left-associative anyway and so it is readily suited to fold a left-associative binary operation over the immediate subterms. In the definition of gmapQr, extra effort is needed. We use a higher-order accumulation trick to mediate between left-associative constructor application vs. right-associative binary operation (e.g., (:)). When the query is meant to compute a value of type r, then the result type withing generic folding is r -> r. So the result of folding is a function to which we finally pass the right unit.

With the -XDeriveDataTypeable option, GHC can generate instances of the Data class automatically. For example, given the declaration

 data T a b = C1 a b | C2 deriving (Typeable, Data)

GHC will generate an instance that is equivalent to

 instance (Data a, Data b) => Data (T a b) where
     gfoldl k z (C1 a b) = z C1 `k` a `k` b
     gfoldl k z C2       = z C2

     gunfold k z c = case constrIndex c of
                         1 -> k (k (z C1))
                         2 -> z C2

     toConstr (C1 _ _) = con_C1
     toConstr C2       = con_C2

     dataTypeOf _ = ty_T

 con_C1 = mkConstr ty_T "C1" [] Prefix
 con_C2 = mkConstr ty_T "C2" [] Prefix
 ty_T   = mkDataType "Module.T" [con_C1, con_C2]

This is suitable for datatypes that are exported transparently.

Methods

gfoldl

Arguments

:: (forall d b. Data d => c (d -> b) -> d -> c b)

defines how nonempty constructor applications are folded. It takes the folded tail of the constructor application and its head, i.e., an immediate subterm, and combines them in some way.

-> (forall g. g -> c g)

defines how the empty constructor application is folded, like the neutral / start element for list folding.

-> a

structure to be folded.

-> c a

result, with a type defined in terms of a, but variability is achieved by means of type constructor c for the construction of the actual result type.

Left-associative fold operation for constructor applications.

The type of gfoldl is a headache, but operationally it is a simple generalisation of a list fold.

The default definition for gfoldl is const id, which is suitable for abstract datatypes with no substructures.

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c a

Unfolding constructor applications

toConstr :: a -> Constr

Obtaining the constructor from a given datum. For proper terms, this is meant to be the top-level constructor. Primitive datatypes are here viewed as potentially infinite sets of values (i.e., constructors).

dataTypeOf :: a -> DataType

The outer type constructor of the type

dataCast1 :: Typeable1 t => (forall d. Data d => c (t d)) -> Maybe (c a)

Mediate types and unary type constructors. In Data instances of the form T a, dataCast1 should be defined as gcast1.

The default definition is const Nothing, which is appropriate for non-unary type constructors.

dataCast2 :: Typeable2 t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a)

Mediate types and binary type constructors. In Data instances of the form T a b, dataCast2 should be defined as gcast2.

The default definition is const Nothing, which is appropriate for non-binary type constructors.

gmapT :: (forall b. Data b => b -> b) -> a -> a

A generic transformation that maps over the immediate subterms

The default definition instantiates the type constructor c in the type of gfoldl to an identity datatype constructor, using the isomorphism pair as injection and projection.

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r

A generic query with a left-associative binary operator

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r

A generic query with a right-associative binary operator

gmapQ :: (forall d. Data d => d -> u) -> a -> [u]

A generic query that processes the immediate subterms and returns a list of results. The list is given in the same order as originally specified in the declaratoin of the data constructors.

gmapQi :: Int -> (forall d. Data d => d -> u) -> a -> u

A generic query that processes one child by index (zero-based)

gmapM :: Monad m => (forall d. Data d => d -> m d) -> a -> m a

A generic monadic transformation that maps over the immediate subterms

The default definition instantiates the type constructor c in the type of gfoldl to the monad datatype constructor, defining injection and projection using return and >>=.

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> a -> m a

Transformation of at least one immediate subterm does not fail

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> a -> m a

Transformation of one immediate subterm with success

Instances

Data Bool 
Data Char 
Data Double 
Data Float 
Data Int 
Data Int8 
Data Int16 
Data Int32 
Data Int64 
Data Integer 
Data Ordering 
Data Word 
Data Word8 
Data Word16 
Data Word32 
Data Word64 
Data () 
Data ByteString 
Data Number 
Data Text 
Data UTCTime 
Data Handle 
Data ByteString 
Data DataType 
Data ThreadId 
Data TypeRep 
Data TyCon 
Data Text 
Data Fixity 
Data ModuleName 
Data SpecialCon 
Data QName 
Data Name 
Data IPName 
Data QOp 
Data Op 
Data CName 
Data Module 
Data ExportSpec 
Data ImportDecl 
Data ImportSpec 
Data Assoc 
Data Decl 
Data Annotation 
Data DataOrNew 
Data Binds 
Data IPBind 
Data Match 
Data QualConDecl 
Data ConDecl 
Data GadtDecl 
Data ClassDecl 
Data InstDecl 
Data BangType 
Data Rhs 
Data GuardedRhs 
Data Type 
Data TyVarBind 
Data Kind 
Data FunDep 
Data Asst 
Data Literal 
Data Exp 
Data XName 
Data XAttr 
Data Bracket 
Data Splice 
Data Safety 
Data CallConv 
Data ModulePragma 
Data Activation 
Data Rule 
Data RuleVar 
Data WarningText 
Data Pat 
Data PXAttr 
Data RPatOp 
Data RPat 
Data PatField 
Data Stmt 
Data QualStmt 
Data FieldUpdate 
Data Alt 
Data GuardedAlts 
Data GuardedAlt 
Data SrcLoc 
Data SrcSpan 
Data SrcSpanInfo 
Data Boxed 
Data Tool 
Data InfixOp 
Data AssignOp 
Data UnaryAssignOp 
Data PrefixOp 
Data SourcePos 
Data LocalTime 
Data ZonedTime 
Data NominalDiffTime 
Data Day 
(Typeable [a], Data a) => Data [a] 
(Typeable (Ratio a), Data a, Integral a) => Data (Ratio a) 
(Typeable (StablePtr a), Typeable a) => Data (StablePtr a) 
(Typeable (IO a), Typeable a) => Data (IO a) 
(Typeable (Ptr a), Typeable a) => Data (Ptr a) 
(Typeable (Maybe a), Data a) => Data (Maybe a) 
(Typeable (ForeignPtr a), Typeable a) => Data (ForeignPtr a) 
(Typeable (STM a), Typeable a) => Data (STM a) 
(Typeable (TVar a), Typeable a) => Data (TVar a) 
(Typeable (IORef a), Typeable a) => Data (IORef a) 
(Typeable (MVar a), Typeable a) => Data (MVar a) 
(Typeable (Set a), Data a, Ord a) => Data (Set a) 
(Typeable (ModuleName l), Data l) => Data (ModuleName l) 
(Typeable (SpecialCon l), Data l) => Data (SpecialCon l) 
(Typeable (QName l), Data l) => Data (QName l) 
(Typeable (Name l), Data l) => Data (Name l) 
(Typeable (IPName l), Data l) => Data (IPName l) 
(Typeable (QOp l), Data l) => Data (QOp l) 
(Typeable (Op l), Data l) => Data (Op l) 
(Typeable (CName l), Data l) => Data (CName l) 
(Typeable (Module l), Data l) => Data (Module l) 
(Typeable (ModuleHead l), Data l) => Data (ModuleHead l) 
(Typeable (ExportSpecList l), Data l) => Data (ExportSpecList l) 
(Typeable (ExportSpec l), Data l) => Data (ExportSpec l) 
(Typeable (ImportDecl l), Data l) => Data (ImportDecl l) 
(Typeable (ImportSpecList l), Data l) => Data (ImportSpecList l) 
(Typeable (ImportSpec l), Data l) => Data (ImportSpec l) 
(Typeable (Assoc l), Data l) => Data (Assoc l) 
(Typeable (Decl l), Data l) => Data (Decl l) 
(Typeable (Annotation l), Data l) => Data (Annotation l) 
(Typeable (DataOrNew l), Data l) => Data (DataOrNew l) 
(Typeable (DeclHead l), Data l) => Data (DeclHead l) 
(Typeable (InstHead l), Data l) => Data (InstHead l) 
(Typeable (Deriving l), Data l) => Data (Deriving l) 
(Typeable (Binds l), Data l) => Data (Binds l) 
(Typeable (IPBind l), Data l) => Data (IPBind l) 
(Typeable (Match l), Data l) => Data (Match l) 
(Typeable (QualConDecl l), Data l) => Data (QualConDecl l) 
(Typeable (ConDecl l), Data l) => Data (ConDecl l) 
(Typeable (FieldDecl l), Data l) => Data (FieldDecl l) 
(Typeable (GadtDecl l), Data l) => Data (GadtDecl l) 
(Typeable (ClassDecl l), Data l) => Data (ClassDecl l) 
(Typeable (InstDecl l), Data l) => Data (InstDecl l) 
(Typeable (BangType l), Data l) => Data (BangType l) 
(Typeable (Rhs l), Data l) => Data (Rhs l) 
(Typeable (GuardedRhs l), Data l) => Data (GuardedRhs l) 
(Typeable (Type l), Data l) => Data (Type l) 
(Typeable (TyVarBind l), Data l) => Data (TyVarBind l) 
(Typeable (Kind l), Data l) => Data (Kind l) 
(Typeable (FunDep l), Data l) => Data (FunDep l) 
(Typeable (Context l), Data l) => Data (Context l) 
(Typeable (Asst l), Data l) => Data (Asst l) 
(Typeable (Literal l), Data l) => Data (Literal l) 
(Typeable (Exp l), Data l) => Data (Exp l) 
(Typeable (XName l), Data l) => Data (XName l) 
(Typeable (XAttr l), Data l) => Data (XAttr l) 
(Typeable (Bracket l), Data l) => Data (Bracket l) 
(Typeable (Splice l), Data l) => Data (Splice l) 
(Typeable (Safety l), Data l) => Data (Safety l) 
(Typeable (CallConv l), Data l) => Data (CallConv l) 
(Typeable (ModulePragma l), Data l) => Data (ModulePragma l) 
(Typeable (Activation l), Data l) => Data (Activation l) 
(Typeable (Rule l), Data l) => Data (Rule l) 
(Typeable (RuleVar l), Data l) => Data (RuleVar l) 
(Typeable (WarningText l), Data l) => Data (WarningText l) 
(Typeable (Pat l), Data l) => Data (Pat l) 
(Typeable (PXAttr l), Data l) => Data (PXAttr l) 
(Typeable (RPatOp l), Data l) => Data (RPatOp l) 
(Typeable (RPat l), Data l) => Data (RPat l) 
(Typeable (PatField l), Data l) => Data (PatField l) 
(Typeable (Stmt l), Data l) => Data (Stmt l) 
(Typeable (QualStmt l), Data l) => Data (QualStmt l) 
(Typeable (FieldUpdate l), Data l) => Data (FieldUpdate l) 
(Typeable (Alt l), Data l) => Data (Alt l) 
(Typeable (GuardedAlts l), Data l) => Data (GuardedAlts l) 
(Typeable (GuardedAlt l), Data l) => Data (GuardedAlt l) 
(Typeable (JavaScript a), Data a) => Data (JavaScript a) 
(Typeable (Id a), Data a) => Data (Id a) 
(Typeable (Prop a), Data a) => Data (Prop a) 
(Typeable (LValue a), Data a) => Data (LValue a) 
(Typeable (Expression a), Data a) => Data (Expression a) 
(Typeable (CaseClause a), Data a) => Data (CaseClause a) 
(Typeable (CatchClause a), Data a) => Data (CatchClause a) 
(Typeable (VarDecl a), Data a) => Data (VarDecl a) 
(Typeable (ForInit a), Data a) => Data (ForInit a) 
(Typeable (ForInInit a), Data a) => Data (ForInInit a) 
(Typeable (Statement a), Data a) => Data (Statement a) 
(Typeable (Vector a), Data a) => Data (Vector a) 
(Typeable (Vector a), Data a, Unbox a) => Data (Vector a) 
(Typeable (a -> b), Data a, Data b) => Data (a -> b) 
(Typeable (Either a b), Data a, Data b) => Data (Either a b) 
(Typeable (a, b), Data a, Data b) => Data (a, b) 
(Typeable (HashMap k v), Data k, Data v, Eq k, Hashable k) => Data (HashMap k v) 
(Typeable (Map k a), Data k, Data a, Ord k) => Data (Map k a) 
(Typeable (ST s a), Typeable s, Typeable a) => Data (ST s a) 
(Typeable (Array a b), Typeable a, Data b, Ix a) => Data (Array a b) 
(Typeable (a, b, c), Data a, Data b, Data c) => Data (a, b, c) 
(Typeable (a, b, c, d), Data a, Data b, Data c, Data d) => Data (a, b, c, d) 
(Typeable (a, b, c, d, e), Data a, Data b, Data c, Data d, Data e) => Data (a, b, c, d, e) 
(Typeable (a, b, c, d, e, f), Data a, Data b, Data c, Data d, Data e, Data f) => Data (a, b, c, d, e, f) 
(Typeable (a, b, c, d, e, f, g), Data a, Data b, Data c, Data d, Data e, Data f, Data g) => Data (a, b, c, d, e, f, g) 

class Monad m

The Monad class defines the basic operations over a monad, a concept from a branch of mathematics known as category theory. From the perspective of a Haskell programmer, however, it is best to think of a monad as an abstract datatype of actions. Haskell's do expressions provide a convenient syntax for writing monadic expressions.

Minimal complete definition: >>= and return.

Instances of Monad should satisfy the following laws:

 return a >>= k  ==  k a
 m >>= return  ==  m
 m >>= (\x -> k x >>= h)  ==  (m >>= k) >>= h

Instances of both Monad and Functor should additionally satisfy the law:

 fmap f xs  ==  xs >>= return . f

The instances of Monad for lists, Maybe and IO defined in the Prelude satisfy these laws.

Instances

Monad [] 
Monad IO 
Monad Maybe 
Monad Result 
Monad Parser 
Monad P 
Monad ReadPrec 
Monad ReadP 
Monad P 
Monad ParseResult 
Monad Identity 
Monad Vector 
Monad Id 
Monad Box 
Monad Fay 
Monad Printer 
Monad Compile 
Monad ((->) r) 
Monad (Either e) 
Monad (Parser t) 
ArrowApply a => Monad (ArrowMonad a) 
Monad (DocM s) 
Monad (Lex r) 
Monad m => Monad (ListT m) 
Monad m => Monad (MaybeT m) 
Monad m => Monad (IdentityT m) 
Monad (ContT r m) 
(Monad m, Error e) => Monad (ErrorT e m) 
Monad m => Monad (ReaderT r m) 
Monad m => Monad (StateT s m) 
Monad m => Monad (StateT s m) 
(Monoid w, Monad m) => Monad (WriterT w m) 
(Monoid w, Monad m) => Monad (WriterT w m) 
Monad (ParsecT s u m) 
(Monoid w, Monad m) => Monad (RWST r w s m) 
(Monoid w, Monad m) => Monad (RWST r w s m) 

class Eq a where

The Eq class defines equality (==) and inequality (/=). All the basic datatypes exported by the Prelude are instances of Eq, and Eq may be derived for any datatype whose constituents are also instances of Eq.

Minimal complete definition: either == or /=.

Methods

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

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

Instances

Eq Bool 
Eq Char 
Eq Double 
Eq Float 
Eq Int 
Eq Int8 
Eq Int16 
Eq Int32 
Eq Int64 
Eq Integer 
Eq Ordering 
Eq Word 
Eq Word8 
Eq Word16 
Eq Word32 
Eq Word64 
Eq () 
Eq ByteString 
Eq Number 
Eq Text 
Eq UTCTime 
Eq DotNetTime 
Eq Value 
Eq Handle 
Eq ByteString 
Eq More 
Eq Finalizers 
Eq Number 
Eq Version 
Eq Constr

Equality of constructors

Eq DataRep 
Eq ConstrRep 
Eq Fixity 
Eq AsyncException 
Eq ArrayException 
Eq ExitCode 
Eq IOErrorType 
Eq BufferMode 
Eq Newline 
Eq NewlineMode 
Eq All 
Eq Any 
Eq GeneralCategory 
Eq Lexeme 
Eq MaskingState 
Eq IOException 
Eq ArithException 
Eq TypeRep 
Eq TyCon 
Eq Text 
Eq Permissions 
Eq LexContext 
Eq ExtContext 
Eq PPLayout 
Eq Fixity 
Eq ModuleName 
Eq SpecialCon 
Eq QName 
Eq Name 
Eq IPName 
Eq QOp 
Eq Op 
Eq CName 
Eq Module 
Eq ExportSpec 
Eq ImportDecl 
Eq ImportSpec 
Eq Assoc 
Eq Decl 
Eq Annotation 
Eq DataOrNew 
Eq Binds 
Eq IPBind 
Eq Match 
Eq QualConDecl 
Eq ConDecl 
Eq GadtDecl 
Eq ClassDecl 
Eq InstDecl 
Eq BangType 
Eq Rhs 
Eq GuardedRhs 
Eq Type 
Eq TyVarBind 
Eq Kind 
Eq FunDep 
Eq Asst 
Eq Literal 
Eq Exp 
Eq XName 
Eq XAttr 
Eq Bracket 
Eq Splice 
Eq Safety 
Eq CallConv 
Eq ModulePragma 
Eq Activation 
Eq Rule 
Eq RuleVar 
Eq WarningText 
Eq Pat 
Eq PXAttr 
Eq RPatOp 
Eq RPat 
Eq PatField 
Eq Stmt 
Eq QualStmt 
Eq FieldUpdate 
Eq Alt 
Eq GuardedAlts 
Eq GuardedAlt 
Eq Extension 
Eq SrcLoc 
Eq SrcSpan 
Eq SrcSpanInfo 
Eq Boxed 
Eq Tool 
Eq InfixOp 
Eq AssignOp 
Eq UnaryAssignOp 
Eq PrefixOp 
Eq SourcePos 
Eq Message 
Eq Value 
Eq LocalTime 
Eq NominalDiffTime 
Eq Day 
Eq SerializeContext 
Eq JsLit 
Eq JsName 
Eq JsExp 
Eq JsStmt 
Eq a => Eq [a] 
Eq a => Eq (Ratio a) 
Eq (StablePtr a) 
Eq (Ptr a) 
Eq (FunPtr a) 
Eq a => Eq (Maybe a) 
Eq a => Eq (Result a) 
Eq (ForeignPtr a) 
Eq a => Eq (Dual a) 
Eq a => Eq (Sum a) 
Eq a => Eq (Product a) 
Eq a => Eq (First a) 
Eq a => Eq (Last a) 
Eq (IORef a) 
Eq (MVar a) 
Eq a => Eq (Set a) 
Eq l => Eq (PExp l) 
Eq l => Eq (PFieldUpdate l) 
Eq l => Eq (ParseXAttr l) 
Eq l => Eq (PContext l) 
Eq l => Eq (PType l) 
Eq l => Eq (PAsst l) 
Eq a => Eq (Loc a) 
Eq l => Eq (ModuleName l) 
Eq l => Eq (SpecialCon l) 
Eq l => Eq (QName l) 
Eq l => Eq (Name l) 
Eq l => Eq (IPName l) 
Eq l => Eq (QOp l) 
Eq l => Eq (Op l) 
Eq l => Eq (CName l) 
Eq l => Eq (Module l) 
Eq l => Eq (ModuleHead l) 
Eq l => Eq (ExportSpecList l) 
Eq l => Eq (ExportSpec l) 
Eq l => Eq (ImportDecl l) 
Eq l => Eq (ImportSpecList l) 
Eq l => Eq (ImportSpec l) 
Eq l => Eq (Assoc l) 
Eq l => Eq (Decl l) 
Eq l => Eq (Annotation l) 
Eq l => Eq (DataOrNew l) 
Eq l => Eq (DeclHead l) 
Eq l => Eq (InstHead l) 
Eq l => Eq (Deriving l) 
Eq l => Eq (Binds l) 
Eq l => Eq (IPBind l) 
Eq l => Eq (Match l) 
Eq l => Eq (QualConDecl l) 
Eq l => Eq (ConDecl l) 
Eq l => Eq (FieldDecl l) 
Eq l => Eq (GadtDecl l) 
Eq l => Eq (ClassDecl l) 
Eq l => Eq (InstDecl l) 
Eq l => Eq (BangType l) 
Eq l => Eq (Rhs l) 
Eq l => Eq (GuardedRhs l) 
Eq l => Eq (Type l) 
Eq l => Eq (TyVarBind l) 
Eq l => Eq (Kind l) 
Eq l => Eq (FunDep l) 
Eq l => Eq (Context l) 
Eq l => Eq (Asst l) 
Eq l => Eq (Literal l) 
Eq l => Eq (Exp l) 
Eq l => Eq (XName l) 
Eq l => Eq (XAttr l) 
Eq l => Eq (Bracket l) 
Eq l => Eq (Splice l) 
Eq l => Eq (Safety l) 
Eq l => Eq (CallConv l) 
Eq l => Eq (ModulePragma l) 
Eq l => Eq (Activation l) 
Eq l => Eq (Rule l) 
Eq l => Eq (RuleVar l) 
Eq l => Eq (WarningText l) 
Eq l => Eq (Pat l) 
Eq l => Eq (PXAttr l) 
Eq l => Eq (RPatOp l) 
Eq l => Eq (RPat l) 
Eq l => Eq (PatField l) 
Eq l => Eq (Stmt l) 
Eq l => Eq (QualStmt l) 
Eq l => Eq (FieldUpdate l) 
Eq l => Eq (Alt l) 
Eq l => Eq (GuardedAlts l) 
Eq l => Eq (GuardedAlt l) 
Eq a => Eq (JavaScript a) 
Eq a => Eq (Id a) 
Eq a => Eq (Prop a) 
Eq a => Eq (LValue a) 
Eq a => Eq (Expression a) 
Eq a => Eq (CaseClause a) 
Eq a => Eq (CatchClause a) 
Eq a => Eq (VarDecl a) 
Eq a => Eq (ForInit a) 
Eq a => Eq (ForInInit a) 
Eq a => Eq (Statement a) 
Eq a => Eq (Vector a) 
(Unbox a, Eq a) => Eq (Vector a) 
(Eq a, Eq b) => Eq (Either a b) 
(Eq a, Eq b) => Eq (a, b) 
(Eq k, Eq v) => Eq (HashMap k v) 
(Eq k, Eq a) => Eq (Map k a) 
(Ix i, Eq e) => Eq (Array i e) 
(Eq k, Eq v) => Eq (Leaf k v) 
Eq a => Eq (Stream Id a) 
(Eq a, Eq b, Eq c) => Eq (a, b, c) 
Eq (STArray s i e) 
(Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d) 
(Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e) 
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f) => Eq (a, b, c, d, e, f) 
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g) => Eq (a, b, c, d, e, f, g) 
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h) => Eq (a, b, c, d, e, f, g, h) 
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i) => Eq (a, b, c, d, e, f, g, h, i) 
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j) => Eq (a, b, c, d, e, f, g, h, i, j) 
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k) => Eq (a, b, c, d, e, f, g, h, i, j, k) 
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l) => Eq (a, b, c, d, e, f, g, h, i, j, k, l) 
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m) 
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n) 
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n, Eq o) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) 

read :: Read a => String -> a

The read function reads input from a string, which must be completely consumed by the input process.

(>>) :: Fay a -> Fay b -> Fay bSource

(>>=) :: Fay a -> (a -> Fay b) -> Fay bSource

(+) :: Num a => a -> a -> a

(*) :: Num a => a -> a -> a

(-) :: Num a => a -> a -> a

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

(<) :: Ord a => a -> a -> Bool

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

(<=) :: Ord a => a -> a -> Bool

(/) :: Fractional a => a -> a -> a

fractional division

(||) :: Bool -> Bool -> Bool

Boolean "or"

(&&) :: Bool -> Bool -> Bool

Boolean "and"

return :: a -> Fay aSource

force :: a -> Bool -> Fay aSource

($) :: (t1 -> t) -> t1 -> tSource

($!) :: (a -> b) -> a -> bSource

(!!) :: [a] -> Int -> aSource

(++) :: [a] -> [a] -> [a]Source

(.) :: (t1 -> t) -> (t2 -> t1) -> t2 -> tSource

(=<<) :: Monad m => (a -> m b) -> m a -> m bSource

(^) :: Num a => a -> Int -> aSource

data Either a b Source

Constructors

Left a 
Right b 

data Ordering Source

Constructors

GT 
LT 
EQ 

abs :: (Num a, Ord a) => a -> aSource

all :: (a -> Bool) -> [a] -> BoolSource

any :: (a -> Bool) -> [a] -> BoolSource

asTypeOf :: a -> a -> aSource

break :: (a -> Bool) -> [a] -> ([a], [a])Source

compare :: Ord a => a -> a -> OrderingSource

concat :: [[a]] -> [a]Source

concatMap :: (a -> [b]) -> [a] -> [b]Source

const :: a -> b -> aSource

curry :: ((a, b) -> c) -> a -> b -> cSource

cycle :: [a] -> [a]Source

div :: Int -> Int -> IntSource

divMod :: Int -> Int -> (Int, Int)Source

drop :: Int -> [a] -> [a]Source

dropWhile :: (a -> Bool) -> [a] -> [a]Source

either :: (a -> c) -> (b -> c) -> Either a b -> cSource

elem :: Eq a => a -> [a] -> BoolSource

enumFrom :: Num a => a -> [a]Source

enumFromThen :: Num t => t -> t -> [t]Source

enumFromThenTo :: (Ord t, Num t) => t -> t -> t -> [t]Source

enumFromTo :: (Ord t, Num t) => t -> t -> [t]Source

filter :: (a -> Bool) -> [a] -> [a]Source

find :: (a -> Bool) -> [a] -> Maybe aSource

flip :: (t1 -> t2 -> t) -> t2 -> t1 -> tSource

foldl :: (t1 -> t -> t1) -> t1 -> [t] -> t1Source

foldl1 :: (a -> a -> a) -> [a] -> aSource

foldr :: (t -> t1 -> t1) -> t1 -> [t] -> t1Source

foldr1 :: (a -> a -> a) -> [a] -> aSource

forM_ :: Monad m => [t] -> (t -> m a) -> m ()Source

fst :: (t, t1) -> tSource

gcd :: Int -> Int -> IntSource

head :: [a] -> aSource

id :: a -> aSource

init :: [a] -> [a]Source

insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]Source

intercalate :: [a] -> [[a]] -> [a]Source

intersperse :: a -> [a] -> [a]Source

iterate :: (a -> a) -> a -> [a]Source

last :: [a] -> aSource

lcm :: Int -> Int -> IntSource

length :: [a] -> IntSource

lookup :: Eq a1 => a1 -> [(a1, a)] -> Maybe aSource

map :: (a -> b) -> [a] -> [b]Source

mapM_ :: Monad m => (a -> m b) -> [a] -> m ()Source

max :: (Num a, Foreign a) => a -> a -> aSource

maximum :: (Num a, Foreign a) => [a] -> aSource

maybe :: t -> (t1 -> t) -> Maybe t1 -> tSource

min :: (Num a, Foreign a) => a -> a -> aSource

minimum :: (Num a, Foreign a) => [a] -> aSource

mod :: Int -> Int -> IntSource

negate :: Num a => a -> aSource

notElem :: Eq a => a -> [a] -> BoolSource

nub :: Eq a => [a] -> [a]Source

null :: [t] -> BoolSource

pred :: Num a => a -> aSource

prependToAll :: a -> [a] -> [a]Source

product :: Num a => [a] -> aSource

rem :: Int -> Int -> IntSource

repeat :: a -> [a]Source

replicate :: Int -> a -> [a]Source

reverse :: [a] -> [a]Source

scanl :: (a -> b -> a) -> a -> [b] -> [a]Source

scanl1 :: (a -> a -> a) -> [a] -> [a]Source

scanr :: (a -> b -> b) -> b -> [a] -> [b]Source

scanr1 :: (a -> a -> a) -> [a] -> [a]Source

seq :: a -> b -> b

Evaluates its first argument to head normal form, and then returns its second argument as the result.

sequence :: Monad m => [m a] -> m [a]Source

Evaluate each action in the sequence from left to right, and collect the results. sequence :: [Fay a] -> Fay [a]

sequence_ :: Monad m => [m a] -> m ()Source

signum :: (Num a, Ord a) => a -> aSource

snd :: (t, t1) -> t1Source

sort :: Ord a => [a] -> [a]Source

sortBy :: (t -> t -> Ordering) -> [t] -> [t]Source

span :: (a -> Bool) -> [a] -> ([a], [a])Source

splitAt :: Int -> [a] -> ([a], [a])Source

subtract :: Num a => a -> a -> aSource

succ :: Num a => a -> aSource

sum :: Num a => [a] -> aSource

tail :: [a] -> [a]Source

take :: Int -> [a] -> [a]Source

takeWhile :: (a -> Bool) -> [a] -> [a]Source

uncurry :: (a -> b -> c) -> (a, b) -> cSource

until :: (a -> Bool) -> (a -> a) -> a -> aSource

unzip :: [(a, b)] -> ([a], [b])Source

unzip3 :: [(a, b, c)] -> ([a], [b], [c])Source

when :: Monad m => Bool -> m a -> m ()Source

zip :: [a] -> [b] -> [(a, b)]Source

zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]Source

zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]Source

zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]Source