Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,384
    • Issues 4,384
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 372
    • Merge Requests 372
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Wiki
  • type nats

Last edited by Ben Gamari Apr 01, 2019
Page history New page

type nats

Type Level Literals

This page collects information on how to work with type-level literals, as implemented in the Haskell compiler GHC (ticket #4385 (closed)).

Status

See the type literals label for tickets.

User's Guide

  • Type-Level Literal Basics
  • Type-Level Computation
  • Typed examinations of Sing values
  • Matching on Type-Level Naturals (i.e., working with classes and type-families)

Notes on Design

  • Details about the implementation of singleton families.
  • Alternative Design For Singletons
  • Avoiding Partial Type Functions
  • Singletons and Existentials

Notes on the Implementation

  • Implementation of GHC.TypeLits
  • The solver for type-level naturals

Source Code

  • type-nats branch of GHC
  • type-nats branch of the base library
  • type nats branch of template-haskell
  • Also, there is a type-nats branch for 'haddock'.

XXX: Cleanup

  • Natural Numbers: From Values to Types
  • More advanced example: https://github.com/yav/memory-arrays/tree/master
  • Examples
  • Axioms for type-level type operators
Clone repository Edit sidebar

GHC Home
GHC User's Guide

Joining In

Newcomers info
Mailing Lists & IRC
The GHC Team

Documentation

GHC Status Info
Working conventions
Building Guide
Debugging
Commentary

Wiki

Title Index
Recent Changes