You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The general recommendation seems to be to place pragmas after the entity they apply to. But in case of the {-# MINIMAL #-} pragma, I think the following works best in terms of readability:
classFoldabletwhere
{-# MINIMAL foldMap | foldr #-}
--| Combine the elements of a structure using a monoid.fold::Monoidm=>tm->m
fold =foldMapid{- long list of other methods -}--| List of elements of a structure.toList::Foldablet=>ta-> [a]
toList t = build (\ c n ->foldr c n t)
{-# INLINE toList #-}
as opposed to place the {-# MINIMAL #-}-line after the {-# INLINE toList #-}-line.
The text was updated successfully, but these errors were encountered:
The general recommendation seems to be to place pragmas after the entity they apply to. But in case of the
{-# MINIMAL #-}
pragma, I think the following works best in terms of readability:as opposed to place the
{-# MINIMAL #-}
-line after the{-# INLINE toList #-}
-line.The text was updated successfully, but these errors were encountered: