Commit 8355e187 authored by Camil Staps's avatar Camil Staps 🐧

Merge branch 'add-getName-class-generics' into 'master'

add descriptorName class to Data.Generics

See merge request !299
parents 96bc3947 d1ba344e
Pipeline #34193 failed with stage
in 2 minutes and 11 seconds
......@@ -2,6 +2,9 @@ definition module Data.Generics
import StdGeneric
class genericDescriptorName a :: !a -> String
instance genericDescriptorName GenericTypeDefDescriptor, GenericConsDescriptor, GenericRecordDescriptor, GenericFieldDescriptor
fromOBJECT :: !(OBJECT x) -> x
fromCONS :: !(CONS x) -> x
fromRECORD :: !(RECORD x) -> x
......
......@@ -2,6 +2,12 @@ implementation module Data.Generics
import StdGeneric
class genericDescriptorName a :: !a -> String
instance genericDescriptorName GenericTypeDefDescriptor where genericDescriptorName gtd = gtd.gtd_name
instance genericDescriptorName GenericConsDescriptor where genericDescriptorName gcd = gcd.gcd_name
instance genericDescriptorName GenericRecordDescriptor where genericDescriptorName grd = grd.grd_name
instance genericDescriptorName GenericFieldDescriptor where genericDescriptorName gfd = gfd.gfd_name
fromOBJECT :: !(OBJECT x) -> x
fromOBJECT (OBJECT x) = x
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment