From d0d1215913dbdd44b62cf584100a9db18aaf83b2 Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Wed, 19 Feb 2025 17:36:34 +0100 Subject: fix frontend build --- common/src/Collection.hs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'common/src') diff --git a/common/src/Collection.hs b/common/src/Collection.hs index a23fd31..25cdec7 100644 --- a/common/src/Collection.hs +++ b/common/src/Collection.hs @@ -1,24 +1,26 @@ -{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ViewPatterns #-} + module Collection where -import Data.Text qualified as T +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 :: T.Text} +newtype Collection = Collection {name :: MisoString} deriving (Read, Eq, Show) data CollectionItem = CollectionItem { collection :: Collection, itemFileName :: FilePath - } deriving (Eq) + } + deriving (Eq) instance Read CollectionItem where readPrec = R.lift $ do - (Collection . T.pack -> collection) <- R.munch (/= '/') + (Collection . toMisoString -> collection) <- R.munch (/= '/') _ <- R.string "/" itemFileName <- do itemFileName <- R.munch (liftA2 (&&) (/= '.') (/= '/')) @@ -28,4 +30,4 @@ instance Read CollectionItem where instance Show CollectionItem where show (CollectionItem {collection = Collection cn, itemFileName}) = - show (cn <> "/" <> T.pack itemFileName) + show (cn <> "/" <> toMisoString itemFileName) -- cgit v1.2.3