From e36be137db78358cbbbf8e16396c391659f8d240 Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Sat, 3 May 2025 16:45:27 +0200 Subject: [PATCH] Fix some warnings. --- src/App/Page/Zone.purs | 5 +---- src/App/Templates/Table.purs | 28 +++++++++++----------------- src/App/Validation/DNS.purs | 5 ++--- src/Utils.purs | 3 +++ 4 files changed, 17 insertions(+), 24 deletions(-) diff --git a/src/App/Page/Zone.purs b/src/App/Page/Zone.purs index fa1d1f0..84b30c6 100644 --- a/src/App/Page/Zone.purs +++ b/src/App/Page/Zone.purs @@ -21,7 +21,7 @@ import Web.HTML (window) as HTML import Web.HTML.Window (sessionStorage) as Window import Web.Storage.Storage as Storage -import Utils (attach_id, remove_id) +import Utils (id, attach_id, remove_id) import App.Validation.Email as Email import App.Type.CAA as CAA @@ -64,9 +64,6 @@ import App.Validation.DNS as Validation type RRId = Int -id :: forall a. a -> a -id x = x - -- | `App.Page.Zone` can send messages through websocket interface -- | connected to dnsmanagerd. See `App.WS`. -- | diff --git a/src/App/Templates/Table.purs b/src/App/Templates/Table.purs index 10086df..aa8cf5b 100644 --- a/src/App/Templates/Table.purs +++ b/src/App/Templates/Table.purs @@ -7,7 +7,7 @@ module App.Templates.Table , display_mechanisms ) where -import Prelude +import Prelude (comparing, map, not, show, (#), ($), (&&), (<<<), (<>), (==), (>)) import CSSClasses as C @@ -15,7 +15,7 @@ import Data.Array.NonEmpty as NonEmpty import Data.Array as A import Data.Maybe (Maybe(..), fromMaybe, maybe) -import Data.Tuple +import Data.Tuple (Tuple(..)) import Style as Style import Style.Button as Button @@ -23,23 +23,17 @@ import Bulma as Bulma import Halogen.HTML as HH import Halogen.HTML.Properties as HP import Data.String.CodePoints as CP -import Utils (attach_id, remove_id) +import Utils (id, attach_id) import App.Type.DMARC as DMARC -import App.Type.ResourceRecord (ResourceRecord, emptyRR - , show_qualifier, show_qualifier_char - , show_mechanism_type, show_mechanism, to_mechanism - , show_modifier_type, show_modifier, to_modifier - , qualifiers - , mechanism_types, qualifier_types, modifier_types) -import App.Type.ResourceRecord (Mechanism, Modifier, Qualifier(..), SRVProtocol(..) - , srv_protocols, srv_protocols_txt) as RR +import App.Type.ResourceRecord (ResourceRecord + , show_mechanism, show_mechanism_type + , show_modifier, show_modifier_type + , show_qualifier, show_qualifier_char) +import App.Type.ResourceRecord (Mechanism, Modifier, Qualifier) as RR import App.Type.DomainInfo (DomainInfo) -id :: forall a. a -> a -id x = x - txt_name :: forall w i. String -> HH.HTML w i txt_name t = HH.td [ rr_name_style ] [ rr_name_text ] @@ -526,7 +520,7 @@ display_mechanisms action_remove_mechanism ms = , HH.td_ [ Style.p m.v ] , HH.td_ [ Button.alert_btn "x" (action_remove_mechanism i) ] ] - mechanism_table_header :: forall w i. HH.HTML w i + mechanism_table_header :: HH.HTML w i mechanism_table_header = HH.thead_ [ HH.tr_ [ HH.th_ [ HH.text "Policy" ] , HH.th_ [ HH.text "Type" ] @@ -546,7 +540,7 @@ display_modifiers action_remove_modifier ms = , HH.td_ [ Style.p m.v ] , HH.td_ [ Button.alert_btn "x" (action_remove_modifier i) ] ] - modifier_table_header :: forall w i. HH.HTML w i + modifier_table_header :: HH.HTML w i modifier_table_header = HH.thead_ [ HH.tr_ [ HH.th_ [ HH.text "Type" ] , HH.th_ [ HH.text "Value" ] @@ -564,7 +558,7 @@ display_dmarc_mail_addresses f ms = , HH.td_ [ Style.p $ maybe "(no size limit)" show m.limit ] , HH.td_ [ Button.alert_btn "x" (f i) ] ] - dmarc_dmarcuri_table_header :: forall w i. HH.HTML w i + dmarc_dmarcuri_table_header :: HH.HTML w i dmarc_dmarcuri_table_header = HH.thead_ [ HH.tr_ [ HH.th_ [ HH.text "Email address" ] , HH.th_ [ HH.text "Report size limit" ] diff --git a/src/App/Validation/DNS.purs b/src/App/Validation/DNS.purs index e049801..4eed71d 100644 --- a/src/App/Validation/DNS.purs +++ b/src/App/Validation/DNS.purs @@ -23,6 +23,8 @@ import App.Type.DKIM as DKIM import App.Type.DMARC as DMARC import App.Type.CAA as CAA +import Utils (id) + -- | **History:** -- | The module once used dedicated types for each type of RR. -- | That comes with several advantages. @@ -349,6 +351,3 @@ validation entry = case entry.rrtype of "DKIM" -> toEither $ validationDKIM entry "DMARC" -> toEither $ validationDMARC entry _ -> toEither $ invalid [UNKNOWN] - -id :: forall a. a -> a -id x = x diff --git a/src/Utils.purs b/src/Utils.purs index 20420d6..8a60268 100644 --- a/src/Utils.purs +++ b/src/Utils.purs @@ -18,3 +18,6 @@ remove_id i arr = case A.head arr of then remove_id i (fromMaybe [] $ A.tail arr) else [x] <> remove_id i (fromMaybe [] $ A.tail arr) Nothing -> [] + +id :: forall a. a -> a +id x = x