record 0.2.0 → 0.2.1
raw patch · 3 files changed
+29/−7 lines, 3 files
Files
- CHANGELOG.md +3/−0
- library/Record/Parser.hs +25/−6
- record.cabal +1/−1
CHANGELOG.md view
@@ -1,3 +1,6 @@+# 0.2.1+* Parsing of qualified identifiers+ # 0.2.0 * Type-changing updates * Reimplemented the `Record.Types` API
library/Record/Parser.hs view
@@ -9,7 +9,7 @@ data Type = Type_App Type Type | Type_Var Text |- Type_Con Text |+ Type_Con Ident | Type_Tuple Int | Type_Arrow | Type_List |@@ -79,7 +79,7 @@ varType = fmap Type_Var $ lowerCaseName conType =- fmap Type_Con $ upperCaseName+ fmap Type_Con $ upperCaseIdent tupleConType = Type_Tuple 0 <$ string "()" <|> Type_Tuple . succ . length <$> (char '(' *> many (char ',') <* char ')')@@ -157,7 +157,26 @@ charLit = char '\'' *> ((char '\\' *> (char '\'' <|> char '\\')) <|> notChar '\'') <* char '\'' +type Ident =+ Text +lowerCaseIdent :: Parser Ident+lowerCaseIdent =+ labeled "lowerCaseIdent" $+ fmap (T.intercalate ".") $+ (<>) <$>+ (many (upperCaseName <* char '.')) <*>+ (pure <$> (lowerCaseName <|> symbolicIdent))++upperCaseIdent :: Parser Ident+upperCaseIdent =+ labeled "upperCaseIdent" $+ fmap (T.intercalate ".") $+ (<>) <$>+ (many (upperCaseName <* char '.')) <*>+ (pure <$> (upperCaseName <|> symbolicIdent))++ type Lens = [Text] @@ -169,8 +188,8 @@ data Exp = Exp_Record RecordExp |- Exp_Var Text |- Exp_Con Text |+ Exp_Var Ident |+ Exp_Con Ident | Exp_TupleCon Int | Exp_Nil | Exp_Lit Lit |@@ -235,9 +254,9 @@ field = (,) <$> lowerCaseName <*> (skipSpace *> char '=' *> skipSpace *> exp) var =- Exp_Var <$> (lowerCaseName <|> symbolicIdent)+ Exp_Var <$> lowerCaseIdent con =- Exp_Con <$> (upperCaseName <|> symbolicIdent)+ Exp_Con <$> upperCaseIdent tupleCon = Exp_TupleCon 0 <$ string "()" <|> Exp_TupleCon . succ . length <$> (char '(' *> many (char ',') <* char ')')
record.cabal view
@@ -1,7 +1,7 @@ name: record version:- 0.2.0+ 0.2.1 synopsis: First class records implemented with quasi-quotation description: