|
381 | 381 |
|
382 | 382 | data Http :: * |
383 | 383 |
|
384 | | - type HttpResponse e r a b c d = HttpEff e (Promise (Response r a b c d) (Response r a b c d)) |
| 384 | + type HttpResponse e r a b c d = HttpEff e (Promise I.ForeignResponse (Response r a b c d)) |
385 | 385 |
|
386 | 386 | type Response r a b c d = { statusText :: String, config :: Config a b c d, headers :: [String] -> String, status :: Status, "data" :: D.HttpData r } |
387 | 387 |
|
|
681 | 681 |
|
682 | 682 | data Promise :: * -> * -> * |
683 | 683 |
|
| 684 | + type PromiseEC e a b = ErrorT a (ContT Unit (Eff e)) b |
684 | 685 |
|
685 | | -### Type Class Instances |
686 | | - |
687 | | - instance applicativePromise :: Applicative (Promise a) |
688 | | - |
689 | | - instance applyPromise :: Apply (Promise a) |
690 | | - |
691 | | - instance bifunctorPromise :: Bifunctor Promise |
692 | | - |
693 | | - instance bindPromise :: Bind (Promise a) |
694 | 686 |
|
695 | | - instance functorPromise :: Functor (Promise a) |
| 687 | +### Values |
696 | 688 |
|
697 | | - instance monadPromise :: Monad (Promise a) |
| 689 | + catch :: forall a b c d. (a -> Promise c d) -> Promise a b -> Promise c d |
698 | 690 |
|
| 691 | + finally :: forall e r a b. Eff e r -> Promise a b -> Promise a b |
699 | 692 |
|
700 | | -### Values |
| 693 | + liftPromiseEC :: forall e a b. (Error a) => Eff e (Promise a b) -> PromiseEC e a b |
701 | 694 |
|
702 | | - catch' :: forall a b c d. (a -> Promise c d) -> Promise a b -> Promise c d |
| 695 | + runPromiseEC :: forall e a b. PromiseEC e a b -> (Either a b -> Eff e Unit) -> Eff e Unit |
703 | 696 |
|
704 | | - finally' :: forall e r a b. Eff e r -> Promise a b -> Promise a b |
| 697 | + then1 :: forall a b c. (b -> Promise a c) -> Promise a b -> Promise a c |
705 | 698 |
|
706 | | - pureReject :: forall a b. a -> Promise a b |
| 699 | + then1' :: forall a b c. (b -> c) -> Promise a b -> Promise a c |
707 | 700 |
|
708 | | - pureResolve :: forall a b. b -> Promise a b |
| 701 | + then2 :: forall a b c d. (b -> Promise c d) -> (a -> Promise c d) -> Promise a b -> Promise c d |
709 | 702 |
|
710 | | - then' :: forall a b c. (b -> Promise a c) -> Promise a b -> Promise a c |
| 703 | + then2' :: forall a b c d. (b -> d) -> (a -> c) -> Promise a b -> Promise c d |
711 | 704 |
|
712 | | - then'' :: forall a b c d. (b -> Promise c d) -> (a -> Promise c d) -> Promise a b -> Promise c d |
| 705 | + then3 :: forall e s t a b c d. (b -> Promise c d) -> (a -> Promise c d) -> (s -> Eff e t) -> Promise a b -> Promise c d |
713 | 706 |
|
714 | | - then''' :: forall e s t a b c d. (b -> Promise c d) -> (a -> Promise c d) -> (s -> Eff e t) -> Promise a b -> Promise c d |
| 707 | + then3' :: forall e s t a b c d. (b -> d) -> (a -> c) -> (s -> Eff e t) -> Promise a b -> Promise c d |
715 | 708 |
|
716 | 709 |
|
717 | 710 | ## Module Angular.Q |
|
897 | 890 | data ForeignResponse :: * |
898 | 891 |
|
899 | 892 |
|
| 893 | +### Type Class Instances |
| 894 | + |
| 895 | + instance errorForeignResponse :: Error ForeignResponse |
| 896 | + |
| 897 | + |
900 | 898 | ### Values |
901 | 899 |
|
902 | 900 | foreignConfig :: forall e. HttpEff e ForeignConfig |
|
1025 | 1023 | writeRequestData :: forall a. RequestData a -> ForeignRequestData |
1026 | 1024 |
|
1027 | 1025 |
|
1028 | | -## Module Angular.Promise.Eff |
1029 | | - |
1030 | | -### Types |
1031 | | - |
1032 | | - newtype PromiseEff e f a b where |
1033 | | - PromiseEff :: Promise (Eff e a) (Eff f b) -> PromiseEff e f a b |
1034 | | - |
1035 | | - |
1036 | | -### Type Class Instances |
1037 | | - |
1038 | | - instance applicativePromiseEff :: Applicative (PromiseEff e f a) |
1039 | | - |
1040 | | - instance applyPromise :: Apply (PromiseEff e f a) |
1041 | | - |
1042 | | - instance bifunctorPromise :: Bifunctor (PromiseEff e f) |
1043 | | - |
1044 | | - instance bindPromiseEff :: Bind (PromiseEff e f a) |
1045 | | - |
1046 | | - instance functorPromiseEff :: Functor (PromiseEff e f a) |
1047 | | - |
1048 | | - |
1049 | | -### Values |
1050 | | - |
1051 | | - liftPromiseEff :: forall e f a b. Eff e a -> Eff f b -> PromiseEff e f a b |
1052 | | - |
1053 | | - liftPromiseEff' :: forall e f a b. Eff f b -> PromiseEff e f a b |
1054 | | - |
1055 | | - promiseEff :: forall e f a b. Promise a b -> PromiseEff e f a b |
1056 | | - |
1057 | | - promiseEff' :: forall e f a b. Promise a (Eff f b) -> PromiseEff e f a b |
1058 | | - |
1059 | | - promiseEff'' :: forall e f a b. Promise (Eff e a) b -> PromiseEff e f a b |
1060 | | - |
1061 | | - runPromiseEff :: forall e f a b. PromiseEff e f a b -> Promise (Eff e a) (Eff f b) |
1062 | | - |
1063 | | - unsafeRunPromiseEff :: forall e f a b. PromiseEff e f a b -> Promise a b |
1064 | | - |
1065 | | - |
1066 | 1026 |
|
0 commit comments