Skip to content

Commit c78613a

Browse files
committed
Merge pull request #15 from purescript-contrib/di-class-exports
Add exports for class members
2 parents eba6a68 + 13b8cf5 commit c78613a

File tree

2 files changed

+23
-21
lines changed

2 files changed

+23
-21
lines changed

MODULE.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
RootElement :: Element -> RootElement
112112

113113
newtype RootScope a where
114-
RootScope :: Scope a -> RootScope
114+
RootScope :: Scope a -> RootScope a
115115

116116

117117
### Type Classes
@@ -122,6 +122,8 @@
122122
class Injectable a where
123123
dependencies :: a -> [String]
124124

125+
class (Dependency a) <= Service a where
126+
125127

126128
### Type Class Instances
127129

@@ -754,9 +756,9 @@
754756
### Types
755757

756758
data ApplyExpr e r a where
757-
DefaultApplyExpr :: ApplyExpr
758-
StringApplyExpr :: String -> ApplyExpr
759-
FnApplyExpr :: (Scope a -> Eff e r) -> ApplyExpr
759+
DefaultApplyExpr :: ApplyExpr e r a
760+
StringApplyExpr :: String -> ApplyExpr e r a
761+
FnApplyExpr :: (Scope a -> Eff e r) -> ApplyExpr e r a
760762

761763
type Event e a b = { defaultPrevented :: Boolean, preventDefault :: Eff e Unit, stopPropagation :: Eff e Unit, name :: String, currentScope :: Scope b, targetScope :: Scope a }
762764

@@ -1026,23 +1028,23 @@
10261028
data NgHttp :: !
10271029

10281030
data RequestData a where
1029-
NoRequestData :: RequestData
1030-
StringRequestData :: String -> RequestData
1031-
ObjectRequestData :: a -> RequestData
1031+
NoRequestData :: RequestData a
1032+
StringRequestData :: String -> RequestData a
1033+
ObjectRequestData :: a -> RequestData a
10321034

10331035
type RequestDataFn a = { objectRequestData :: a -> RequestData a, stringRequestData :: String -> RequestData a, noRequestData :: RequestData a }
10341036

10351037
data ResponseData a where
1036-
NoResponseData :: ResponseData
1037-
DefaultResponseData :: String -> ResponseData
1038-
ArrayBufferResponseData :: D.ArrayBuffer -> ResponseData
1039-
BlobResponseData :: D.Blob -> ResponseData
1040-
DocumentResponseData :: D.Document -> ResponseData
1041-
JsonResponseData :: a -> ResponseData
1042-
TextResponseData :: String -> ResponseData
1043-
MozBlobResponseData :: D.MozBlob -> ResponseData
1044-
MozChunkedTextResponseData :: D.MozChunkedText -> ResponseData
1045-
MozChunkedArrayBufferResponseData :: D.MozChunkedArrayBuffer -> ResponseData
1038+
NoResponseData :: ResponseData a
1039+
DefaultResponseData :: String -> ResponseData a
1040+
ArrayBufferResponseData :: D.ArrayBuffer -> ResponseData a
1041+
BlobResponseData :: D.Blob -> ResponseData a
1042+
DocumentResponseData :: D.Document -> ResponseData a
1043+
JsonResponseData :: a -> ResponseData a
1044+
TextResponseData :: String -> ResponseData a
1045+
MozBlobResponseData :: D.MozBlob -> ResponseData a
1046+
MozChunkedTextResponseData :: D.MozChunkedText -> ResponseData a
1047+
MozChunkedArrayBufferResponseData :: D.MozChunkedArrayBuffer -> ResponseData a
10461048

10471049
type ResponseDataFn a = { mozChunkedArrayBufferResponseData :: D.MozChunkedArrayBuffer -> ResponseData a, mozChunkedTextResponseData :: D.MozChunkedText -> ResponseData a, mozBlobResponseData :: D.MozBlob -> ResponseData a, textResponseData :: String -> ResponseData a, jsonResponseData :: a -> ResponseData a, documentResponseData :: D.Document -> ResponseData a, blobResponseData :: D.Blob -> ResponseData a, arrayBufferResponseData :: D.ArrayBuffer -> ResponseData a, defaultResponseData :: String -> ResponseData a, noResponseData :: ResponseData a }
10481050

@@ -1110,7 +1112,7 @@
11101112
### Types
11111113

11121114
newtype PromiseEff e f a b where
1113-
PromiseEff :: Promise (Eff e a) (Eff f b) -> PromiseEff
1115+
PromiseEff :: Promise (Eff e a) (Eff f b) -> PromiseEff e f a b
11141116

11151117

11161118
### Type Class Instances

src/Angular/DI.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
module Angular.DI (
2-
Dependency
2+
Dependency, name
33
, Service
44
, RootScope(..)
55
, RootElement(..)
66
, get
7-
, Injectable
7+
, Injectable, dependencies
88
, Annotated()
99
, annotate
1010
) where
@@ -100,7 +100,7 @@ instance dependencyAttributes :: Dependency Attributes where
100100
name = "$attrs"
101101

102102
instance dependencyThis :: Dependency (This a) where
103-
-- it would be nice to make a dummy service to avoid the special handling
103+
-- it would be nice to make a dummy service to avoid the special handling
104104
-- in annotate, but there is nowhere to do so
105105
name = "$this"
106106

0 commit comments

Comments
 (0)