Files
inter-hub/Web/View/Prelude.hs
Bernd Worsch 2c22766cd6 fix(WP-0017/E5): Layer 3 error fixes — round 3 (24 files)
Int16→Int in score/stars functions; uuid-based readMay→UUID.fromText;
autoRefresh do-notation fix; id→\x->x ambiguity in HubRoutingRules;
MarketplaceDashboard replaced raw SQL with IHP query builder; optional
hub selector in TypeRegistry views via CanSelect (Text, Maybe Id) instance
added to Web.View.Prelude; import consolidations to Web.View.Prelude.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 13:11:32 +00:00

32 lines
991 B
Haskell

module Web.View.Prelude
( module Web.Types
, module Generated.Types
, module IHP.Prelude
, module IHP.ViewPrelude
) where
import Web.Types
import Generated.Types
import IHP.Prelude
import IHP.ViewPrelude
import Web.Routes ()
-- | Allow [(Text, Text)] option lists in selectField/radioField.
-- The first element is the display label; the second is the stored value.
instance CanSelect (Text, Text) where
type SelectValue (Text, Text) = Text
selectValue (_, v) = v
selectLabel (l, _) = l
-- | Allow [(Text, Id' tag)] option lists (e.g. hub selectors) in selectField.
instance CanSelect (Text, Id' tag) where
type SelectValue (Text, Id' tag) = Id' tag
selectValue (_, v) = v
selectLabel (l, _) = l
-- | Allow [(Text, Maybe (Id' tag))] option lists (e.g. optional hub selectors).
instance CanSelect (Text, Maybe (Id' tag)) where
type SelectValue (Text, Maybe (Id' tag)) = Maybe (Id' tag)
selectValue (_, v) = v
selectLabel (l, _) = l