File: Test88.hs

package info (click to toggle)
haskell-generic-lens 2.2.2.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 240 kB
  • sloc: haskell: 1,378; makefile: 3
file content (17 lines) | stat: -rw-r--r-- 421 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeApplications #-}
-- | 

module Test88 where

import Control.Lens
import Data.Generics.Product.Param
import GHC.Generics

data Foo a = Foo a deriving (Eq, Show, Generic)
data Bar b = Bar b deriving (Eq, Show, Generic)
data FooBar c = FooBar (Foo (Bar c)) deriving (Eq, Show, Generic)

foo :: FooBar Int -> FooBar String
foo = over (param @0) show