Is your bug specific to Fourmolu?
It works in https://ormolu-live.tweag.io/, but most likely because sort-constraints isn't a thing.
Did you try it on the web app?
Putting in
-- | Handler for serialized update action
data BatchUpdateHandler m
= forall a.
(Typeable a, FromJSON a, HasCallStack) =>
BatchUpdateHandler
(BatchUpdateJob -> a -> m ())
With sort-constraints reproduces the bug. Without sort-constraints, it formats fine. Removing Typeable also makes it format fine.
Did you search for existing issues?
Searched for sort-constraints and saw only one closed issue that looks unrelated.
Describe the bug
% fourmolu -i **/*.hs
Loaded config from: /home/patrick/code/freckle/megarepo/fourmolu.yaml
jobs/library/Freckle/Jobs/BatchUpdate.hs
@@ -250,6 +250,6 @@
-- | Handler for serialized update action
data BatchUpdateHandler m
= forall a.
- (Typeable a, FromJSON a, HasCallStack) =>
+ (FromJSON a, HasCallStack, Typeable a) =>
BatchUpdateHandler
(BatchUpdateJob -> a -> m ())
AST of input and AST of formatted code differ.
at jobs/library/Freckle/Jobs/BatchUpdate.hs:253:18-27
at jobs/library/Freckle/Jobs/BatchUpdate.hs:253:30-41
Please, consider reporting the bug.
To format anyway, use --unsafe.
roster-management/library/Freckle/RosterManagement/Csv/Field.hs
@@ -37,6 +37,6 @@
--
-- We need the 'Proxy' so that we can easily identify the 's' in
-- 'Coercible s t' during pattern-matching.
- From :: (FromField s, Coercible s t) => Proxy s -> Text -> Field t
+ From :: (Coercible s t, FromField s) => Proxy s -> Text -> Field t
-- | Either of two 'Field's with the same type
Or :: Field t -> Field t -> Field t
AST of input and AST of formatted code differ.
at roster-management/library/Freckle/RosterManagement/Csv/Field.hs:40:12-20
at roster-management/library/Freckle/RosterManagement/Csv/Field.hs:40:25-35
Please, consider reporting the bug.
To format anyway, use --unsafe.
Let me know what else you'd need to debug.
Is your bug specific to Fourmolu?
It works in https://ormolu-live.tweag.io/, but most likely because
sort-constraintsisn't a thing.Did you try it on the web app?
Putting in
With
sort-constraintsreproduces the bug. Withoutsort-constraints, it formats fine. RemovingTypeablealso makes it format fine.Did you search for existing issues?
Searched for
sort-constraintsand saw only one closed issue that looks unrelated.Describe the bug
Let me know what else you'd need to debug.