mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-12 12:18:29 +01:00
Removed LtsMajor
This commit is contained in:
parent
5133a38006
commit
0fc5bbbf43
18
Types.hs
18
Types.hs
@ -11,15 +11,6 @@ import qualified Data.Text.Lazy.Builder as Builder
|
||||
import qualified Data.Text.Lazy as LText
|
||||
import qualified Data.Text.Read as Reader
|
||||
|
||||
newtype LtsMajor = LtsMajor Int
|
||||
deriving (Eq, Read, Show)
|
||||
instance PathPiece LtsMajor where
|
||||
toPathPiece (LtsMajor x) = "lts-" ++ tshow x
|
||||
fromPathPiece t0 = do
|
||||
t1 <- stripPrefix "lts-" t0
|
||||
Right (x, "") <- Just $ Reader.decimal t1
|
||||
Just $ LtsMajor x
|
||||
|
||||
data StackageBranch = LtsMajorBranch Int
|
||||
| LtsBranch
|
||||
| NightlyBranch
|
||||
@ -27,11 +18,14 @@ data StackageBranch = LtsMajorBranch Int
|
||||
instance PathPiece StackageBranch where
|
||||
toPathPiece NightlyBranch = "nightly"
|
||||
toPathPiece LtsBranch = "lts"
|
||||
toPathPiece (LtsMajorBranch x) = toPathPiece $ LtsMajor x
|
||||
toPathPiece (LtsMajorBranch x) = "lts-" ++ tshow x
|
||||
|
||||
fromPathPiece "nightly" = Just NightlyBranch
|
||||
fromPathPiece "lts" = Just LtsBranch
|
||||
fromPathPiece x = (\(LtsMajor x') -> LtsMajorBranch x') <$> fromPathPiece x
|
||||
fromPathPiece "lts" = Just LtsBranch
|
||||
fromPathPiece t0 = do
|
||||
t1 <- stripPrefix "lts-" t0
|
||||
Right (x, "") <- Just $ Reader.decimal t1
|
||||
Just $ LtsMajorBranch x
|
||||
|
||||
newtype PackageName = PackageName { unPackageName :: Text }
|
||||
deriving (Show, Read, Typeable, Eq, Ord, Hashable, PathPiece, ToMarkup, PersistField, IsString)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user