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
37 | Escaped String deriving (Eq, Ord, Data, Typeable)
39instance Show Ident where
41 show (Op op) = '(':op ++ ")"
45-- Proper names, i.e. capitalized names for e.g. module names, type//data constructors.
47newtype ProperName = ProperName { runProperName :: String } deriving (Eq, Ord, Data, Typeable)
49instance Show ProperName where
55data ModuleName = ModuleName { runModuleName :: ProperName } deriving (Eq, Ord, Data, Typeable)
57instance Show ModuleName where
58 show (ModuleName name) = show name
61-- A qualified name, i.e. a name with an optional module name
63data Qualified a = Qualified (Maybe ModuleName) a deriving (Eq, Ord, Data, Typeable)
65instance (Show a) => Show (Qualified a) where
66 show (Qualified Nothing a) = show a
67 show (Qualified (Just (ModuleName name)) a) = show name ++ "." ++ show a
70-- Provide a default module name, if a name is unqualified
72qualify :: ModuleName -> Qualified a -> (ModuleName, a)
73qualify m (Qualified Nothing a) = (m, a)
74qualify _ (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