From dc9fe924840e2ebf7c0b1aea592af877a73adb34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frederik=20Hangh=C3=B8j=20Iversen?= Date: Thu, 17 Oct 2019 23:37:56 +0200 Subject: [PATCH] hlint --- src/Data/Graphviz.hs | 4 +++- src/Data/Language/Ruby/AST.hs | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Data/Graphviz.hs b/src/Data/Graphviz.hs index 06e60e4..49a5297 100644 --- a/src/Data/Graphviz.hs +++ b/src/Data/Graphviz.hs @@ -11,4 +11,6 @@ digraph es = Text.unlines ] edges :: [NonEmpty Text] -> Text -edges = Text.unlines . fmap ((\(x :| xs) -> Text.unlines $ (\y -> x <> " -> " <> y <> ";") <$> xs)) +edges = Text.unlines . fmap f + where + f (x :| xs) = Text.unlines $ (\y -> x <> " -> " <> y <> ";") <$> xs diff --git a/src/Data/Language/Ruby/AST.hs b/src/Data/Language/Ruby/AST.hs index 3ef7beb..cf896c2 100644 --- a/src/Data/Language/Ruby/AST.hs +++ b/src/Data/Language/Ruby/AST.hs @@ -147,7 +147,7 @@ instance FromJSON Casgn where _ -> empty -data Array = Array +newtype Array = Array { statements :: [Statement] } deriving stock instance Show Array @@ -443,7 +443,7 @@ instance FromJSON Lvasgn where [Aeson.String "lvasgn", atom, statement] -> Lvasgn <$> parseJSON atom <*> parseJSON statement _ -> empty -data Lvar = Lvar +newtype Lvar = Lvar { atom :: Atom } @@ -458,7 +458,7 @@ instance FromJSON Lvar where [Aeson.String "lvar", atom] -> Lvar <$> parseJSON atom _ -> empty -data Ivar = Ivar +newtype Ivar = Ivar { atom :: Atom }