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

Remove unused type param #129

Merged
merged 1 commit into from
Sep 9, 2024
Merged
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
16 changes: 8 additions & 8 deletions src/AnyAll/Marking.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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 _
Expand Down Expand Up @@ -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 =
Expand Down
2 changes: 1 addition & 1 deletion src/AnyAll/Relevance.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
4 changes: 2 additions & 2 deletions src/AnyAll/Types.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
Expand Down