Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions orb.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.38.1.
-- This file has been generated from package.yaml by hpack version 0.39.6.
--
-- see: https://github.com/sol/hpack

Expand Down Expand Up @@ -99,7 +99,7 @@ library
, optparse-applicative
, safe-exceptions
, semialign
, shrubbery
, shrubbery ==0.3.*
, text
, these
, unordered-containers
Expand Down Expand Up @@ -170,7 +170,7 @@ test-suite orb-test
, orb
, safe-exceptions
, semialign
, shrubbery
, shrubbery ==0.3.*
, tasty
, tasty-golden
, tasty-hedgehog
Expand Down
2 changes: 1 addition & 1 deletion package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ dependencies:
- optparse-applicative
- safe-exceptions
- semialign
- shrubbery
- shrubbery >= 0.3 && < 0.4
- these
- text
- unordered-containers
Expand Down
4 changes: 1 addition & 3 deletions src/Orb/Response/AddResponseHeaders.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ instance AddResponseHeaderBranches allResponseCodes '[] where

instance
( AddResponseHeaderBranches allResponseCodes someResponseCodes
, (returnType, HTTP.ResponseHeaders) ~ S.TagType code allResponseCodes
, index ~ S.TagIndex code allResponseCodes
, (returnType, HTTP.ResponseHeaders) ~ S.TypeAtIndex index (S.TaggedTypes allResponseCodes)
, S.LookupTag code allResponseCodes ~ '(index, (returnType, HTTP.ResponseHeaders))
, KnownNat index
) =>
AddResponseHeaderBranches
Expand Down
19 changes: 12 additions & 7 deletions src/Orb/Response/HasResponse.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE ExplicitNamespaces #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}

module Orb.Response.HasResponse
Expand All @@ -16,7 +17,8 @@ module Orb.Response.HasResponse
)
where

import GHC.TypeLits (KnownNat)
import Data.Kind (Type)
import GHC.TypeLits (KnownNat, Nat)
import Network.HTTP.Types qualified as HTTPTypes
import Shrubbery qualified as S

Expand Down Expand Up @@ -44,10 +46,13 @@ type Has500Response tags =
HasResponseCodeWithType tags "500" Schemas.InternalServerError

