Created
September 26, 2019 12:12
-
-
Save cblp/d7c1994cef093963337985558932bc69 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment