record 0.1.2 → 0.1.3
raw patch · 3 files changed
+15/−3 lines, 3 files
Files
- CHANGELOG.md +3/−0
- library/Record/Parser.hs +11/−2
- record.cabal +1/−1
CHANGELOG.md view
@@ -1,3 +1,6 @@+# 0.1.3+* Parsing of unit values and types+ # 0.1.2 * Fix Integers getting parsed as Rationals (#2)
library/Record/Parser.hs view
@@ -14,6 +14,7 @@ Type_Arrow | Type_List | Type_Record RecordType+ deriving (Show) type QualifiedName = [Text]@@ -51,6 +52,9 @@ qq p = skipSpace *> p <* skipSpace <* endOfInput +-- |+-- >>> run type' "()"+-- Right (Type_Tuple 0) type' :: Parser Type type' = labeled "type'" $@@ -69,7 +73,7 @@ fmap Type_Con $ upperCaseName tupleConType = fmap Type_Tuple $ - char '(' *> (length <$> many1 (skipSpace *> char ',')) <* skipSpace <* char ')'+ char '(' *> (length <$> many (skipSpace *> char ',')) <* skipSpace <* char ')' tupleType = fmap (\l -> foldl Type_App (Type_Tuple (length l)) l) $ char '(' *> skipSpace *>@@ -160,6 +164,7 @@ Exp_App Exp Exp | Exp_List [Exp] | Exp_Sig Exp Type+ deriving (Show) type RecordExp = [(Text, Exp)]@@ -171,6 +176,10 @@ Lit_Rational Rational deriving (Show) +-- |+-- +-- >>> run exp "()"+-- Right (Exp_TupleCon 0) exp :: Parser Exp exp = labeled "exp" $@@ -209,7 +218,7 @@ Exp_Con <$> (upperCaseName <|> symbolicIdent) tupleCon = Exp_TupleCon . length <$> - (char '(' *> many1 (char ',') <* char ')')+ (char '(' *> many (char ',') <* char ')') nil = Exp_Nil <$ string "[]" tuple =
record.cabal view
@@ -1,7 +1,7 @@ name: record version:- 0.1.2+ 0.1.3 synopsis: First class records implemented with quasi-quotation description: