From 7b65115554310e92a295be8123eceabf5ba7178a Mon Sep 17 00:00:00 2001 From: Ruslan Khafizov Date: Mon, 9 Sep 2024 09:36:36 +0800 Subject: [PATCH] Remove unused type param --- src/AnyAll/Marking.purs | 16 ++++++++-------- src/AnyAll/Relevance.purs | 2 +- src/AnyAll/Types.purs | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/AnyAll/Marking.purs b/src/AnyAll/Marking.purs index e7cffcb..4d41811 100644 --- a/src/AnyAll/Marking.purs +++ b/src/AnyAll/Marking.purs @@ -26,7 +26,7 @@ import Data.Show.Generic (genericShow) import AnyAll.BasicTypes (maybe2string) -newtype Marking = Marking (Map.Map String (Default Boolean)) +newtype Marking = Marking (Map.Map String Default) derive instance eqMarking :: Eq (Marking) derive instance genericMarking :: Generic Marking _ @@ -60,20 +60,20 @@ readDefault fm mk = do markup :: Map.Map String (Maybe Boolean) -> Marking markup x = Marking $ Default <$> x -getMarking ∷ Marking → Map.Map String (Default Boolean) +getMarking ∷ Marking → Map.Map String Default getMarking (Marking mymap) = mymap -newtype Default a = Default (Maybe a) +newtype Default = Default (Maybe Boolean) -derive instance eqDefault :: (Eq a) => Eq (Default a) -derive instance genericDefault :: Generic (Default a) _ -instance showDefault :: (Show a) => Show (Default a) where +derive instance eqDefault :: Eq (Default) +derive instance genericDefault :: Generic (Default) _ +instance showDefault :: Show (Default) where show = genericShow -instance encodeDefault :: (Show a, Encode a) => Encode (Default a) where +instance encodeDefault :: Encode (Default) where encode eta = encode $ dumpDefault (eta) -dumpDefault ∷ ∀ a. Show a ⇒ Default a → DefaultRecord +dumpDefault ∷ Default → DefaultRecord dumpDefault (Default x) = { source: "user", value: maybe2string x } type DefaultRecord = diff --git a/src/AnyAll/Relevance.purs b/src/AnyAll/Relevance.purs index d60c14d..c19777b 100644 --- a/src/AnyAll/Relevance.purs +++ b/src/AnyAll/Relevance.purs @@ -80,5 +80,5 @@ evaluateAll items | Just false `elem` items = Just false | otherwise = Nothing -lookupMarking :: String -> Marking -> Default Boolean +lookupMarking :: String -> Marking -> Default lookupMarking node marking = fromMaybe (Default Nothing) (Map.lookup node (getMarking marking)) diff --git a/src/AnyAll/Types.purs b/src/AnyAll/Types.purs index 305cd2e..42d21ec 100644 --- a/src/AnyAll/Types.purs +++ b/src/AnyAll/Types.purs @@ -51,7 +51,7 @@ newtype Q = Q , andOr :: AndOr String , tagNL :: Map.Map String String , prePost :: Maybe (Label String) - , mark :: Default Boolean + , mark :: Default , children :: Array Q } @@ -65,7 +65,7 @@ type R = , andOr :: AndOr String , tagNL :: Map.Map String String , prePost :: Maybe (Label String) - , mark :: Default Boolean + , mark :: Default } -- instance encodeQ :: Encode (Q) where