higgledy-0.3.1.0: Partial types as a type constructor.

Copyright(c) Tom Harding 2019
LicenseMIT
Maintainertom.harding@habito.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Data.Generic.HKD.Named

Description

 
Synopsis

Documentation

class Record (structure :: Type) (f :: Type -> Type) (k :: Type) | f structure -> k where Source #

The record function lets us supply arguments to a type one by one, but can cause confusion when working with a record. If the record contains two fields of the same type, for example, we've introduced an opportunity for bugs and confusion. The record function uses the wonderful named package to help us:

>>> :set -XDeriveGeneric -XTypeApplications
>>> :{
data User
  = User { name :: String, enemy :: String }
  deriving Generic
:}
>>> :{
test :: _
test = record @User
:}
...
... Found type wildcard ...
... standing for ...("name" :! f [Char])
...   -> ("enemy" :! f [Char]) -> HKD User f...
...

Methods

record :: k Source #

Instances
(Contravariant (HKD_ f structure), Functor (HKD_ f structure), list ~ Rearrange (HKD_ f structure), GUpcast list (HKD_ f structure), GRecord list f structure k) => Record structure f k Source # 
Instance details

Defined in Data.Generic.HKD.Named

Methods

record :: k Source #