Commit c21c41f0 authored by Mart Lubbers's avatar Mart Lubbers

Add missing generic cases to gDefault

parent 876c9146
Pipeline #9371 passed with stage
in 1 minute and 41 seconds
......@@ -4,6 +4,6 @@ import StdGeneric
generic gDefault a :: a
derive gDefault Int, Real, String, PAIR, EITHER, CONS, FIELD, OBJECT
derive gDefault Int, Bool, Real, Char, String, UNIT, PAIR, EITHER, CONS, FIELD, OBJECT, RECORD
derive gDefault [], (,), (,,), (,,,), (,,,,), (,,,,,), (,,,,,,), (,,,,,,,)
derive gDefault (), [], (,), (,,), (,,,), (,,,,), (,,,,,), (,,,,,,), (,,,,,,,)
......@@ -4,15 +4,18 @@ implementation module Data.Generics.GenDefault
import StdGeneric
generic gDefault a :: a
gDefault{|Int|} = 0
gDefault{|Bool|} = False
gDefault{|Real|} = 0.0
gDefault{|Char|} = '-'
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