module IHP.View.Classes where
import Prelude hiding (unwords)
import Data.Text (Text, unwords)
import Data.String (IsString(..))
import Data.String.Conversions (cs)
import IHP.HaskellSupport ((|>))
classes :: [(Text, Bool)] -> Text
classes :: [(Text, Bool)] -> Text
classes ![(Text, Bool)]
classNameBoolPairs =
[(Text, Bool)]
classNameBoolPairs
[(Text, Bool)]
-> ([(Text, Bool)] -> [(Text, Bool)]) -> [(Text, Bool)]
forall a b. a -> (a -> b) -> b
|> ((Text, Bool) -> Bool) -> [(Text, Bool)] -> [(Text, Bool)]
forall a. (a -> Bool) -> [a] -> [a]
filter (Text, Bool) -> Bool
forall a b. (a, b) -> b
snd
[(Text, Bool)] -> ([(Text, Bool)] -> [Text]) -> [Text]
forall a b. a -> (a -> b) -> b
|> ((Text, Bool) -> Text) -> [(Text, Bool)] -> [Text]
forall a b. (a -> b) -> [a] -> [b]
map (Text, Bool) -> Text
forall a b. (a, b) -> a
fst
[Text] -> ([Text] -> Text) -> Text
forall a b. a -> (a -> b) -> b
|> [Text] -> Text
unwords
{-# INLINABLE classes #-}
instance IsString (Text, Bool) where
fromString :: String -> (Text, Bool)
fromString String
string = (String -> Text
forall a b. ConvertibleStrings a b => a -> b
cs String
string, Bool
True)
{-# INLINABLE fromString #-}