Commit d1ba344e authored by Mart Lubbers's avatar Mart Lubbers

add genericDescriptorName class to Data.Generics

parent 96bc3947
Pipeline #34089 failed with stage
in 1 minute and 53 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