on master help sign in
Remove Monoid instance of Link and simplify Utils.Links documentation
commit3a4471f2112e58617b6165e904c454107e6d63ea authorChristian Marie <christian@ponies.io> dateThu 29 Jan 2015, 15:03 (12 years ago) parentc1ab495
1 file changed+4−9
src/Servant/Utils/Links.hs+4−9
src/Servant/Utils/Links.hs+4−9
@@ -28,9 +28,9 @@
2828-- 'safeLink'. The first argument to 'safeLink' is a type representing the
2929-- endpoint you would like to point to. This will need to end in a verb like
3030-- Get, or Post. The second argument is the API in which you would like to
31−-- ensure the endpoint is within. Further arguments may or may not be required
32−-- depending on the type of the endpoint. If everything lines up you will get a
33−-- 'URI' out the other end.
31+-- ensure the endpoint is within. Further arguments be required depending on
32+-- the type of the endpoint. If everything lines up you will get a 'URI' out
33+-- the other end.
3434--
3535-- You may omit 'QueryParam's and the like should you not want to provide them,
3636-- but types which form part of the URL path like 'Capture' must be included.
@@ -188,11 +188,6 @@ addMatrixParam param l = l { _segments = f (_segments l) }
188188 ArrayElemParam k v -> seg <> ";" <> k <> "[]=" <> escape (unpack v)
189189 FlagParam k -> seg <> ";" <> k
190190
191−instance Monoid Link where
192− mempty = Link mempty mempty
193− mappend (Link a1 b1) (Link a2 b2) =
194− Link (a1 <> a2) (b1 <> b2)
195−
196191linkURI :: Link -> URI
197192linkURI (Link segments q_params) =
198193 URI mempty -- No scheme (relative)
@@ -221,7 +216,7 @@ safeLink
221216 => Proxy endpoint -- ^ The API endpoint you would like to point to
222217 -> Proxy api -- ^ The whole API that you this endpoint is a part of
223218 -> MkLink endpoint
224−safeLink endpoint _ = link endpoint mempty
219+safeLink endpoint _ = link endpoint (Link mempty mempty)
225220
226221-- | Construct a link for an endpoint.
227222class HasLink endpoint where