diff --git a/hw-prelude.cabal b/hw-prelude.cabal index b1bc346..76dcb9a 100644 --- a/hw-prelude.cabal +++ b/hw-prelude.cabal @@ -53,12 +53,15 @@ common project-config FlexibleContexts FlexibleInstances LambdaCase + NoFieldSelectors NoImplicitPrelude + OverloadedRecordDot OverloadedStrings RankNTypes ScopedTypeVariables TypeApplications TypeOperators + TypeSynonymInstances ghc-options: -Wall if flag(werror) @@ -88,7 +91,6 @@ library HaskellWorks.Data.String HaskellWorks.Error HaskellWorks.Error.Types - HaskellWorks.Error.Types.All HaskellWorks.Error.Types.GenericError HaskellWorks.Error.Types.TimedOut HaskellWorks.IO.Network.NamedPipe diff --git a/src/HaskellWorks/Error.hs b/src/HaskellWorks/Error.hs index 48a9da3..06add03 100644 --- a/src/HaskellWorks/Error.hs +++ b/src/HaskellWorks/Error.hs @@ -67,7 +67,7 @@ onLeftM_ :: forall e a m. () onLeftM_ f action = onLeft_ f =<< action -- | Handle the case where a list with many (more than one) elements. -onMany :: forall a m.() +onMany :: forall a m. () => Monad m => (NonEmpty a -> m (Maybe a)) -> [a] @@ -78,7 +78,7 @@ onMany h as = case as of (x : xs) -> h (x :| xs) -- | Handle the case where an effectul function returns a list with many (more than one) elements. -onManyM :: forall a m.() +onManyM :: forall a m. () => Monad m => (NonEmpty a -> m (Maybe a)) -> m [a] @@ -87,7 +87,7 @@ onManyM h f = f >>= onMany h -- | Handle the case where a list with many (more than one) elements. -onMany_ :: forall a m.() +onMany_ :: forall a m. () => Monad m => m (Maybe a) -> [a] @@ -98,7 +98,7 @@ onMany_ h as = case as of _ -> h -- | Handle the case where an effectul function returns a list with many (more than one) elements. -onManyM_ :: forall a m.() +onManyM_ :: forall a m. () => Monad m => m (Maybe a) -> m [a] diff --git a/src/HaskellWorks/Error/Types.hs b/src/HaskellWorks/Error/Types.hs index 561a529..13e9548 100644 --- a/src/HaskellWorks/Error/Types.hs +++ b/src/HaskellWorks/Error/Types.hs @@ -1,7 +1,10 @@ -module HaskellWorks.Error.Types - ( -- * Error types - GenericError(GenericError), - TimedOut(TimedOut), - ) where +{-# LANGUAGE DuplicateRecordFields #-} +{-# LANGUAGE TypeSynonymInstances #-} -import HaskellWorks.Error.Types.All +module HaskellWorks.Error.Types ( + GenericError (..), + TimedOut(..), +) where + +import HaskellWorks.Error.Types.GenericError +import HaskellWorks.Error.Types.TimedOut diff --git a/src/HaskellWorks/Error/Types/All.hs b/src/HaskellWorks/Error/Types/All.hs deleted file mode 100644 index a3c1815..0000000 --- a/src/HaskellWorks/Error/Types/All.hs +++ /dev/null @@ -1,10 +0,0 @@ -{-# LANGUAGE DuplicateRecordFields #-} -{-# LANGUAGE TypeSynonymInstances #-} - -module HaskellWorks.Error.Types.All ( - GenericError (..), - TimedOut(..), -) where - -import HaskellWorks.Error.Types.GenericError -import HaskellWorks.Error.Types.TimedOut