Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fixes #239

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/App/Commands/Debug/S3/Cp.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import App.Commands.Options.Parser (text)
import App.Commands.Options.Types (CpOptions (CpOptions))
import Control.Applicative (Alternative(..), optional)
import Control.Lens ((&), (^.), (.~), (%~))
import Control.Monad.Except (MonadIO(..))
import Control.Monad.IO.Class (MonadIO(..))
import Data.ByteString (ByteString)
import Data.Functor ((<&>))
import Data.Generics.Product.Any (the)
Expand Down
2 changes: 1 addition & 1 deletion cabal-cache.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license: BSD-3-Clause
license-file: LICENSE
author: John Ky
maintainer: [email protected]
copyright: John Ky 2019-2023
copyright: John Ky 2019-2024
category: Development
tested-with: GHC == 9.4.8, GHC == 9.2.8, GHC == 8.10.7
extra-source-files: README.md
Expand Down
4 changes: 3 additions & 1 deletion src/HaskellWorks/CabalCache/Core.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ module HaskellWorks.CabalCache.Core

import Control.DeepSeq (NFData)
import Control.Lens ((<&>), (&), (^.))
import Control.Monad
import Control.Monad.Catch (MonadCatch(..))
import Control.Monad.Except (ExceptT, forM, MonadIO(..), MonadError(..))
import Control.Monad.Except (ExceptT, MonadError(..))
import Control.Monad.IO.Class (MonadIO(..))
import Data.Aeson (eitherDecode)
import Data.Bifunctor (first)
import Data.Bool (bool)
Expand Down
8 changes: 5 additions & 3 deletions src/HaskellWorks/CabalCache/Options.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ module HaskellWorks.CabalCache.Options
) where

import Amazonka.Data.Text (FromText (..), fromText)
import Control.Applicative (Alternative(..))
import Options.Applicative (Parser, Mod, OptionFields)
import Text.Read (readEither)

import qualified Data.Text as T
import qualified Options.Applicative as OA

readOrFromTextOption :: (Read a, FromText a) => Mod OptionFields a -> Parser a
readOrFromTextOption :: ( Read a, FromText a) => Mod OptionFields a -> Parser a
readOrFromTextOption =
let fromStr s = readEither s <|> fromText (T.pack s)
let fromStr s =
case readEither s of
Right a -> pure a
Left _ -> fromText (T.pack s)
in OA.option $ OA.eitherReader fromStr
Loading