Type search "/search" endpoint not working
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 35/100
Direção de pesquisa
Start at the /search endpoint and its tryParseType parser path, reproducing the documented curl queries locally. Trace failures through Language.PureScript.TypeChecker.Kinds at line 501 and Language.PureScript.TypeChecker.Unify at line 70. Done means valid type searches return results or a handled error without the endpoint rejecting basic input or crashing.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
The /search endpoint doesn't seem to work (it's not officially documented, so I'm not sure if it's expected to work)
❯ curl -G --data-urlencode 'q=Unit' https://compile.purescript.org/search
{"error":"Cannot parse type"}%
I am able to get it "working" locally (maybe not as intended) by stripping the TokLayoutStart and TokLayoutEnd tokens
tryParseType :: Text -> Maybe P.SourceType
tryParseType = hush . fmap (CST.convertType "<file>") . runParser CST.parseTypeP
where
hush = either (const Nothing) Just
runParser :: CST.Parser a -> Text -> Either String a
runParser p =
let p' = do
_ <- CSTM.token CST.TokLayoutStart
result <- p
_ <- CSTM.token CST.TokLayoutEnd
_ <- CSTM.token CST.TokEof
pure result
in bimap (CST.prettyPrintError . NE.head) snd
. CST.runTokenParser p'
. CST.lexTopLevel
This produces output for certain input
❯ curl -G --data-urlencode 'q=Unit' localhost:8081/search | jq '.'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 784 0 784 0 0 341 0 --:--:-- 0:00:02 --:--:-- 342
{
"results": [
"Control.Subcategory.Closed.assertClosed",
"Control.Subcategory.HasStart.start",
"Control.Subcategory.HasUnit.unit",
"Data.Bounded.bottom",
"Data.Bounded.top",
"Data.Bounded.Generic.genericBottom",
"Data.Bounded.Generic.genericTop",
"Data.HeytingAlgebra.ff",
"Data.HeytingAlgebra.tt",
"Data.HeytingAlgebra.Generic.genericFF",
"Data.HeytingAlgebra.Generic.genericTT",
"Data.Monoid.mempty",
"Data.Monoid.Generic.genericMempty",
"Data.Ring.Module.mzeroL",
"Data.Ring.Module.mzeroR",
"Data.Semiring.one",
"Data.Semiring.zero",
"Data.Semiring.Generic.genericOne",
"Data.Semiring.Generic.genericZero",
"Data.Typelevel.Undefined.undefined",
"Data.Unit.unit",
"Formless.Class.Initial.initial",
"Options.Applicative.Builder.idm",
"Partial.crash",
"Protobuf.Internal.Common.default",
"Undefined.undefined"
]
}
but crashes on List a -> Maybe a (one of @paf31's examples from #55)
❯ curl -G --data-urlencode 'q=List a -> Maybe a' localhost:8081/search
curl: (52) Empty reply from server
q=(a -> f b) -> t a -> f (t b) fails similarly, and in both cases in the server logs I see
An internal error occurred during compilation: Skolem has no kind
Please report this at https://github.com/purescript/purescript/issues
CallStack (from HasCallStack):
error, called at src/Language/PureScript/Crash.hs:23:3 in purescript-cst-0.4.0.0-BFtByvwp6rF98omNSi831H:Language.PureScript.Crash
internalError, called at src/Language/PureScript/TypeChecker/Kinds.hs:501:32 in purescript-0.14.5-4MEYSDbbzAH8atq8Yve4k8:Language.PureScript.TypeChecker.Kinds
elaborateKind, called at src/Language/PureScript/TypeChecker/Unify.hs:70:9 in purescript-0.14.5-4MEYSDbbzAH8atq8Yve4k8:Language.PureScript.TypeChecker.Unify
- Linguagem predominante
- PureScript
- Estrelas
- 121
- Forks
- 51
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
Ainda não verificamos os arquivos de configuração deste projeto. Comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de purescript/trypurescript
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
purescript/trypurescript#309 ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
purescript/trypurescript#308 ·
-
Publish as a libraryAberta
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
purescript/trypurescript#303 · 1 comentário ·
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
purescript/trypurescript#301 · 1 comentário · 1 reação ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
purescript/trypurescript#293 · 7 comentários ·
Todas as issues de purescript/trypurescript
Issues semelhantes
-
needs triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
hyprwm/aquamarine#426 ·
Mantenedores costumam responder em até 1 dia
-
Fallback after an HTTP-200 refusal/invalid response logs no cause and is labelled "provider failure"Abertaarea/streaming comp/agent P2 provider/anthropic type/bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
NousResearch/hermes-agent#124874 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
leptos-rs/leptos#4885 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 92/100
Mantenedores costumam responder em até 1 dia