Commit e9d1006a authored by Steffen Michels's avatar Steffen Michels

Merge branch 'add-gen-default-cases' into 'master'

Add missing generic cases to gDefault

See merge request !104
parents 876c9146 cd71a6d8
Pipeline #9380 passed with stage
in 2 minutes and 1 second
......@@ -4,6 +4,6 @@ import StdGeneric
generic gDefault a :: a
derive gDefault Int, Real, String, PAIR, EITHER, CONS, FIELD, OBJECT
derive gDefault Int, Real, String, UNIT, PAIR, EITHER, CONS, FIELD, OBJECT, RECORD
derive gDefault [], (,), (,,), (,,,), (,,,,), (,,,,,), (,,,,,,), (,,,,,,,)
derive gDefault (), [], (,), (,,), (,,,), (,,,,), (,,,,,), (,,,,,,), (,,,,,,,)
......@@ -4,15 +4,16 @@ implementation module Data.Generics.GenDefault
import StdGeneric
generic gDefault a :: a
gDefault{|Int|} = 0
gDefault{|Real|} = 0.0
gDefault{|String|} = ""
gDefault{|UNIT|} = UNIT
gDefault{|EITHER|} dl dr = RIGHT dr
gDefault{|EITHER|} dl dr = LEFT dl
gDefault{|PAIR|} dl dr = PAIR dl dr
gDefault{|CONS|} dc = CONS dc
gDefault{|FIELD|} df = FIELD df
gDefault{|OBJECT|} do = OBJECT do
gDefault{|RECORD|} do = RECORD do
derive gDefault [], (,), (,,), (,,,), (,,,,), (,,,,,), (,,,,,,), (,,,,,,,)
derive gDefault (), [], (,), (,,), (,,,), (,,,,), (,,,,,), (,,,,,,), (,,,,,,,)
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