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 }