diff options
Diffstat (limited to 'src/HSVIS/Parser.hs')
-rw-r--r-- | src/HSVIS/Parser.hs | 10 |
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] |