support for consistent braces-plus-semicolon-style #27

Open
opened 2017-05-04 12:35:49 +02:00 by lspitzner · 1 comment
lspitzner commented 2017-05-04 12:35:49 +02:00 (Migrated from github.com)

e.g. see this nice example (shortened):

module Data.Graph.Inductive.Graphviz
       (Orient(..), graphviz, graphviz') where
{ import Data.Graph.Inductive.Graph;
   
  data Orient = Portrait
              | Landscape
              deriving (Eq, Show);
   
  graphviz ::
           (Graph g, Show a, Show b) =>
             g a b ->
               String -> (Double, Double) -> (Int, Int) -> Orient -> String;
  graphviz g t (w, h) p@(pw', ph') o
    = let { n = labNodes g;
            e = labEdges g}
        in
        "digraph " ++ t ++ " {\n" ++ "\tmargin = \"0\"\n" ++ "\tpage = \""}
e.g. [see this nice example](https://github.com/FeatureIDE/FeatureIDE/blob/10b52e190d88e78cf10aa60c020a983eed3b9769/plugins/de.ovgu.featureide.examples/featureide_examples/FGL-FH-Haskell/features/GraphViz/Data/Graph/Inductive/Graphviz.hs) (shortened): ~~~~.hs module Data.Graph.Inductive.Graphviz (Orient(..), graphviz, graphviz') where { import Data.Graph.Inductive.Graph; data Orient = Portrait | Landscape deriving (Eq, Show); graphviz :: (Graph g, Show a, Show b) => g a b -> String -> (Double, Double) -> (Int, Int) -> Orient -> String; graphviz g t (w, h) p@(pw', ph') o = let { n = labNodes g; e = labEdges g} in "digraph " ++ t ++ " {\n" ++ "\tmargin = \"0\"\n" ++ "\tpage = \""} ~~~~
lspitzner commented 2018-09-14 20:10:57 +02:00 (Migrated from github.com)

As noticed in #181, let-without-in is not permitted in brace-style-do-notation. That means that for example

func = do
  let a = expr
  action a
  let b = expr
  action a b

must be transformed to

func = do { let a = expr in do { action a; let b = expr in action a b } }

which is.. surprising clunky and annoying.

As noticed in #181, `let-without-in` is not permitted in brace-style-do-notation. That means that for example ~~~~.hs func = do let a = expr action a let b = expr action a b ~~~~ must be transformed to ~~~~.hs func = do { let a = expr in do { action a; let b = expr in action a b } } ~~~~ which is.. surprising clunky and annoying.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: hexagoxel/brittany#27
There is no content yet.