Spec-Zone.ru › Haskell 8

10. GHC Language Features

  • 10.1. Language options
  • 10.2. Unboxed types and primitive operations
    • 10.2.1. Unboxed types
    • 10.2.2. Unboxed type kinds
    • 10.2.3. Unboxed tuples
    • 10.2.4. Unboxed sums
    • 10.2.5. Unlifted Newtypes
  • 10.3. Syntactic extensions
    • 10.3.1. Unicode syntax
    • 10.3.2. The magic hash
    • 10.3.3. Negative literals
    • 10.3.4. Fractional looking integer literals
    • 10.3.5. Binary integer literals
    • 10.3.6. Hexadecimal floating point literals
    • 10.3.7. Numeric underscores
    • 10.3.8. Pattern guards
    • 10.3.9. View patterns
    • 10.3.10. n+k patterns
    • 10.3.11. The recursive do-notation
      • 10.3.11.1. Recursive binding groups
      • 10.3.11.2. The mdo notation
    • 10.3.12. Applicative do-notation
      • 10.3.12.1. Strict patterns
      • 10.3.12.2. Things to watch out for
    • 10.3.13. Parallel List Comprehensions
    • 10.3.14. Generalised (SQL-like) List Comprehensions
    • 10.3.15. Monad comprehensions
    • 10.3.16. New monadic failure desugaring mechanism
    • 10.3.17. Rebindable syntax and the implicit Prelude import
      • 10.3.17.1. Things unaffected by RebindableSyntax
    • 10.3.18. Postfix operators
    • 10.3.19. Tuple sections
    • 10.3.20. Lambda-case
    • 10.3.21. Empty case alternatives
    • 10.3.22. Multi-way if-expressions
    • 10.3.23. Local Fixity Declarations
    • 10.3.24. Import and export extensions
      • 10.3.24.1. Hiding things the imported module doesn’t export
      • 10.3.24.2. Package-qualified imports
      • 10.3.24.3. Safe imports
      • 10.3.24.4. Explicit namespaces in import/export
      • 10.3.24.5. Writing qualified in postpositive position
    • 10.3.25. More liberal syntax for function arguments
      • 10.3.25.1. Changes to the grammar
    • 10.3.26. Summary of stolen syntax
  • 10.4. Extensions to data types and type synonyms
    • 10.4.1. Data types with no constructors
    • 10.4.2. Data type contexts
    • 10.4.3. Infix type constructors, classes, and type variables
    • 10.4.4. Type operators
    • 10.4.5. Liberalised type synonyms
    • 10.4.6. Existentially quantified data constructors
      • 10.4.6.1. Why existential?
      • 10.4.6.2. Existentials and type classes
      • 10.4.6.3. Record Constructors
      • 10.4.6.4. Restrictions
    • 10.4.7. Declaring data types with explicit constructor signatures
    • 10.4.8. Generalised Algebraic Data Types (GADTs)
  • 10.5. Extensions to the record system
    • 10.5.1. Traditional record syntax
    • 10.5.2. Record field disambiguation
    • 10.5.3. Duplicate record fields
      • 10.5.3.1. Selector functions
      • 10.5.3.2. Record updates
      • 10.5.3.3. Import and export of record fields
    • 10.5.4. Record puns
    • 10.5.5. Record wildcards
    • 10.5.6. Record field selector polymorphism
      • 10.5.6.1. Solving HasField constraints
      • 10.5.6.2. Virtual record fields
  • 10.6. Extensions to the “deriving” mechanism
    • 10.6.1. Deriving instances for empty data types
    • 10.6.2. Inferred context for deriving clauses
    • 10.6.3. Stand-alone deriving declarations
    • 10.6.4. Deriving instances of extra classes (Data, etc.)
      • 10.6.4.1. Deriving Functor instances
      • 10.6.4.2. Deriving Foldable instances
      • 10.6.4.3. Deriving Traversable instances
      • 10.6.4.4. Deriving Data instances
      • 10.6.4.5. Deriving Typeable instances
      • 10.6.4.6. Deriving Lift instances
    • 10.6.5. Generalised derived instances for newtypes
      • 10.6.5.1. Generalising the deriving clause
      • 10.6.5.2. A more precise specification
      • 10.6.5.3. Associated type families
    • 10.6.6. Deriving any other class
    • 10.6.7. Deriving strategies
      • 10.6.7.1. Default deriving strategy
    • 10.6.8. Deriving via
  • 10.7. Pattern synonyms
    • 10.7.1. Record Pattern Synonyms
    • 10.7.2. Syntax and scoping of pattern synonyms
    • 10.7.3. Import and export of pattern synonyms
    • 10.7.4. Typing of pattern synonyms
    • 10.7.5. Matching of pattern synonyms
  • 10.8. Class and instances declarations
    • 10.8.1. Class declarations
      • 10.8.1.1. Multi-parameter type classes
      • 10.8.1.2. The superclasses of a class declaration
      • 10.8.1.3. Constrained class method types
      • 10.8.1.4. Default method signatures
      • 10.8.1.5. Nullary type classes
    • 10.8.2. Functional dependencies
      • 10.8.2.1. Rules for functional dependencies
      • 10.8.2.2. Background on functional dependencies
        • 10.8.2.2.1. An attempt to use constructor classes
        • 10.8.2.2.2. Adding functional dependencies
    • 10.8.3. Instance declarations
      • 10.8.3.1. Instance resolution
      • 10.8.3.2. Relaxed rules for the instance head
      • 10.8.3.3. Relaxed rules for instance contexts
      • 10.8.3.4. Instance termination rules
      • 10.8.3.5. Undecidable instances
      • 10.8.3.6. Overlapping instances
      • 10.8.3.7. Instance signatures: type signatures in instance declarations
    • 10.8.4. Overloaded string literals
    • 10.8.5. Overloaded labels
    • 10.8.6. Overloaded lists
      • 10.8.6.1. The IsList class
      • 10.8.6.2. Rebindable syntax
      • 10.8.6.3. Defaulting
      • 10.8.6.4. Speculation about the future
    • 10.8.7. Undecidable (or recursive) superclasses
  • 10.9. Type families
    • 10.9.1. Data families
      • 10.9.1.1. Data family declarations
      • 10.9.1.2. Data instance declarations
      • 10.9.1.3. Overlap of data instances
    • 10.9.2. Synonym families
      • 10.9.2.1. Type family declarations
      • 10.9.2.2. Type instance declarations
      • 10.9.2.3. Closed type families
      • 10.9.2.4. Type family examples
      • 10.9.2.5. Compatibility and apartness of type family equations
      • 10.9.2.6. Decidability of type synonym instances
    • 10.9.3. Wildcards on the LHS of data and type family instances
    • 10.9.4. Associated data and type families
      • 10.9.4.1. Associated instances
      • 10.9.4.2. Associated type synonym defaults
      • 10.9.4.3. Scoping of class parameters
      • 10.9.4.4. Instance contexts and associated type and data instances
    • 10.9.5. Import and export
      • 10.9.5.1. Examples
      • 10.9.5.2. Instances
    • 10.9.6. Type families and instance declarations
    • 10.9.7. Injective type families
      • 10.9.7.1. Syntax of injectivity annotation
      • 10.9.7.2. Verifying the injectivity annotation against type family equations
  • 10.10. Datatype promotion
    • 10.10.1. Motivation
    • 10.10.2. Overview
    • 10.10.3. Distinguishing between types and constructors
    • 10.10.4. Promoted list and tuple types
    • 10.10.5. Promoting existential data constructors
  • 10.11. Kind polymorphism
    • 10.11.1. Overview of kind polymorphism
    • 10.11.2. Overview of Type-in-Type
    • 10.11.3. Principles of kind inference
    • 10.11.4. Inferring the order of variables in a type/class declaration
    • 10.11.5. Complete user-supplied kind signatures and polymorphic recursion
    • 10.11.6. Standalone kind signatures and polymorphic recursion
    • 10.11.7. Standalone kind signatures and declaration headers
    • 10.11.8. Kind inference in closed type families
    • 10.11.9. Kind inference in class instance declarations
    • 10.11.10. Kind inference in type signatures
    • 10.11.11. Explicit kind quantification
    • 10.11.12. Implicit quantification in type synonyms and type family instances
    • 10.11.13. Kind-indexed GADTs
    • 10.11.14. Higher-rank kinds
    • 10.11.15. Constraints in kinds
    • 10.11.16. The kind Type
    • 10.11.17. Inferring dependency in datatype declarations
    • 10.11.18. Inferring dependency in user-written foralls
    • 10.11.19. Kind defaulting without PolyKinds
    • 10.11.20. Pretty-printing in the presence of kind polymorphism
  • 10.12. Levity polymorphism
    • 10.12.1. No levity-polymorphic variables or arguments
    • 10.12.2. Levity-polymorphic bottoms
    • 10.12.3. Printing levity-polymorphic types
  • 10.13. Type-Level Literals
    • 10.13.1. Runtime Values for Type-Level Literals
    • 10.13.2. Computing With Type-Level Naturals
  • 10.14. Equality constraints, Coercible, and the kind Constraint
    • 10.14.1. Equality constraints
    • 10.14.2. Heterogeneous equality
    • 10.14.3. Unlifted heterogeneous equality
    • 10.14.4. The Coercible constraint
    • 10.14.5. The Constraint kind
  • 10.15. Quantified constraints
    • 10.15.1. Motivation
    • 10.15.2. Syntax changes
    • 10.15.3. Typing changes
    • 10.15.4. Superclasses
    • 10.15.5. Overlap
    • 10.15.6. Instance lookup
    • 10.15.7. Termination
    • 10.15.8. Coherence
  • 10.16. Extensions to type signatures
    • 10.16.1. Explicit universal quantification (forall)
    • 10.16.2. The context of a type signature
    • 10.16.3. Ambiguous types and the ambiguity check
    • 10.16.4. Explicitly-kinded quantification
  • 10.17. Lexically scoped type variables
    • 10.17.1. Overview
    • 10.17.2. Declaration type signatures
    • 10.17.3. Expression type signatures
    • 10.17.4. Pattern type signatures
    • 10.17.5. Class and instance declarations
  • 10.18. Bindings and generalisation
    • 10.18.1. Switching off the dreaded Monomorphism Restriction
    • 10.18.2. Let-generalisation
  • 10.19. Visible type application
    • 10.19.1. Inferred vs. specified type variables
    • 10.19.2. Ordering of specified variables
  • 10.20. Implicit parameters
    • 10.20.1. Implicit-parameter type constraints
    • 10.20.2. Implicit-parameter bindings
    • 10.20.3. Implicit parameters and polymorphic recursion
    • 10.20.4. Implicit parameters and monomorphism
  • 10.21. Arbitrary-rank polymorphism
    • 10.21.1. Examples
    • 10.21.2. Type inference
    • 10.21.3. Implicit quantification
  • 10.22. Impredicative polymorphism
  • 10.23. Typed Holes
    • 10.23.1. Valid Hole Fits
      • 10.23.1.1. Refinement Hole Fits
      • 10.23.1.2. Sorting Valid Hole Fits
  • 10.24. Partial Type Signatures
    • 10.24.1. Syntax
      • 10.24.1.1. Type Wildcards
      • 10.24.1.2. Named Wildcards
      • 10.24.1.3. Extra-Constraints Wildcard
    • 10.24.2. Where can they occur?
  • 10.25. Custom compile-time errors
  • 10.26. Deferring type errors to runtime
    • 10.26.1. Enabling deferring of type errors
    • 10.26.2. Deferred type errors in GHCi
    • 10.26.3. Limitations of deferred type errors
  • 10.27. Template Haskell
    • 10.27.1. Syntax
    • 10.27.2. Using Template Haskell
    • 10.27.3. Viewing Template Haskell generated code
    • 10.27.4. A Template Haskell Worked Example
    • 10.27.5. Using Template Haskell with Profiling
    • 10.27.6. Template Haskell Quasi-quotation
  • 10.28. Arrow notation
    • 10.28.1. do-notation for commands
    • 10.28.2. Conditional commands
    • 10.28.3. Defining your own control structures
    • 10.28.4. Primitive constructs
    • 10.28.5. Differences with the paper
    • 10.28.6. Portability
  • 10.29. Bang patterns and Strict Haskell
    • 10.29.1. Bang patterns
    • 10.29.2. Strict-by-default data types
    • 10.29.3. Strict-by-default pattern bindings
    • 10.29.4. Modularity
    • 10.29.5. Dynamic semantics of bang patterns
  • 10.30. Assertions
  • 10.31. Static pointers
    • 10.31.1. Using static pointers
    • 10.31.2. Static semantics of static pointers
  • 10.32. Pragmas
    • 10.32.1. LANGUAGE pragma
    • 10.32.2. OPTIONS_GHC pragma
    • 10.32.3. INCLUDE pragma
    • 10.32.4. WARNING and DEPRECATED pragmas
    • 10.32.5. MINIMAL pragma
    • 10.32.6. INLINE and NOINLINE pragmas
      • 10.32.6.1. INLINE pragma
      • 10.32.6.2. INLINABLE pragma
      • 10.32.6.3. NOINLINE pragma
      • 10.32.6.4. CONLIKE modifier
      • 10.32.6.5. Phase control
    • 10.32.7. LINE pragma
    • 10.32.8. COLUMN pragma
    • 10.32.9. RULES pragma
    • 10.32.10. SPECIALIZE pragma
      • 10.32.10.1. SPECIALIZE INLINE
      • 10.32.10.2. SPECIALIZE for imported functions
    • 10.32.11. SPECIALIZE instance pragma
    • 10.32.12. UNPACK pragma
    • 10.32.13. NOUNPACK pragma
    • 10.32.14. SOURCE pragma
    • 10.32.15. COMPLETE pragmas
    • 10.32.16. OVERLAPPING, OVERLAPPABLE, OVERLAPS, and INCOHERENT pragmas
  • 10.33. Rewrite rules
    • 10.33.1. Syntax
    • 10.33.2. Semantics
    • 10.33.3. How rules interact with INLINE/NOINLINE pragmas
    • 10.33.4. How rules interact with CONLIKE pragmas
    • 10.33.5. How rules interact with class methods
    • 10.33.6. List fusion
    • 10.33.7. Specialisation
    • 10.33.8. Controlling what’s going on in rewrite rules
  • 10.34. Special built-in functions
  • 10.35. Generic classes
  • 10.36. Generic programming
    • 10.36.1. Deriving representations
    • 10.36.2. Writing generic functions
    • 10.36.3. Unlifted representation types
    • 10.36.4. Generic defaults
    • 10.36.5. More information
  • 10.37. Roles
    • 10.37.1. Nominal, Representational, and Phantom
    • 10.37.2. Role inference
    • 10.37.3. Role annotations
  • 10.38. HasCallStack
    • 10.38.1. Compared with other sources of stack traces
  • 10.39. Concurrent and Parallel Haskell
    • 10.39.1. Concurrent Haskell
    • 10.39.2. Software Transactional Memory
    • 10.39.3. Parallel Haskell
    • 10.39.4. Annotating pure code for parallelism
  • 10.40. Safe Haskell
    • 10.40.1. Uses of Safe Haskell
      • 10.40.1.1. Strict type-safety (good style)
      • 10.40.1.2. Building secure systems (restricted IO Monads)
    • 10.40.2. Safe Language
      • 10.40.2.1. Safe Overlapping Instances
    • 10.40.3. Safe Imports
    • 10.40.4. Trust and Safe Haskell Modes
      • 10.40.4.1. Trust check (-fpackage-trust disabled)
      • 10.40.4.2. Trust check (-fpackage-trust enabled)
      • 10.40.4.3. Example
      • 10.40.4.4. Trustworthy Requirements
      • 10.40.4.5. Package Trust
    • 10.40.5. Safe Haskell Inference
    • 10.40.6. Safe Haskell Flag Summary
    • 10.40.7. Safe Compilation

© 2002–2007 The University Court of the University of Glasgow. All rights reserved.
Licensed under the Glasgow Haskell Compiler License.
https://downloads.haskell.org/~ghc/8.10.2/docs/html/users_guide/lang.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API