type HasResponseCodeWithType tags statusCode responseType =
( KnownNat (S.TagIndex statusCode tags)
, S.TagType statusCode tags ~ (responseType, HTTPTypes.ResponseHeaders)
, S.TypeAtIndex
(S.TagIndex statusCode tags)
(S.TaggedTypes tags)
~ (responseType, HTTPTypes.ResponseHeaders)
( KnownNat (TagIndex statusCode tags)
, S.LookupTag statusCode tags
~ '(TagIndex statusCode tags, (responseType, HTTPTypes.ResponseHeaders))
)

type TagIndex statusCode tags =
IndexOf (S.LookupTag statusCode tags)

type family IndexOf (found :: (Nat, Type)) :: Nat where
IndexOf '(index, _) = index
4 changes: 1 addition & 3 deletions src/Orb/Response/StatusCodes.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4272,9 +4272,7 @@ any function returning them lines up exactly with the response codes in the
@since 0.1.0
-}
type ReturnType returnType index m responseCodes code =
( (returnType, HTTP.ResponseHeaders) ~ S.TagType code responseCodes
, index ~ S.TagIndex code responseCodes
, (returnType, HTTP.ResponseHeaders) ~ S.TypeAtIndex index (S.TaggedTypes responseCodes)
( S.LookupTag code responseCodes ~ '(index, (returnType, HTTP.ResponseHeaders))
, KnownNat index
, Applicative m
) =>
Expand Down
6 changes: 3 additions & 3 deletions stack-ghc-9.10.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
resolver: lts-24.12
extra-deps:
- github: flipstone/beeline
commit: 5108474e7313535ff35002e14ef78f98f001415c
commit: b68cf19a70fb33d69fe1c239c0782ac54fdac796
subdirs:
- beeline-params
- beeline-routing
- beeline-http-client
- github: flipstone/shrubbery
commit: a064ede07e01b753a6eb310fc24d9fd8da1ad826
commit: ad4f362342e26cbbf2875b32b288ccd63b76633d
- github: flipstone/json-fleece
commit: 7f8b1dcb072be0939602754984110900e91dcdb8
commit: 54a0a24a5e1e510bd9b9842c99d512bfe98cf2e7
subdirs:
- json-fleece-aeson
- json-fleece-core
Expand Down
68 changes: 34 additions & 34 deletions stack-ghc-9.10.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,77 +9,77 @@ packages:
pantry-tree:
sha256: 44791687ad987b596ff02fd1776386bef293a27e097c7c589a3bb76a9a81f200
size: 1210
sha256: 089ba7df2514979a879240a54ff138f22f25522b4ec97efb361e8bee85c0b48d
size: 37422
sha256: 62e4e6ba7cad47c018785922da613b0e506d174992595705ef3e0d7df7f85af8
size: 37519
subdir: beeline-params
url: https://github.com/flipstone/beeline/archive/5108474e7313535ff35002e14ef78f98f001415c.tar.gz
url: https://github.com/flipstone/beeline/archive/b68cf19a70fb33d69fe1c239c0782ac54fdac796.tar.gz
version: 0.3.0.0
original:
subdir: beeline-params
url: https://github.com/flipstone/beeline/archive/5108474e7313535ff35002e14ef78f98f001415c.tar.gz
url: https://github.com/flipstone/beeline/archive/b68cf19a70fb33d69fe1c239c0782ac54fdac796.tar.gz
- completed:
name: beeline-routing
pantry-tree:
sha256: 555ab8a55094ffa801fa8ee8e8fc9b11ec21c08cff29e5dc152ae7f171fa3ccd
sha256: 5f4fb68613f178f5a7df8a6552c4f8e80c9986a6be891e89c6834383a3d9629b
size: 1119
sha256: 089ba7df2514979a879240a54ff138f22f25522b4ec97efb361e8bee85c0b48d
size: 37422
sha256: 62e4e6ba7cad47c018785922da613b0e506d174992595705ef3e0d7df7f85af8
size: 37519
subdir: beeline-routing
url: https://github.com/flipstone/beeline/archive/5108474e7313535ff35002e14ef78f98f001415c.tar.gz
version: 0.3.0.2
url: https://github.com/flipstone/beeline/archive/b68cf19a70fb33d69fe1c239c0782ac54fdac796.tar.gz
version: 0.3.0.3
original:
subdir: beeline-routing
url: https://github.com/flipstone/beeline/archive/5108474e7313535ff35002e14ef78f98f001415c.tar.gz
url: https://github.com/flipstone/beeline/archive/b68cf19a70fb33d69fe1c239c0782ac54fdac796.tar.gz
- completed:
name: beeline-http-client
pantry-tree:
sha256: 1c470ccb5b4458b4d9b1352b31849f781e039ee4aa86dbcad8e439955dabbe01
sha256: d002173754a8608a446e7cb241bd64d771ce82151068d936227b2ccecb2ea95d
size: 725
sha256: 089ba7df2514979a879240a54ff138f22f25522b4ec97efb361e8bee85c0b48d
size: 37422
sha256: 62e4e6ba7cad47c018785922da613b0e506d174992595705ef3e0d7df7f85af8
size: 37519
subdir: beeline-http-client
url: https://github.com/flipstone/beeline/archive/5108474e7313535ff35002e14ef78f98f001415c.tar.gz
url: https://github.com/flipstone/beeline/archive/b68cf19a70fb33d69fe1c239c0782ac54fdac796.tar.gz
version: 0.11.0.0
original:
subdir: beeline-http-client
url: https://github.com/flipstone/beeline/archive/5108474e7313535ff35002e14ef78f98f001415c.tar.gz
url: https://github.com/flipstone/beeline/archive/b68cf19a70fb33d69fe1c239c0782ac54fdac796.tar.gz
- completed:
name: shrubbery
pantry-tree:
sha256: d16c6b171d9b360098760d2c2269ded8eaae823ed9aa5c7a36598673e83fb9e3
size: 2834
sha256: 8bb3b52a8f9cb3f6edc5ee0c4584c81187b05966d59d718a247a6707479e2e33
size: 30344
url: https://github.com/flipstone/shrubbery/archive/a064ede07e01b753a6eb310fc24d9fd8da1ad826.tar.gz
version: 0.2.3.1
sha256: f3b83815f67583d8000adfec0b072fddc145be541c7e82539fd9342693f17c7e
size: 3048
sha256: 5e018f1e9dfae2cb6a2850b03f610055ac2c54f339d1b749ad70c36854bdd807
size: 31094
url: https://github.com/flipstone/shrubbery/archive/ad4f362342e26cbbf2875b32b288ccd63b76633d.tar.gz
version: 0.3.0.0
original:
url: https://github.com/flipstone/shrubbery/archive/a064ede07e01b753a6eb310fc24d9fd8da1ad826.tar.gz
url: https://github.com/flipstone/shrubbery/archive/ad4f362342e26cbbf2875b32b288ccd63b76633d.tar.gz
- completed:
name: json-fleece-aeson
pantry-tree:
sha256: 1519042c7af52c169b4543d0de5639d344f3ea8652461fdc8d85f26b0d318f5a
sha256: 92ea98ae3f591bba5e47c0a7487b77f11cf41e5b73215588b88ef01497e33bde
size: 628
sha256: dbfd87461adb2b704e25c75a4bf8401b5a1dfeec9cb2e5ae40a7000e255e0e05
size: 3106799
sha256: 0f31e6aefc099775a611ef6741e313c450bbea1a9c00c6114bfa3c724a9ea3bc
size: 3112776
subdir: json-fleece-aeson
url: https://github.com/flipstone/json-fleece/archive/7f8b1dcb072be0939602754984110900e91dcdb8.tar.gz
version: 0.5.1.0
url: https://github.com/flipstone/json-fleece/archive/54a0a24a5e1e510bd9b9842c99d512bfe98cf2e7.tar.gz
version: 0.5.2.0
original:
subdir: json-fleece-aeson
url: https://github.com/flipstone/json-fleece/archive/7f8b1dcb072be0939602754984110900e91dcdb8.tar.gz
url: https://github.com/flipstone/json-fleece/archive/54a0a24a5e1e510bd9b9842c99d512bfe98cf2e7.tar.gz
- completed:
name: json-fleece-core
pantry-tree:
sha256: 87d6a45a9b470843d28d1c2927b8f12ad4f687d987bad630e04ead9e824ee0a9
sha256: 5da3782b0406d0655925afa2a7b6980c232bb854616905240dc3836facca9f53
size: 491
sha256: dbfd87461adb2b704e25c75a4bf8401b5a1dfeec9cb2e5ae40a7000e255e0e05
size: 3106799
sha256: 0f31e6aefc099775a611ef6741e313c450bbea1a9c00c6114bfa3c724a9ea3bc
size: 3112776
subdir: json-fleece-core
url: https://github.com/flipstone/json-fleece/archive/7f8b1dcb072be0939602754984110900e91dcdb8.tar.gz
version: 0.12.0.0
url: https://github.com/flipstone/json-fleece/archive/54a0a24a5e1e510bd9b9842c99d512bfe98cf2e7.tar.gz
version: 0.13.0.0
original:
subdir: json-fleece-core
url: https://github.com/flipstone/json-fleece/archive/7f8b1dcb072be0939602754984110900e91dcdb8.tar.gz
url: https://github.com/flipstone/json-fleece/archive/54a0a24a5e1e510bd9b9842c99d512bfe98cf2e7.tar.gz
- completed:
name: bounded-text
pantry-tree:
Expand Down
6 changes: 3 additions & 3 deletions stack-ghc-9.6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
resolver: lts-22.44
extra-deps:
- github: flipstone/beeline
commit: 5108474e7313535ff35002e14ef78f98f001415c
commit: b68cf19a70fb33d69fe1c239c0782ac54fdac796
subdirs:
- beeline-params
- beeline-routing
- beeline-http-client
- github: flipstone/shrubbery
commit: a064ede07e01b753a6eb310fc24d9fd8da1ad826
commit: ad4f362342e26cbbf2875b32b288ccd63b76633d
- github: flipstone/json-fleece
commit: 7f8b1dcb072be0939602754984110900e91dcdb8
commit: 54a0a24a5e1e510bd9b9842c99d512bfe98cf2e7
subdirs:
- json-fleece-aeson
- json-fleece-core
Expand Down
68 changes: 34 additions & 34 deletions stack-ghc-9.6.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,77 +9,77 @@ packages:
pantry-tree:
sha256: 44791687ad987b596ff02fd1776386bef293a27e097c7c589a3bb76a9a81f200
size: 1210
sha256: 089ba7df2514979a879240a54ff138f22f25522b4ec97efb361e8bee85c0b48d
size: 37422
sha256: 62e4e6ba7cad47c018785922da613b0e506d174992595705ef3e0d7df7f85af8
size: 37519
subdir: beeline-params
url: https://github.com/flipstone/beeline/archive/5108474e7313535ff35002e14ef78f98f001415c.tar.gz
url: https://github.com/flipstone/beeline/archive/b68cf19a70fb33d69fe1c239c0782ac54fdac796.tar.gz
version: 0.3.0.0
original:
subdir: beeline-params
url: https://github.com/flipstone/beeline/archive/5108474e7313535ff35002e14ef78f98f001415c.tar.gz
url: https://github.com/flipstone/beeline/archive/b68cf19a70fb33d69fe1c239c0782ac54fdac796.tar.gz
- completed:
name: beeline-routing
pantry-tree:
sha256: 555ab8a55094ffa801fa8ee8e8fc9b11ec21c08cff29e5dc152ae7f171fa3ccd
sha256: 5f4fb68613f178f5a7df8a6552c4f8e80c9986a6be891e89c6834383a3d9629b
size: 1119
sha256: 089ba7df2514979a879240a54ff138f22f25522b4ec97efb361e8bee85c0b48d
size: 37422
sha256: 62e4e6ba7cad47c018785922da613b0e506d174992595705ef3e0d7df7f85af8
size: 37519
subdir: beeline-routing
url: https://github.com/flipstone/beeline/archive/5108474e7313535ff35002e14ef78f98f001415c.tar.gz
version: 0.3.0.2
url: https://github.com/flipstone/beeline/archive/b68cf19a70fb33d69fe1c239c0782ac54fdac796.tar.gz
version: 0.3.0.3
original:
subdir: beeline-routing
url: https://github.com/flipstone/beeline/archive/5108474e7313535ff35002e14ef78f98f001415c.tar.gz
url: https://github.com/flipstone/beeline/archive/b68cf19a70fb33d69fe1c239c0782ac54fdac796.tar.gz
- completed:
name: beeline-http-client
pantry-tree:
sha256: 1c470ccb5b4458b4d9b1352b31849f781e039ee4aa86dbcad8e439955dabbe01
sha256: d002173754a8608a446e7cb241bd64d771ce82151068d936227b2ccecb2ea95d
size: 725
sha256: 089ba7df2514979a879240a54ff138f22f25522b4ec97efb361e8bee85c0b48d
size: 37422
sha256: 62e4e6ba7cad47c018785922da613b0e506d174992595705ef3e0d7df7f85af8
size: 37519
subdir: beeline-http-client
url: https://github.com/flipstone/beeline/archive/5108474e7313535ff35002e14ef78f98f001415c.tar.gz
url: https://github.com/flipstone/beeline/archive/b68cf19a70fb33d69fe1c239c0782ac54fdac796.tar.gz
version: 0.11.0.0
original:
subdir: beeline-http-client
url: https://github.com/flipstone/beeline/archive/5108474e7313535ff35002e14ef78f98f001415c.tar.gz
url: https://github.com/flipstone/beeline/archive/b68cf19a70fb33d69fe1c239c0782ac54fdac796.tar.gz
- completed:
name: shrubbery
pantry-tree:
sha256: d16c6b171d9b360098760d2c2269ded8eaae823ed9aa5c7a36598673e83fb9e3
size: 2834
sha256: 8bb3b52a8f9cb3f6edc5ee0c4584c81187b05966d59d718a247a6707479e2e33
size: 30344
url: https://github.com/flipstone/shrubbery/archive/a064ede07e01b753a6eb310fc24d9fd8da1ad826.tar.gz
version: 0.2.3.1
sha256: f3b83815f67583d8000adfec0b072fddc145be541c7e82539fd9342693f17c7e
size: 3048
sha256: 5e018f1e9dfae2cb6a2850b03f610055ac2c54f339d1b749ad70c36854bdd807
size: 31094
url: https://github.com/flipstone/shrubbery/archive/ad4f362342e26cbbf2875b32b288ccd63b76633d.tar.gz
version: 0.3.0.0
original:
url: https://github.com/flipstone/shrubbery/archive/a064ede07e01b753a6eb310fc24d9fd8da1ad826.tar.gz
url: https://github.com/flipstone/shrubbery/archive/ad4f362342e26cbbf2875b32b288ccd63b76633d.tar.gz
- completed:
name: json-fleece-aeson
pantry-tree:
sha256: 1519042c7af52c169b4543d0de5639d344f3ea8652461fdc8d85f26b0d318f5a
sha256: 92ea98ae3f591bba5e47c0a7487b77f11cf41e5b73215588b88ef01497e33bde
size: 628
sha256: dbfd87461adb2b704e25c75a4bf8401b5a1dfeec9cb2e5ae40a7000e255e0e05
size: 3106799
sha256: 0f31e6aefc099775a611ef6741e313c450bbea1a9c00c6114bfa3c724a9ea3bc
size: 3112776
subdir: json-fleece-aeson
url: https://github.com/flipstone/json-fleece/archive/7f8b1dcb072be0939602754984110900e91dcdb8.tar.gz
version: 0.5.1.0
url: https://github.com/flipstone/json-fleece/archive/54a0a24a5e1e510bd9b9842c99d512bfe98cf2e7.tar.gz
version: 0.5.2.0
original:
subdir: json-fleece-aeson
url: https://github.com/flipstone/json-fleece/archive/7f8b1dcb072be0939602754984110900e91dcdb8.tar.gz
url: https://github.com/flipstone/json-fleece/archive/54a0a24a5e1e510bd9b9842c99d512bfe98cf2e7.tar.gz
- completed:
name: json-fleece-core
pantry-tree:
sha256: 87d6a45a9b470843d28d1c2927b8f12ad4f687d987bad630e04ead9e824ee0a9
sha256: 5da3782b0406d0655925afa2a7b6980c232bb854616905240dc3836facca9f53
size: 491
sha256: dbfd87461adb2b704e25c75a4bf8401b5a1dfeec9cb2e5ae40a7000e255e0e05
size: 3106799
sha256: 0f31e6aefc099775a611ef6741e313c450bbea1a9c00c6114bfa3c724a9ea3bc
size: 3112776
subdir: json-fleece-core
url: https://github.com/flipstone/json-fleece/archive/7f8b1dcb072be0939602754984110900e91dcdb8.tar.gz
version: 0.12.0.0
url: https://github.com/flipstone/json-fleece/archive/54a0a24a5e1e510bd9b9842c99d512bfe98cf2e7.tar.gz
version: 0.13.0.0
original:
subdir: json-fleece-core
url: https://github.com/flipstone/json-fleece/archive/7f8b1dcb072be0939602754984110900e91dcdb8.tar.gz
url: https://github.com/flipstone/json-fleece/archive/54a0a24a5e1e510bd9b9842c99d512bfe98cf2e7.tar.gz
- completed:
name: bounded-text
pantry-tree:
Expand Down
6 changes: 3 additions & 3 deletions stack-ghc-9.8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
resolver: lts-23.28
extra-deps:
- github: flipstone/beeline
commit: 5108474e7313535ff35002e14ef78f98f001415c
commit: b68cf19a70fb33d69fe1c239c0782ac54fdac796
subdirs:
- beeline-params
- beeline-routing
- beeline-http-client
- github: flipstone/shrubbery
commit: a064ede07e01b753a6eb310fc24d9fd8da1ad826
commit: ad4f362342e26cbbf2875b32b288ccd63b76633d
- github: flipstone/json-fleece
commit: 7f8b1dcb072be0939602754984110900e91dcdb8
commit: 54a0a24a5e1e510bd9b9842c99d512bfe98cf2e7
subdirs:
- json-fleece-aeson
- json-fleece-core
Expand Down
Loading