Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- krafted and shared by @cblp
- {-# LANGUAGE DeriveGeneric #-}
- {-# LANGUAGE DuplicateRecordFields #-}
- {-# LANGUAGE NamedFieldPuns #-}
- {-# LANGUAGE OverloadedLabels #-}
- import Control.Lens
- import Data.Generics.Labels
- import GHC.Generics
- import Prelude hiding (id)
- import qualified Prelude
- ı = Prelude.id
- data A = A {id :: Int}
- deriving (Generic)
- data B = B {id :: Int}
- deriving (Generic)
- main = do
- let a = A {id = 1}
- print $ let A {id} = a in ı id
- let b = B {id = 2}
- print $ let B {id} = b & #id %~ negate in id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement