Skip to content

Commit

Permalink
Display foralls in gibiansky style
Browse files Browse the repository at this point in the history
  • Loading branch information
gibiansky committed May 29, 2015
1 parent 726c692 commit ebd5211
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/HIndent/Styles/Gibiansky.hs
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,11 @@ typ :: Extend Type
-- For contexts, check whether the context and all following function types
-- are on the same line. If they are, print them on the same line; otherwise
-- print the context and each argument to the function on separate lines.
typ (TyForall _ _ (Just ctx) rest) =
typ (TyForall _ mforall (Just ctx) rest) = do
forM_ mforall $ \forallVars -> do
write "forall "
spaced $ map pretty forallVars
write ". "
if all (sameLine ctx) $ collectTypes rest
then do
pretty ctx
Expand Down
2 changes: 2 additions & 0 deletions test/gibiansky/expected/45.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
a :: forall b. Typeable b => b
a = 3
2 changes: 2 additions & 0 deletions test/gibiansky/tests/45.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
a :: forall b. Typeable b => b
a = 3

0 comments on commit ebd5211

Please sign in to comment.