1-----------------------------------------------------------------------------
3-- Module : Language.PureScript.Names
4-- Copyright : (c) Phil Freeman 2013
7-- Maintainer : Phil Freeman <paf31@cantab.net>
8-- Stability : experimental
12-- Data types for names
14-----------------------------------------------------------------------------
16{-# LANGUAGE DeriveDataTypeable #-}
18module Language.PureScript.Names where
23-- Names for value identifiers
27 -- An alphanumeric identifier
31 -- A symbolic name for an infix operator
33 | Op String deriving (Eq, Ord, Data, Typeable)
35instance Show Ident where
37 show (Op op) = '(':op ++ ")"
40-- Proper names, i.e. capitalized names for e.g. module names, type//data constructors.
42newtype ProperName = ProperName { runProperName :: String } deriving (Eq, Ord, Data, Typeable)
44instance Show ProperName where
50data ModuleName = ModuleName ProperName deriving (Eq, Ord, Data, Typeable)
52instance Show ModuleName where
53 show (ModuleName name) = show name
56-- A qualified name, i.e. a name with an optional module name
58data Qualified a = Qualified (Maybe ModuleName) a deriving (Eq, Ord, Data, Typeable)
60instance (Show a) => Show (Qualified a) where
61 show (Qualified Nothing a) = show a
62 show (Qualified (Just (ModuleName name)) a) = show name ++ "." ++ show a
65-- Provide a default module name, if a name is unqualified
67qualify :: ModuleName -> Qualified a -> (ModuleName, a)
68qualify m (Qualified Nothing a) = (m, a)
69qualify _ (Qualified (Just m) a) = (m, a)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list