1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 10:15:55 +03:00

add contents to Token

This commit is contained in:
Ayman Nadeem 2020-01-27 19:21:48 -05:00
parent 3e25491053
commit 10a11b41ad

View File

@ -1 +1,17 @@
module Token () where
{-# LANGUAGE DataKinds, DeriveGeneric, DeriveTraversable, KindSignatures #-}
module AST.Token
( Token(..)
) where
import GHC.Generics (Generic, Generic1)
import GHC.TypeLits (Symbol, Nat)
-- | An AST node representing a token, indexed by its name and numeric value.
--
-- For convenience, token types are typically used via type synonyms, e.g.:
--
-- @
-- type AnonymousPlus = Token "+" 123
-- @
newtype Token (symName :: Symbol) (symVal :: Nat) a = Token { ann :: a }
deriving (Eq, Foldable, Functor, Generic, Generic1, Ord, Show, Traversable)