From caf72faccc04e647c27e1b5eef85c515949d8210 Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Thu, 20 Feb 2025 12:29:35 +0100 Subject: consolidate `backend, cli, common` -> `acms` --- common/src/Collection.hs | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 common/src/Collection.hs (limited to 'common/src/Collection.hs') diff --git a/common/src/Collection.hs b/common/src/Collection.hs deleted file mode 100644 index 418278d..0000000 --- a/common/src/Collection.hs +++ /dev/null @@ -1,30 +0,0 @@ -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE RecordWildCards #-} -{-# LANGUAGE ViewPatterns #-} - -module Collection where - -import Miso.String (MisoString, toMisoString) -import Text.ParserCombinators.ReadP qualified as R -import Text.ParserCombinators.ReadPrec qualified as R -import Text.Read (Read (..)) - -newtype Collection = Collection {name :: MisoString} - deriving (Read, Eq, Show) - -data CollectionItem = CollectionItem - { collection :: Collection, - itemFileName :: FilePath - } - deriving (Eq) - -instance Read CollectionItem where - readPrec = R.lift $ do - (Collection . toMisoString -> collection) <- R.munch (/= '/') - _ <- R.string "/" - itemFileName <- R.munch (const True) - pure CollectionItem {..} - -instance Show CollectionItem where - show (CollectionItem {collection = Collection cn, itemFileName}) = - show (cn <> "/" <> toMisoString itemFileName) -- cgit v1.2.3