Treat strings like any other pattern literal
This commit is contained in:
parent
dce5e3eade
commit
958fb1c896
1 changed files with 1 additions and 5 deletions
|
@ -23,11 +23,7 @@ basic = choice
|
|||
"True" -> PLiteral (Boolean True)
|
||||
"False" -> PLiteral (Boolean False)
|
||||
c : _ -> if isUpper c then PData v [] else PVar v
|
||||
, do lit <- literal
|
||||
return $ case lit of
|
||||
Str s -> foldr combine (PData "[]" []) s
|
||||
where combine h t = PData "::" [PLiteral (Chr h),t]
|
||||
_ -> PLiteral lit
|
||||
, PLiteral <$> literal
|
||||
]
|
||||
|
||||
asPattern :: Pattern -> IParser Pattern
|
||||
|
|
Loading…
Reference in a new issue