1-----------------------------------------------------------------------------
3-- Module : Language.PureScript.TypeClassDictionaries
4-- Copyright : (c) 2014 Phil Freeman
7-- Maintainer : Phil Freeman <paf31@cantab.net>
8-- Stability : experimental
13-----------------------------------------------------------------------------
15{-# LANGUAGE DeriveDataTypeable #-}
17module Language.PureScript.TypeClassDictionaries where
21import Language.PureScript.Names
22import Language.PureScript.Types
25-- Data representing a type class dictionary which is in scope
27data TypeClassDictionaryInScope
28 = TypeClassDictionaryInScope {
29 -- | The identifier with which the dictionary can be accessed at runtime
30 tcdName :: Qualified Ident
31 -- | How to obtain this instance via superclass relationships
32 , tcdPath :: [(Qualified ProperName, Integer)]
33 -- | The name of the type class to which this type class instance applies
34 , tcdClassName :: Qualified ProperName
35 -- | The types to which this type class instance applies
36 , tcdInstanceTypes :: [Type]
37 -- | Type class dependencies which must be satisfied to construct this dictionary
38 , tcdDependencies :: Maybe [Constraint]
39 } deriving (Show, Read, Data, Typeable)
42-- A simplified representation of expressions which are used to represent type
43-- class dictionaries at runtime, which can be compared for equality
47 -- A dictionary which is brought into scope by a local constraint
49 = LocalDictionaryValue (Qualified Ident)
51 -- A dictionary which is brought into scope by an instance declaration
53 | GlobalDictionaryValue (Qualified Ident)
55 -- A dictionary which depends on other dictionaries
57 | DependentDictionaryValue (Qualified Ident) [DictionaryValue]
59 -- A subclass dictionary
61 | SubclassDictionaryValue DictionaryValue (Qualified ProperName) Integer
62 deriving (Show, Read, Ord, Eq)
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