wakame-0.1.0.0: Functions to manipulate records

Safe HaskellNone
LanguageHaskell2010

Wakame.Keys

Synopsis

Documentation

>>> import Wakame
>>> data Point = Point { x :: Double, y :: Double } deriving (Show, Generic)
>>> pt = Point 1.2 8.3

keys :: (IsString s, Generic a, Keys' s (Rep a)) => a -> [s] Source #

Function to retrieve key values

Return value can be anything which has IsString instance. >>> import Data.Functor.Identity (Identity) >>> keys pt :: [Identity String] [Identity "x",Identity "y"]

class IsString s => Keys' s f where Source #

Methods

keys' :: f a -> [s] Source #

Instances
(IsString s, KnownSymbol key) => Keys' s (S1 (MetaSel (Nothing :: Maybe Symbol) su ss ds) (Rec0 (V ((,) key a))) :: k -> Type) Source # 
Instance details

Defined in Wakame.Keys

Methods

keys' :: S1 (MetaSel Nothing su ss ds) (Rec0 (V (key, a))) a0 -> [s] Source #

(IsString s, KnownSymbol key) => Keys' s (S1 (MetaSel (Just key) su ss ds) a :: k -> Type) Source # 
Instance details

Defined in Wakame.Keys

Methods

keys' :: S1 (MetaSel (Just key) su ss ds) a a0 -> [s] Source #

(Keys' s a, Keys' s b) => Keys' s (a :*: b :: k -> Type) Source # 
Instance details

Defined in Wakame.Keys

Methods

keys' :: (a :*: b) a0 -> [s] Source #

Keys' s a => Keys' s (C1 f a :: k -> Type) Source # 
Instance details

Defined in Wakame.Keys

Methods

keys' :: C1 f a a0 -> [s] Source #

Keys' s a => Keys' s (D1 f a :: k -> Type) Source # 
Instance details

Defined in Wakame.Keys

Methods

keys' :: D1 f a a0 -> [s] Source #