|
|
@@ -3,6 +3,7 @@ module LinkedIn.ArtDeco where
|
|
|
import Prelude
|
|
|
|
|
|
import Data.Either (Either(..), hush)
|
|
|
+import Data.Foldable (class Foldable, foldMap, foldlDefault, foldrDefault)
|
|
|
import Data.Generic.Rep (class Generic)
|
|
|
import Data.List (List)
|
|
|
import Data.List.NonEmpty (NonEmptyList)
|
|
|
@@ -44,30 +45,60 @@ instance Show a => Show (ArtDecoPvsEntitySubComponent a) where
|
|
|
show = genericShow
|
|
|
derive instance Functor ArtDecoPvsEntitySubComponent
|
|
|
|
|
|
+instance Foldable ArtDecoPvsEntitySubComponent where
|
|
|
+ foldMap f (ArtDecoPvsEntitySubComponent sc) = foldMap f sc
|
|
|
+
|
|
|
+ foldl = \x -> foldlDefault x
|
|
|
+ foldr = \x -> foldrDefault x
|
|
|
+
|
|
|
derive instance Generic (ArtDecoCenterContent a) _
|
|
|
derive instance Eq a => Eq(ArtDecoCenterContent a)
|
|
|
instance Show a => Show(ArtDecoCenterContent a) where
|
|
|
show = genericShow
|
|
|
derive instance Functor ArtDecoCenterContent
|
|
|
|
|
|
+instance Foldable ArtDecoCenterContent where
|
|
|
+ foldMap f (ArtDecoCenterContent c) = foldMap (foldMap f) c
|
|
|
+
|
|
|
+ foldl = \x -> foldlDefault x
|
|
|
+ foldr = \x -> foldrDefault x
|
|
|
+
|
|
|
derive instance Generic (ArtDecoCenterHeader a) _
|
|
|
derive instance Eq a => Eq(ArtDecoCenterHeader a)
|
|
|
instance Show a => Show(ArtDecoCenterHeader a) where
|
|
|
show = genericShow
|
|
|
derive instance Functor ArtDecoCenterHeader
|
|
|
|
|
|
+instance Foldable ArtDecoCenterHeader where
|
|
|
+ foldMap f (ArtDecoCenterHeader {bold, normal, light}) = f bold <> foldMap f normal <> foldMap (foldMap f) light
|
|
|
+
|
|
|
+ foldl = \x -> foldlDefault x
|
|
|
+ foldr = \x -> foldrDefault x
|
|
|
+
|
|
|
derive instance Generic (ArtDecoCenter a) _
|
|
|
derive instance Eq a => Eq(ArtDecoCenter a)
|
|
|
instance Show a => Show(ArtDecoCenter a) where
|
|
|
show = genericShow
|
|
|
derive instance Functor ArtDecoCenter
|
|
|
|
|
|
+instance Foldable ArtDecoCenter where
|
|
|
+ foldMap f (ArtDecoCenter {header, content}) = foldMap f header <> foldMap f content
|
|
|
+
|
|
|
+ foldl = \x -> foldlDefault x
|
|
|
+ foldr = \x -> foldrDefault x
|
|
|
+
|
|
|
derive instance Generic (ArtDecoPvsEntity a) _
|
|
|
derive instance Eq a => Eq(ArtDecoPvsEntity a)
|
|
|
instance Show a => Show(ArtDecoPvsEntity a) where
|
|
|
show = genericShow
|
|
|
derive instance Functor ArtDecoPvsEntity
|
|
|
|
|
|
+instance Foldable ArtDecoPvsEntity where
|
|
|
+ foldMap f (ArtDecoPvsEntity {side: _, center}) = foldMap f center
|
|
|
+
|
|
|
+ foldl = \x -> foldlDefault x
|
|
|
+ foldr = \x -> foldrDefault x
|
|
|
+
|
|
|
parseArtDecoPvsEntitySubComponent ∷ Parser (ArtDecoPvsEntitySubComponent DetachedNode)
|
|
|
parseArtDecoPvsEntitySubComponent n = do
|
|
|
content <- queryAndDetachOne "span[aria-hidden=true]" n
|