Browse Source

Minor changes

Abhinav Sarkar 4 years ago
parent
commit
0071c7d718
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      2016-04-19/parser.hs

+ 2
- 2
2016-04-19/parser.hs View File

@@ -39,7 +39,7 @@ newtype Digit = Digit { getIntOfDigit :: Int } deriving (Show, Eq, Ord)
39 39
 
40 40
 charToDigit :: Char -> Maybe Digit
41 41
 charToDigit c =
42
-  if Char.isDigit c then Just $ Digit (Char.digitToInt c) else Nothing
42
+  if Char.isDigit c then Just . Digit . Char.digitToInt $ c else Nothing
43 43
 
44 44
 digitParser :: Parser String Digit
45 45
 digitParser = Parser $ \i -> case i of
@@ -49,7 +49,7 @@ digitParser = Parser $ \i -> case i of
49 49
 digitsParser :: Parser String [Digit]
50 50
 digitsParser = Parser $ \i -> case runParser digitParser i of
51 51
   Nothing      -> Nothing
52
-  Just (d, i') ->  case runParser digitsParser i' of
52
+  Just (d, i') -> case runParser digitsParser i' of
53 53
     Nothing        -> Just ([d], i')
54 54
     Just (ds, i'') -> Just (d:ds, i'')
55 55
 

Loading…
Cancel
Save