aboutsummaryrefslogtreecommitdiff
path: root/src/HSVIS/Parser.hs
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2024-03-17 23:08:38 +0100
committerTom Smeding <tom@tomsmeding.com>2024-03-17 23:08:52 +0100
commitcc61cdc000481f9dc88253342c328bdb99d048a4 (patch)
treed1959086d000b3e54a9e45a7f309206e2a24b958 /src/HSVIS/Parser.hs
parente7bed242ba52e6d3233928f2c6189e701cfa5e4c (diff)
Typecheck work; solver is incorrect
Diffstat (limited to 'src/HSVIS/Parser.hs')
-rw-r--r--src/HSVIS/Parser.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/HSVIS/Parser.hs b/src/HSVIS/Parser.hs
index 0df4aa8..b4d8754 100644
--- a/src/HSVIS/Parser.hs
+++ b/src/HSVIS/Parser.hs
@@ -672,9 +672,13 @@ pType = do
return (TFun (Range pos1 pos2) ty1 ty2)
pTypeApp :: FParser PType
-pTypeApp = fasome pTypeAtom >>= \case
- t :| [] -> return t
- t :| ts -> return (TApp (foldMapne extOf (t :| ts)) t ts)
+pTypeApp = do
+ pos1 <- gets psCur
+ ts <- fasome pTypeAtom
+ pos2 <- gets psCur
+ case ts of
+ t :| [] -> return t
+ t :| ts' -> return (TApp (Range pos1 pos2) t ts')
pTypeAtom :: FParser PType
pTypeAtom = faasum' [pTypeParens, pTypeList, pTypeName]