2{-# LANGUAGE FlexibleInstances #-}
3{-# LANGUAGE MultiParamTypeClasses #-}
4{-# LANGUAGE ScopedTypeVariables #-}
5{-# LANGUAGE TypeApplications #-}
6{-# LANGUAGE TypeFamilies #-}
7{-# LANGUAGE UndecidableInstances #-}
8{-# OPTIONS_GHC -Wno-orphans #-}
11--------------------------------------------------------------------------------
13-- Module : Data.Generics.Labels
14-- Copyright : (C) 2017 Csongor Kiss
15-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
17-- Stability : experimental
18-- Portability : non-portable
20-- Provides an (orphan) IsLabel instance for field lenses.
21-- Use at your own risk.
22--------------------------------------------------------------------------------
24module Data.Generics.Labels () where
26import Data.Generics.Product
27import GHC.OverloadedLabels
30instance (HasField field s t a b, Functor f, sft ~ (s -> f t)) =>
31 IsLabel field ((a -> f b) -> sft) where
32#if __GLASGOW_HASKELL__ >= 802
33 fromLabel = field @field
35 fromLabel _ = field @field
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list