|
|
@@ -5,11 +5,13 @@ import Prelude
|
|
|
|
|
|
import Control.Monad.Writer (Writer, tell)
|
|
|
import Data.Either (Either(..), hush, note)
|
|
|
+import Data.Foldable (class Foldable, foldMap, foldlDefault, foldrDefault)
|
|
|
import Data.Generic.Rep (class Generic)
|
|
|
import Data.List (List)
|
|
|
import Data.List.Types (NonEmptyList)
|
|
|
import Data.Maybe (Maybe(..))
|
|
|
import Data.Show.Generic (genericShow)
|
|
|
+import Data.Traversable (class Traversable, sequence, traverseDefault)
|
|
|
import Effect (Effect)
|
|
|
import Effect.Class.Console (log, logShow)
|
|
|
import LinkedIn (DetachedNode)
|
|
|
@@ -34,6 +36,20 @@ instance Functor ArtDecoCenterHeaderAlt where
|
|
|
map f (ArtDecoCenterHeaderAlt {bold, normal}) =
|
|
|
ArtDecoCenterHeaderAlt ({bold: f bold, normal: map f normal})
|
|
|
|
|
|
+instance Foldable ArtDecoCenterHeaderAlt where
|
|
|
+ foldMap f (ArtDecoCenterHeaderAlt {bold, normal}) = mempty <> (f bold) <> (foldMap f normal)
|
|
|
+
|
|
|
+ foldl = \x -> foldlDefault x
|
|
|
+ foldr = \x -> foldrDefault x
|
|
|
+
|
|
|
+instance Traversable ArtDecoCenterHeaderAlt where
|
|
|
+ sequence (ArtDecoCenterHeaderAlt {bold, normal}) = ado
|
|
|
+ b <- bold
|
|
|
+ n <- sequence normal
|
|
|
+ in ArtDecoCenterHeaderAlt {bold: b, normal: n}
|
|
|
+
|
|
|
+ traverse = \x -> traverseDefault x
|
|
|
+
|
|
|
data ArtDecoCardAltElement a = ArtDecoCardAltElement {
|
|
|
pvs_entity :: ArtDecoCenterHeaderAlt a
|
|
|
}
|
|
|
@@ -50,6 +66,19 @@ instance Functor ArtDecoCardAltElement where
|
|
|
map f (ArtDecoCardAltElement {pvs_entity}) =
|
|
|
ArtDecoCardAltElement ({pvs_entity: map f pvs_entity})
|
|
|
|
|
|
+instance Foldable ArtDecoCardAltElement where
|
|
|
+ foldMap f (ArtDecoCardAltElement {pvs_entity}) = mempty <> (foldMap f pvs_entity)
|
|
|
+
|
|
|
+ foldl = \x -> foldlDefault x
|
|
|
+ foldr = \x -> foldrDefault x
|
|
|
+
|
|
|
+instance Traversable ArtDecoCardAltElement where
|
|
|
+ sequence (ArtDecoCardAltElement {pvs_entity}) = ado
|
|
|
+ p <- sequence pvs_entity
|
|
|
+ in ArtDecoCardAltElement {pvs_entity: p}
|
|
|
+
|
|
|
+ traverse = \x -> traverseDefault x
|
|
|
+
|
|
|
queryArtDecoCardAlt :: Node → Effect (Either QueryError (ArtDecoCardAltElement Node))
|
|
|
queryArtDecoCardAlt n = runExceptT do
|
|
|
pvs <- runOne ":scope div.pvs-entity--padded" n
|