Skip to content

Instantly share code, notes, and snippets.

@i-am-the-slime
Last active May 31, 2021 10:47
Show Gist options
  • Save i-am-the-slime/ae06596c1fde0255cc2d6c8d639d5aa5 to your computer and use it in GitHub Desktop.
Save i-am-the-slime/ae06596c1fde0255cc2d6c8d639d5aa5 to your computer and use it in GitHub Desktop.
module Bla where
newtype Sponsored = Sponsored String
derive instance newtypeSponsored ∷ Newtype Sponsored _
derive newtype instance eqSponsored ∷ Eq Sponsored
derive newtype instance ordSponsored ∷ Ord Sponsored
newtype VerifiedAccount = VerifiedAccount String
newtype Verified = Verified String
newtype Translations = Translations
{ adLink ∷ AdLinkLabel
, sponsored ∷ Sponsored
, verifiedAccount ∷ VerifiedAccount
, verified ∷ Verified
}
derive instance newtypeTranslations ∷ Newtype Translations _
sponsored_ ∷ ∀ ctx. Lens' { translations ∷ Translations | ctx } String
sponsored_ = barlow (key ∷ _ "translations!.sponsored!")
@i-am-the-slime
Copy link
Author

Das geht:

sponsored_ =
  prop (Proxy ∷ _ "translations")
    <<< _Newtype
    <<< prop (Proxy ∷ _ "sponsored")
    <<< _Newtype

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment