You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: servant/src/Servant/API/Stream.hs
+5-4Lines changed: 5 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,7 @@
2
2
{-# LANGUAGE DeriveDataTypeable #-}
3
3
{-# LANGUAGE DeriveGeneric #-}
4
4
{-# LANGUAGE FlexibleInstances #-}
5
+
{-# LANGUAGE FunctionalDependencies #-}
5
6
{-# LANGUAGE KindSignatures #-}
6
7
{-# LANGUAGE MultiParamTypeClasses #-}
7
8
{-# LANGUAGE OverloadedStrings #-}
@@ -38,13 +39,13 @@ type StreamGet = Stream 'GET
38
39
typeStreamPost=Stream 'POST
39
40
40
41
--| Stream endpoints may be implemented as producing a @StreamGenerator@ -- a function that itself takes two emit functions -- the first to be used on the first value the stream emits, and the second to be used on all subsequent values (to allow interspersed framing strategies such as comma separation).
--| ToStreamGenerator is intended to be implemented for types such as Conduit, Pipe, etc. By implementing this class, all such streaming abstractions can be used directly as endpoints.
44
-
classToStreamGeneratorfawhere
45
-
toStreamGenerator::fa->StreamGeneratora
45
+
classToStreamGeneratorab|a->bwhere
46
+
toStreamGenerator::a->StreamGeneratorb
46
47
47
-
instanceToStreamGeneratorStreamGeneratora
48
+
instanceToStreamGenerator(StreamGeneratora)a
48
49
where toStreamGenerator x = x
49
50
50
51
--| Clients reading from streaming endpoints can be implemented as producing a @ResultStream@ that captures the setup, takedown, and incremental logic for a read, being an IO continuation that takes a producer of Just either values or errors that terminates with a Nothing.
0 commit comments