git.iko.soy/rowtype-yoga/purescript-native
on fca3655 help sign in
29 lines 1.1 kB history raw
1{-# LANGUAGE DeriveFoldable #-}
2{-# LANGUAGE DeriveTraversable #-}
3module Language.PureScript.TypeClassDictionaries where
5import Prelude.Compat
7import Language.PureScript.Names
8import Language.PureScript.Types
10-- |
11-- Data representing a type class dictionary which is in scope
12--
13data TypeClassDictionaryInScope v
14 = TypeClassDictionaryInScope {
15 -- | The value with which the dictionary can be accessed at runtime
16 tcdValue :: v
17 -- | How to obtain this instance via superclass relationships
18 , tcdPath :: [(Qualified (ProperName 'ClassName), Integer)]
19 -- | The name of the type class to which this type class instance applies
20 , tcdClassName :: Qualified (ProperName 'ClassName)
21 -- | The types to which this type class instance applies
22 , tcdInstanceTypes :: [Type]
23 -- | Type class dependencies which must be satisfied to construct this dictionary
24 , tcdDependencies :: Maybe [Constraint]
25 }
26 deriving (Show, Functor, Foldable, Traversable)
28type NamedDict = TypeClassDictionaryInScope (Qualified Ident)